Supabase on Azure VM

Deploy your self-hosted Supabase instance on Azure VM quickly and easily. Our pre-configured VM image ensures a smooth setup process.

1. How to Deploy

  1. Visit the Azure Marketplace
  2. Search for "Supabase by Alaiso"
  3. Click "Get It Now" or "Create"
  4. Follow the deployment wizard:
    • Select your subscription
    • Choose a resource group
    • Select VM size (recommended: at least 4 vCPUs, 16GB RAM)
    • Configure networking settings (ensure ports 80, 443, and 22 are open)
    • Review and create

2. Installation Details

Network Security Group (NSG) Configuration

Configure your Azure NSG to allow the following inbound ports:

  • Port 22 - SSH access
  • Port 80 - HTTP traffic
  • Port 8000 - Supabase API / Studio

To configure NSG in Azure Portal:

  1. Go to your VM's Network Security Group
  2. Click on "Inbound security rules"
  3. Add rules for ports 80 and 8000 with:
    • Source: Any
    • Source port ranges: *
    • Destination: 80 / 443 / 8000
    • Protocol: TCP
    • Priority: 1000-1100 range

Directory Structure

Supabase is installed in the following location:

/opt/supabase/

Default Ports

  • Port 80 - HTTP traffic
  • Port 443 - HTTPS traffic (when SSL is configured)
  • Port 5432 - PostgreSQL (internal only)
  • Port 8000 - REST API & Supabase Studio

3. Accessing Supabase Studio

After deployment and NSG configuration, you can access the Supabase Studio:

Default Credentials

URL: http://your-vm-ip:8000
Email: supabase
Password: this_password_is_insecure_and_should_be_updated

Important: Change the default credentials immediately after first login for security!

First-Time Setup

  1. Navigate to http://your-vm-ip:8000 in your browser
  2. Log in with the default credentials
  3. Configure your project settings:
    • API settings
    • Authentication settings
    • Database configurations

API Access

After logging into Studio, you can find your API keys under Project Settings > API. You'll need:

  • anon key - for public API access
  • service_role key - for administrative tasks

Security Note: Never expose your service_role key in client-side code!

4. Verify Installation

SSH into your VM

ssh your-username@your-vm-ip

Check Supabase Status

cd /opt/supabase
docker ps  # Check if all containers are running
docker-compose ps  # View detailed status
docker logs supabase-db  # Check database logs
docker logs supabase-api  # Check API logs

Verify that all services are running:

  • PostgreSQL Database (supabase-db)
  • PostgREST API (supabase-rest)
  • GoTrue Auth (supabase-auth)
  • Realtime (supabase-realtime)
  • Storage (supabase-storage)
  • Studio (supabase-studio)

Access Dashboard

Once verified, you can access the Supabase Studio dashboard at:

http://your-vm-ip:8000

5. Common Operations

Start/Stop Services

cd /opt/supabase
docker-compose up -d  # Start all services
docker-compose down  # Stop all services
docker-compose restart  # Restart all services

View Logs

cd /opt/supabase
docker-compose logs -f  # Follow all logs
docker-compose logs -f supabase-db  # Follow specific service logs

Backup Database

cd /opt/supabase
docker exec supabase-db pg_dump -U postgres -F t postgres > backup.tar

6. Troubleshooting

Common Issues

Services not starting
cd /opt/supabase
docker-compose down
docker-compose up -d
Database connection issues
cd /opt/supabase
docker logs supabase-db
docker-compose restart supabase-db
API not responding
cd /opt/supabase
docker logs supabase-api
docker-compose restart supabase-api
Permission issues
sudo chown -R 999:999 /opt/supabase/volumes/db
sudo chmod -R 700 /opt/supabase/volumes/db

Health Check

Run this command to check the health of all services:

cd /opt/supabase
for container in $(docker-compose ps -q); do
    echo "-------------------"
    docker inspect --format "{{.Name}} - {{.State.Status}}" $container
done

7. Security Recommendations

  • Change default passwords immediately after installation
  • Configure SSL/TLS for production environments
  • Regularly update Docker images with docker-compose pull
  • Set up regular database backups
  • Monitor system logs for suspicious activities
  • Use Azure Network Security Groups to restrict access

8. Additional Resources

Official Documentation

For advanced configuration, customization, and upgrades, please refer to the official Supabase documentation:

  • Supabase Self-Hosting Guide - Comprehensive guide for Docker deployments
  • Key topics in the documentation:
    • Environment configuration
    • Database backups and restoration
    • Version upgrades
    • Custom domains and SSL setup
    • Authentication providers configuration
    • Storage configuration

Version Management

Before upgrading your Supabase installation, always:

  • Review the release notes
  • Backup your database and configuration
  • Test upgrades in a staging environment first

9. Contact Support

If you need assistance with your Supabase deployment: