Note: this setup is unnofficial. It is supported by the Supabase community only.
This guide is covering a self-hosted Supabase setup with Traefik as a reverse proxy.
Please make sure you read the self-hosting guide.
- Super simple to install
- Run Supabase on bare metal (maximum privacy) - dedicated/root server or VPS
- Uses Let's Encrypt certificates
- Uses pgAdmin to provide at least some interface to Supabase on the self-hosted Supabase instance
- Machine with Linux and SSH access
- Installed git, docker and docker-compose
- Access to a Traefik supported DNS providers API: see this list
- Traefik isn't used yet
- Ports 443 and 80 aren't used yet
Traefik is a proxy that gets its configuration from the docker-compose labels. The labels needed for Supabase are already provided in the docker-compose.yml.
git clone https://github.com/supabase-community/supabase-traefik
cd supabase-traefik
cp .env.example .env
Create traefik/.env and add your Let's Encrypt contact email address as well as your provider. This example is using PowerDNS.
# pdns is for PowerDNS - a self-hosted DNS server
ACME_DNS_CHALLENGE_PROVIDER=pdns
ACME_EMAIL=letsencrypt@example.com
# DNS provider specific config for pdns
PDNS_API_KEY=SOME API KEY
PDNS_API_URL=https://some.url.to.your.pdns.server
Learn more about the DNS challenge
Learn more about available DNS providers (there are MANY)
Edit the traefik/docker-compose.yml environment section to be compatible with your DNS provider. This example is using PowerDNS.
PDNS_API_KEY and PDNS_API_URL are acting as variables between the .env and the docker-compose file.
environment:
- PDNS_API_KEY=${PDNS_API_KEY}
- PDNS_API_URL=${PDNS_API_URL}
Run following command in traefik/ to start Traefik detached
docker-compose up -d
cd ..
- Change the SUPABASE_HOSTNAME to the hostname/subdomain you want to use for Supabase
TRAEFIK_NETWORK=rp
SUPABASE_HOSTNAME=supabase.example.com
Run following command to start the Supabase containers detached
docker-compose up -d
You can also use the docker-compose.yml with an existing Traefik setup.
Just ignore the traefik folder and customize the .env file and docker-compose.yml as it fits your setup. Run docker-compose up -d
and check if all endpoints below are working. Use them as described in the docker/readme.md.
supabase.example.com/
supabase.example.com/auth/v1/
you can test GoTrue with
supabase.example.com/auth/v1/settings
as the default path returns 404
supabase.example.com/rest/v1/
supabase.example.com/realtime/v1/
The Postgres database is only available internally via the db docker network. You can however access it through pgAdmin.
supabase.example.com/pgadmin/