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
Layer | Component | Role |
---|---|---|
OS | Ubuntu 24.04 LTS | Stable, secure foundation with long-term support |
Container Runtime | Docker Engine + Compose | Runs Supabase and all required services |
Database | PostgreSQL 15/16 | Stores user data, authentication, and application state |
API Gateway | Kong | Handles API routing, rate limiting, and JWT validation |
Realtime | Supabase Realtime (Elixir) | Enables real-time database change subscriptions |
Auth | Supabase Auth (GoTrue) | Provides authentication and user management |
Storage | Supabase Storage | Handles file uploads and access via Postgres-backed permissions |
Dashboard | Supabase Studio | Web interface for database, API, and user management |
TLS | Let’s Encrypt / PKI | Provides 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/Capability | Supabase (Self-hosted) | Firebase (Google) | Appwrite (Self-hosted) | PocketBase (Lightweight) |
---|---|---|---|---|
Database | PostgreSQL | Firestore (NoSQL) | MariaDB/PostgreSQL | SQLite |
Hosting | Self-hosted or Cloud | SaaS only | Self-hosted | Self-hosted |
APIs | REST + GraphQL | Proprietary SDKs | REST + GraphQL | REST |
Auth | Built-in (JWT + OAuth) | Firebase Auth | OAuth, JWT | Built-in |
Real-time updates | Yes | Yes (Firestore) | Limited | Basic (WebSocket) |
Open-source | Yes | No | Yes | Yes |
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.

Choose your preferred data center location.

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.

Click Create Instance.

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

Step 2: Connect to Your Server
- Linux/macOS:
ssh root@your_server_ip
- Windows (PuTTY):
- Open PuTTY, enter your server IP.
- Select SSH, then click Open.
- Log in with your Shape.Host root credentials.
Step 3: Install Docker and Docker Compose
Update the package list:
apt update

Install required dependencies for Docker’s repository:
apt install ca-certificates curl gnupg lsb-release

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


Enable and start Docker service:
systemctl enable docker
systemctl start docker

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

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
andSERVICE_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.

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.

Step 6: Start Supabase Containers
Launch all Supabase services using Docker Compose:
docker compose up -d

Verify that containers are running:
docker compose ps
You should see services like kong
, studio
, rest
, realtime
, and db
running.

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.


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.