Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Supabase on a VPS (Complete Guide)

Learn how to self-host Supabase on a VPS with a step-by-step 2026 guide covering install, configuration, and securing Supabase for reliable daily use.

How to Self-Host Supabase on a VPS (Complete Guide)

Supabase is an open-source alternative to Firebase that provides a powerful backend-as-a-service platform. Hosting it on a VPS can give you full control over your data and configurations. In this guide, we will walk you through the process of self-hosting Supabase on a VPS, using Docker for easy deployment.

Prerequisites

Before getting started, ensure that you have the following:

ProviderStarting PriceRecommended Specs
Contabo VPS5.99 EUR/mo2 GB RAM, 1 CPU
Hetzner Cloud4.15 EUR/mo2 GB RAM, 1 CPU
DigitalOcean6 USD/mo2 GB RAM, 1 CPU
Vultr6 USD/mo1 GB RAM, 1 CPU
Linode (Akamai)5 USD/mo2 GB RAM, 1 CPU

You can compare more VPS options at our full VPS comparison.

Step 1: Set Up Your VPS

First, you need to set up your VPS. This typically involves:

  1. Choosing an Operating System: We recommend Ubuntu 20.04 LTS for compatibility with Docker.

  2. Accessing Your VPS: Use SSH to connect to your server:

    ssh username@your-vps-ip
  3. Updating Your System: Ensure your packages are up-to-date:

    sudo apt update
    sudo apt upgrade -y

Step 2: Install Docker

To run Supabase, you need Docker installed on your VPS. Follow these commands:

  1. Install dependencies for Docker:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
  2. Add Dockerโ€™s official GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  3. Set up the stable repository:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  4. Install Docker:

    sudo apt update
    sudo apt install docker-ce -y
  5. Start and enable Docker:

    sudo systemctl start docker
    sudo systemctl enable docker
  6. Verify the installation:

    docker --version

Step 3: Pull and Run Supabase Docker Images

Now that Docker is set up, you can pull the Supabase Docker images.

  1. Create a directory for your Supabase project:

    mkdir supabase && cd supabase
  2. Create a Docker Compose file:

    Create a docker-compose.yml file with the following content:

    version: '3.8'
    services:
      db:
        image: supabase/postgres
        environment:
          POSTGRES_PASSWORD: your_password
          POSTGRES_USER: your_user
          POSTGRES_DB: your_db
        ports:
          - "5432:5432"
      auth:
        image: supabase/gotrue
        ports:
          - "9999:9999"
      realtime:
        image: supabase/realtime
        ports:
          - "4000:4000"
      studio:
        image: supabase/studio
        ports:
          - "3000:3000"

    Replace your_password, your_user, and your_db with your desired values.

  3. Start the Supabase services:

    Run the following command in the same directory as your docker-compose.yml:

    docker-compose up -d
  4. Check the running services:

    You can check the logs using:

    docker-compose logs

Step 4: Access Supabase Studio

Once your services are running, you can access Supabase Studio by navigating to http://your-vps-ip:3000 in your browser. From here, you can manage your database, authentication, and more.

FAQs

Q1: What are the benefits of self-hosting Supabase on a VPS?

Self-hosting Supabase on a VPS allows for greater control, enhanced security, and customized configurations. You manage your hardware and software, ensuring you adhere to your specific compliance needs. Additionally, it can be more cost-effective in the long run, especially if you expect significant usage, as you can avoid vendor lock-in and maintain ownership of your data.

Q2: Can I scale my Supabase instance if I need more resources?

Yes, you can scale your Supabase instance based on your needs. This can involve upgrading your VPS to a larger plan that provides greater CPU and RAM resources or optimizing your Docker configurations. Both strategies are feasible and can be executed without significant downtime, ensuring your applications remain available while you adjust your infrastructure.

Q3: What are the common issues faced when self-hosting Supabase?

Common issues include configuration mistakes, insufficient resources on the VPS, and network connectivity problems. Ensure your Docker containers are properly configured and that your VPS meets the necessary specifications. Additionally, consult the Supabase community on r/selfhosted for troubleshooting tips and best practices in self-hosting applications for advice and solutions.

By following this guide, you can successfully self-host Supabase on a VPS, allowing you to leverage a robust backend solution without compromising on control and privacy.