Supabase is the leading open-source Firebase alternative, providing a full backend-as-a-service (BaaS) stack built on PostgreSQL. A complete Supabase deployment combines PostgreSQL database storage, Kong API Gateway, GoTrue authentication, PostgREST automatic REST APIs, Realtime WebSockets, Storage bucket services, Vector embeddings, and the web-based Supabase Studio UI.
While Supabase offers a managed cloud service, self-hosting Supabase on Ubuntu 24.04 LTS (Noble Numbat) or 22.04 LTS (Jammy Jellyfish) using Docker Compose gives developers 100% data sovereignty, zero API usage caps, and complete control over database extensions.
Last updated: July 24, 2026
Key Takeaways
- Self-hosting Supabase requires Docker Engine and the Docker Compose V2 plugin (`docker compose`).
- The official Supabase repository provides a production-ready `docker-compose.yml` file under the `docker/` directory.
- Never deploy Supabase with default secrets: you must generate unique values for `POSTGRES_PASSWORD`, `JWT_SECRET`, `ANON_KEY`, and `SERVICE_ROLE_KEY` in your `.env` file.
- Once running, Supabase Studio web dashboard is accessible on port `8000`, and Kong API Gateway exposes REST and Auth APIs on port `8000`.
What are the system requirements for self-hosting Supabase?
Self-hosting the complete Supabase Docker stack requires a 64-bit Linux server running Ubuntu 24.04 or 22.04 LTS with at least 4 GB RAM, 2 CPU cores, 10 GB disk space, and Docker Engine 24.0+ with Docker Compose V2 installed.
Running the multi-container Supabase stack requires sufficient memory and CPU resources:
- Operating System: Ubuntu 24.04 LTS, 22.04 LTS, or Debian 12
- Memory: Minimum 4 GB RAM (8 GB+ recommended for production database caching)
- CPU: 2 or more CPU cores
- Disk Space: 10 GB available SSD storage for Docker container images and database volumes
- Prerequisites: Docker Engine 24.0+ and Docker Compose V2 installed
How do you install Docker and Docker Compose on Ubuntu?
To install Docker Engine and the Docker Compose V2 plugin on Ubuntu, import the official Docker GPG repository keyring and install docker-ce along with docker-compose-plugin using the apt package manager.
If Docker is not already installed on your Ubuntu server:
sudo apt update
sudo apt install -y ca-certificates curl gnupg
# Add official Docker GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add Docker repository to APT sources
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list
# Install Docker Engine and Compose Plugin
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add user to docker group
sudo usermod -aG docker $USERVerify Docker installation:
docker compose versionHow do you set up Supabase using Docker Compose?
To set up self-hosted Supabase using Docker Compose, clone the official Supabase repository, enter the docker directory, create a .env configuration file, and generate secure database passwords and JWT secrets.
Follow these steps to clone the official Supabase setup repository and configure environment variables.
Step 1: Clone the Official Supabase Repository
Clone the Supabase repository and navigate to the docker configuration folder:
# Clone the repository with shallow depth
git clone --depth 1 https://github.com/supabase/supabase
# Navigate to docker folder
cd supabase/dockerStep 2: Copy the Environment Template File
Create your local .env configuration file from the template:
cp .env.example .envStep 3: Generate Secure JWT Secrets and Database Passwords
Before starting containers, you MUST update default passwords and cryptographic keys.
-
Generate a strong random password for PostgreSQL:
bashopenssl rand -base64 24Edit
.envand setPOSTGRES_PASSWORDto this generated password. -
Generate a secure 32-character random string for your JWT secret:
bashopenssl rand -base64 32Edit
.envand updateJWT_SECRETwith this string. -
Generate valid
ANON_KEYandSERVICE_ROLE_KEYAPI tokens corresponding to your newJWT_SECRETusing a JWT signing tool or jwt.io, or set up automated key generation as documented in.env.
How do you start and verify Supabase services?
To start and verify self-hosted Supabase services, execute docker compose up -d inside your supabase/docker directory and verify container health status using docker compose ps.
Once your .env file is configured, launch the container stack using Docker Compose:
Step 1: Start Supabase Containers in Detached Mode
docker compose up -dStep 2: Check Container Health Status
Verify that all Supabase microservices are active and healthy:
docker compose psExpected running services:
supabase-db(PostgreSQL 15/16 with pgvector extension)supabase-kong(API Gateway)supabase-auth(GoTrue Authentication service)supabase-rest(PostgREST API server)supabase-realtime(WebSockets server)supabase-storage(S3-compatible Object Storage)supabase-meta(Database Management Metadata API)supabase-studio(Dashboard Web UI)
How do you access Supabase Studio Dashboard?
To access the web-based Supabase Studio Dashboard, open your web browser and navigate to http://<your-server-ip>:8000, which routes administrative UI traffic through the Kong API Gateway container.
Open your web browser and navigate to your server’s IP address or hostname on port 8000:
http://<your-server-ip>:8000From the Supabase Studio Dashboard, you can:
- Create database tables, view schemas, and run raw SQL queries.
- Manage authentication users, email templates, and OAuth providers.
- Configure public and private storage buckets.
- Monitor database logs and REST/GraphQL API endpoints.
In production environments, restrict external access to ports 5432 (Postgres) and 8000 (Studio UI) using UFW firewall rules. Use NGINX or Caddy as a reverse proxy to terminate SSL/TLS certificates and enforce HTTPS over port 443.
Frequently Asked Questions (PAA)
Is self-hosted Supabase completely free?
Yes. The self-hosted Supabase Docker stack is 100% free and open-source under Apache 2.0 and MIT licenses. There are no row limits, bandwidth caps, or user quotas.
What is the default port for Supabase Studio and API Gateway?
Supabase Studio dashboard and Kong API Gateway both run through Kong on port 8000. The raw PostgreSQL database is exposed on port 5432.
How do I update self-hosted Supabase to the latest version?
Navigate to your supabase/docker directory, pull the latest git changes, pull updated Docker images, and restart:
cd supabase/docker
git pull
docker compose pull
docker compose up -dHow do I stop or restart the self-hosted Supabase stack?
To stop all services:
docker compose downTo restart all services:
docker compose restartRead Next
- How to Set Up NGINX Reverse Proxy on Ubuntu
- How to Install PostgreSQL & pgAdmin 4 on Ubuntu & Linux
- How to Install Docker on Ubuntu, macOS, and Windows
Related Articles
Deepen your understanding with these curated continuations.

How to Install Lightweight Kubernetes (K3s) on Ubuntu (2026)
Learn how to install and configure K3s lightweight Kubernetes on Ubuntu 24.04/22.04 LTS with kubectl, non-root access, and Traefik ingress.

How to Install Open-WebUI with Ollama for Local AI (2026)
Step-by-step guide to installing Open-WebUI and Ollama using Docker on Ubuntu and Linux for a private, offline ChatGPT-like AI environment.

How to Install PostgreSQL & pgAdmin 4 on Ubuntu & Linux (2026)
Step-by-step guide to installing PostgreSQL 16/17 and pgAdmin 4 on Ubuntu 24.04/22.04 LTS via official PPA with remote access and security configuration.

