Skip to content
Follow
Ubuntu Linux

How to Install Supabase with Docker on Ubuntu 24.04

Richard
Written by
Richard
Jan 15, 2025 Updated Jun 20, 2026 5 min read
How to Install Supabase with Docker on Ubuntu 24.04
How to Install Supabase with Docker on Ubuntu 24.04

You install Supabase with Docker on Ubuntu 24.04 by setting up containers for this open-source Firebase alternative.

Supabase is a Backend-as-a-Service (BaaS) platform providing a PostgreSQL database, real-time subscriptions, authentication, and instant APIs to accelerate your app development.

Running Supabase locally using Docker on your Ubuntu 24.04 machine gives you an isolated environment perfect for testing and development.

This method uses Docker to manage Supabase’s components, including its core PostgreSQL 16 database, ensuring a clean and consistent setup.

⚡ Quick Answer

Install Docker Engine, then clone the Supabase repository. Navigate to the Docker directory, pull the images, and start the containers with `docker compose up -d`. Finally, configure your secrets in the `.env` file.

Install Docker Engine

You need to install Docker Engine on your Ubuntu 24.04 server to run Supabase in containers. First, update your package list and install some necessary tools like curl and git.

Before installing Docker, run the command below to install some prerequisite packages.

🐧Bash / Shell
sudo apt update
sudo apt install ca-certificates curl git

Once the packages are installed, continue to install Docker below.

First, add the GPG key for the Docker Engine repository by running the command below.

🐧Bash / Shell
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Next, add the Docker repository to Ubuntu by running the command below.

Command Prompt
echo 
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Once the Docker GPG key and repository have been added to Ubuntu, run the command below to install the Docker app.

🐧Bash / Shell
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

After installing Docker, you should run it with a non-root user account. It is recommended that a dedicated user for Supabase be created to run the app. Then, add the user to the Docker group.

Add your user to the ‘docker‘ group with the command below.

🐧Bash / Shell
sudo usermod -aG docker $USER
⚠️Warning
Log out and restart your machine so your account can be fully added to the Docker group.

Install Supabase

Now that Docker is set up, you can get Supabase and its required images. Clone the Supabase project from GitHub and then copy the example environment file to create your own configuration.

💻Code
git clone --depth 1 https://github.com/supabase/supabase

Next, create Supabase environment config file from the example file.

Command Prompt
cd supabase/docker/
cp .env.example .env

Then, run the command below to download Supabase images from the Docker repository.

💻Code
docker compose pull

Once the process is done, execute the command below to start Supabase containers.

💻Code
docker compose up -d

Docker should be started but not properly configured. The steps below walk you through configuring Supabase.

Configure Supabase

After installing Supabase, you’ll need to set up passwords for its database and dashboard, and create secret keys for security. You can generate these secrets using a simple command in your terminal.

To do that, generate passwords for the PostgreSQL server, and Supabase dashboard, and then generate the JWT secret and token.

The command below can be used to generate secrets.

💻Code
openssl rand -hex 16

The command should output secrets that you can use later in Supabase config file.

After that, go to the Supabase website to generate two JWT tokens for Supabase. Run this form twice to generate new anon and service API keys.

JWT secrets
JWT secrets

Once all the tokens and secrets are generated, open Supabase environment configuration file.

💻Code
nano .env

Configure the highlighted lines with the appropriate settings.

Updat the ‘POSTGRES_PASSWORD‘ using the OpenSSL password generated. Update the ‘JWT_SECRET‘ with the one generated from Supabase website. Do the same for the ‘ANON_KEY‘ and the ‘SERVICE_ROLE_KEY‘ values.

💻Code
###########
# Secrets
# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION
############

POSTGRES_PASSWORD=b26d8c7220e2abac6c2cb090ce9bf4a3
JWT_SECRET=3135pJUeF863MLQ8WaadlYmMW49gb5Hax8t9zEFQ
ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjo............
SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJ............
DASHBOARD_USERNAME=supabase
DASHBOARD_PASSWORD=75672d66af67b1565b1540f2d2ae6309

Update the URL section to enter your correct URLs.

💻Code
## General
SITE_URL=http://localhost:3000
ADDITIONAL_REDIRECT_URLS=
JWT_EXPIRY=3600
DISABLE_SIGNUP=false
API_EXTERNAL_URL=http://localhost:8000

Save the file and exit the editor when finished.

Next, stop and relaunch Supabase docker container for the changes to apply.

💻Code
docker compose down
docker compose up -d

You can sign in to the dashboard using the URL below:

💻Code
http://localhost:8000
supabase dashboard
supabase dashboard

Type in the supabase account and password in the config file (.env).

Set up a reverse proxy

📝Good to Know
A reverse proxy, such as Nginx or Apache, helps make your Supabase setup reachable with a domain name and manages web traffic better. You can follow guides to set up either Nginx or Apache for this purpose.

The two links below show you how to set up a reverse proxy using Nginx or Apache.

Setup Let’s Encrypt SSL/TLS

To make your Supabase site secure with HTTPS, you can get a free SSL/TLS certificate from Let’s Encrypt. Instructions are available for setting up Let’s Encrypt with either Apache or Nginx.

Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.

That should do it!

Conclusion:

In summary, installing Supabase on Ubuntu using Docker provides developers with a robust backend solution that simplifies app development and testing. Here are the key takeaways:

  • Open-source Alternative: Supabase serves as a powerful open-source substitute for Firebase, offering similar functionalities.
  • Ease of Setup: Utilizing Docker streamlines the installation process and allows for easy management of the Supabase environment.
  • PostgreSQL Integration: Leveraging PostgreSQL enhances data management capabilities, ensuring data integrity and complex querying.
  • Local Development: Running Supabase locally enables safe testing and development, minimizing dependency on external services.
  • Security Measures: Setting up password and authentication, as well as implementing SSL/TLS with Let’s Encrypt, ensures a secure environment.
  • Scalability and Flexibility: The architecture allows for easy scaling as projects grow, adapting to increasing demands.

By following the steps outlined, developers can confidently harness the potential of Supabase to build and deploy applications efficiently.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install WebStorm on Ubuntu 24.04
Ubuntu Linux How to Install WebStorm on Ubuntu 24.04
How to Install Prospect Mail on Ubuntu 24.04
Ubuntu Linux How to Install Prospect Mail on Ubuntu 24.04
How to Install Syncthing on Ubuntu 24.04
Ubuntu Linux How to Install Syncthing on Ubuntu 24.04
How to Install NetData on Ubuntu 24.04
Ubuntu Linux How to Install NetData on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *