Self Hosting

Supabase is a Hosted Platform, so you don't have to deploy it yourself. However, if you want to configure and deploy it yourself, this is also possible.

Before you begin

If you are about to step through this Guide, please record your steps! You can help us improve by adding missing details and fixing errors.

The self-hosted version of Supabase does not include a UI yet. We are working on this in stages, starting with our UI library (more context).

In the meantime, here are some suggested tools for interacting with your Postgres Database:

Get the Docker Compose

We provide a Docker Compose directory which is includes all of the tools required for building on top of Supabase.

You can download the Docker files in various ways:

Option 1: Using our CLI

Make sure the CLI is installed:

npm install -g supabase

Then run in any folder to create a docker folder with a docker-compose.yml:

supabase eject

Option 2: Clone our repo

# 1. Copy an empty repo
git clone https://github.com/supabase/supabase
# 2. Move into the empty repo
cd supabase/docker

Option 3: Using a shallow clone

If you use Git version >2.25, you can use a shallow clone to download this folder to your local machine:

# 1. Copy an empty repo
git clone --no-checkout https://github.com/supabase/supabase
# 2. Move into the empty repo
cd supabase
# 3. Initialize sparse-checkout
git sparse-checkout init --cone
# 4. Checkout the folder
git sparse-checkout set docker

Running Supabase

Now that you have the Docker set up on your local machine, you can start it here by running

docker-compose up

Configuring each service

Supabase is made up of several services. We have prefilled the docker-compose file with all the configuration you need to get started. If you would like to change any of the configuration, you can update the env variables in the docker-compose file.

Here are a list of environment variables for each service:

Configuring email

GoTrue requires an SMTP server to send emails for all authentication actions. You will need to provide the following settings inside the docker-compose.yml under services.auth.environment:

  • GOTRUE_SMTP_HOST - The mail server hostname to send emails through.
  • GOTRUE_SMTP_PORT - The port number to connect to the mail server on.
  • GOTRUE_SMTP_USER - If the mail server requires authentication, the username to use.
  • GOTRUE_SMTP_PASS - If the mail server requires authentication, the password to use.

API Keys

All config for the API Gateway is stored in the kong directory. Inside kong.yml you'll find the routing for all services, the routing rules, and down the bottom you'll find the JWTs capable of accessing services that require API Key access.

See the full docs here.

Deploying

See the following guides to deploy Docker Compose setup using your preferred tool and platform:

One-click deploys

For some individual tools, we also provide images and deployments into cloud marketplaces:

Postgres

Realtime

Next steps