How to Install Supabase with Docker on Ubuntu 24.04
Installing Supabase with Docker on Ubuntu 24.04 sets up Supabase, a free tool that helps you build apps faster, using special software called Docker.
Docker lets you run applications like Supabase in isolated environments, making it perfect for trying things out on your computer before you put your app online.
Supabase acts like a ready-made backend for your apps, giving you a database (PostgreSQL 16), login features, and ways to get data instantly. This setup uses Docker to manage all of Supabase’s different parts on your Ubuntu 24.04 machine.
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
To run Supabase with Docker on Ubuntu 24.04, you first need to install Docker Engine. This involves updating your system’s package list and installing tools like curl and git to help download and manage software. Before installing Docker, run the command below to install some prerequisite packages.
Before installing Docker, run the command below to install some prerequisite packages.
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.
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.
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.
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.
sudo usermod -aG docker $USER
Install Supabase
Once Docker is installed, you can get Supabase and its components ready. You’ll clone the Supabase project from GitHub to your computer. Then, you’ll set up your own configuration by copying an example environment file.
git clone --depth 1 https://github.com/supabase/supabase
Next, create Supabase environment config file from the example file.
cd supabase/docker/
cp .env.example .env
Then, run the command below to download Supabase images from the Docker repository.
docker compose pull
Once the process is done, execute the command below to start Supabase containers.
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 must configure it with secure passwords for the database and dashboard. You’ll also generate secret keys for security. These steps protect your Supabase instance and are done using a simple terminal command.
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.
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.

Once all the tokens and secrets are generated, open Supabase environment configuration file.
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.
###########
# 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.
## 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.
docker compose down
docker compose up -d
You can sign in to the dashboard using the URL below:
http://localhost:8000

Type in the supabase account and password in the config file (.env).
Set up a reverse proxy
Setting up a reverse proxy, such as Nginx or Apache, makes your Supabase instance accessible through a domain name. This also helps manage web traffic more efficiently. You can follow specific guides to set up either Nginx or Apache for your Supabase.
The two links below show you how to set up a reverse proxy using Nginx or Apache.
Setup Let’s Encrypt SSL/TLS
You can secure your Supabase site with HTTPS by using a free SSL/TLS certificate from Let’s Encrypt. Instructions are available for setting up Let’s Encrypt with Apache or Nginx. This ensures your data is encrypted and your site is trustworthy.
Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.
- How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux
- How to set up Let’s Encrypt SSL certificate for Nginx on Ubuntu Linux
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?
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.
No comments yet — be the first to share your thoughts!