Supabase with Docker on Ubuntu 24.04 (PostgreSQL + Kong + Studio + SSL)

Supabase is an open-source backend-as-a-service (BaaS) platform that provides a powerful alternative to Firebase. Built on PostgreSQL, it delivers a complete backend stack — including authentication, real-time APIs, storage, and an admin dashboard — allowing developers to quickly build applications without losing control over their data or infrastructure.

Running Supabase on Ubuntu 24.04 LTS (Noble Numbat) with Docker ensures a fast, secure, and reproducible environment. Ubuntu 24.04 ships with systemd 255, OpenSSL 3, and the latest Docker Engine and Compose plugins, making it a perfect foundation for hosting a production-ready Supabase stack.


Architecture Overview

LayerComponentRole
OSUbuntu 24.04 LTSStable, secure foundation with long-term support
Container RuntimeDocker Engine + ComposeRuns Supabase and all required services
DatabasePostgreSQL 15/16Stores user data, authentication, and application state
API GatewayKongHandles API routing, rate limiting, and JWT validation
RealtimeSupabase Realtime (Elixir)Enables real-time database change subscriptions
AuthSupabase Auth (GoTrue)Provides authentication and user management
StorageSupabase StorageHandles file uploads and access via Postgres-backed permissions
DashboardSupabase StudioWeb interface for database, API, and user management
TLSLet’s Encrypt / PKIProvides HTTPS for secure API and dashboard access

Why Use Supabase?

  • Open-source Firebase alternative – full control, no vendor lock-in.
  • PostgreSQL-based – benefit from relational data, JSONB fields, and extensions.
  • Built-in authentication – support for email, magic links, and OAuth providers.
  • Realtime APIs – powered by PostgreSQL’s replication system.
  • Powerful dashboard – Supabase Studio for managing database, users, and policies.
  • Self-hosted – ideal for teams prioritizing data privacy and compliance.

Supabase vs Other Backend Platforms

Feature/CapabilitySupabase (Self-hosted)Firebase (Google)Appwrite (Self-hosted)PocketBase (Lightweight)
DatabasePostgreSQLFirestore (NoSQL)MariaDB/PostgreSQLSQLite
HostingSelf-hosted or CloudSaaS onlySelf-hostedSelf-hosted
APIsREST + GraphQLProprietary SDKsREST + GraphQLREST
AuthBuilt-in (JWT + OAuth)Firebase AuthOAuth, JWTBuilt-in
Real-time updatesYesYes (Firestore)LimitedBasic (WebSocket)
Open-sourceYesNoYesYes

Supabase stands out for developers who want Firebase-like functionality but with the freedom and transparency of open-source software.


Security & Best Practices

  • Always run Supabase behind HTTPS using Nginx or Docker’s reverse proxy.
  • Generate strong JWT secrets and service keys using openssl rand -hex 32.
  • Store credentials securely in .env (never commit secrets to version control).
  • Restrict PostgreSQL access to localhost or internal Docker networks.
  • Keep Docker images and Ubuntu packages updated.
  • Use firewall rules (UFW/nftables) to expose only ports 80/443.
  • Automate SSL renewals via Certbot or a reverse proxy with ACME support.

Typical Use Cases

  • Web and mobile backends that need authentication, APIs, and storage.
  • Self-hosted Firebase replacement with PostgreSQL data integrity.
  • Prototyping and MVPs that require instant backend setup.
  • Enterprise platforms needing compliance or internal data hosting.
  • Real-time applications like chat, dashboards, and live updates.

Running Supabase with Docker on Ubuntu 24.04 provides a scalable, self-hosted backend platform that’s open-source, secure, and powerful — ideal for teams that want Firebase-like capabilities without depending on proprietary cloud services.


Step 1: Create a Server Instance on Shape.Host

Start by setting up your cloud server:

Log in to your Shape.Host dashboard.

Click Create → Instance.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose your preferred data center location.

Shape.host instance form with the data center location selector highlighted.

Select a plan with at least 4 CPUs, 8 GB RAM, and 40 GB SSD (recommended for Supabase).

Choose Ubuntu 24.04 (64-bit) as the operating system.

Shape.host instance form with the operating system image selector highlighted.

Click Create Instance.

Shape.host instance form with the Create Instance button highlighted.

After deployment, copy your instance’s public IP address from the Resources tab.

Shape.host Resources dashboard with the server IP address highlighted.

Step 2: Connect to Your Server

  • Linux/macOS: ssh root@your_server_ip
  • Windows (PuTTY):
    1. Open PuTTY, enter your server IP.
    2. Select SSH, then click Open.
    3. Log in with your Shape.Host root credentials.

Step 3: Install Docker and Docker Compose

Update the package list:

apt update
Terminal showing APT package management commands and output.

Install required dependencies for Docker’s repository:

apt install ca-certificates curl gnupg lsb-release
Terminal showing APT package management commands and output.

Add Docker’s official GPG key and repository:

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

Add Docker’s stable 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" \
> /etc/apt/sources.list.d/docker.list

Update again and install Docker components:

apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Terminal showing APT package management commands and output.
Terminal showing APT package management commands and output.

Enable and start Docker service:

systemctl enable docker
systemctl start docker
Terminal showing systemd service management commands or output.

Step 4: Clone the Supabase Repository

Move to /opt and clone the Supabase Docker setup:

cd /opt
git clone https://github.com/supabase/supabase.git
cd supabase/docker

Step 5: Configure Environment Variables

Copy the example environment file:

cp .env.example .env
Terminal showing Git repository cloning output.

Open it for editing:

nano .env

In the .env file, you’ll find several important variables:

  • POSTGRES_PASSWORD – your PostgreSQL database password.
  • JWT_SECRET – a long, random 32-character hex string used for token signing.
  • ANON_KEY and SERVICE_ROLE_KEY – Supabase API keys for anonymous and service-level access.

To generate secure keys:

openssl rand -hex 32

Paste the generated value into JWT_SECRET, and optionally into the API keys if you want to create them manually.

Terminal showing an OpenSSL random-value generation command.

Make sure your database credentials and secrets look something like this (example):

POSTGRES_PASSWORD=StrongPassword123!
JWT_SECRET=48fa4b0cd6dadc8d8ca0923c8050198e44374b5279f5ceb7ddea448ecd5c707d
ANON_KEY=ab5a9dbf8e3f4129a80f9c83dfbb8afc
SERVICE_ROLE_KEY=b398dadaeb7e49e0a0ab3d73c87f4a42

Save and close the file.

Terminal showing the GNU nano editor and configuration text.

Step 6: Start Supabase Containers

Launch all Supabase services using Docker Compose:

docker compose up -d
Terminal showing container image download progress.

Verify that containers are running:

docker compose ps

You should see services like kong, studio, rest, realtime, and db running.

Terminal showing docker commands or output during Start Supabase Containers.

Step 7: Access Supabase

Once the containers are up, open your browser and go to:

http://your-server-ip:8443

You’ll access the Supabase Studio web interface — a dashboard for managing your projects, authentication, and database.

Browser HTTP authentication prompt requesting a username and password.
Supabase Studio project overview with database and API tools.

Step 8 (Optional): Manage Supabase

To stop the services:

docker compose down

To restart them later:

docker compose up -d

To view logs for debugging:

docker compose logs -f

You’ve successfully installed Supabase on Ubuntu 24.04 using Docker and Docker Compose. You now have a self-hosted, full-featured backend with PostgreSQL, authentication, and RESTful APIs — all running securely on your Shape.Host Cloud VPS.

https://shape.host/For reliable, scalable hosting optimized for Docker-based deployments, choose Shape.Host Linux SSD VPS — built for developers who demand speed and stability.