Docker is the easiest way to get started with self-hosted Supabase.
Before you begin
You need the following installed in your system:
Get the code
Checkout the docker directory in the Supabase repo:
# Get the code
git clone --depth 1 https://github.com/supabase/supabase
# Go to the docker folder
# Copy the fake env vars
cp .env.example .env
Now visit http://localhost:3000 to start using Supabase Studio.
Securing your setup
While we provided you with some example secrets for getting started, you should NEVER deploy your Supabase setup using the defaults we have provided.
Please follow these steps to secure your Docker setup. We strongly recommend using a secrets manager when deploying to production.
Generate API Keys
JWT_SECRET to generate a
service API keys using the JWT generator.
Replace the values in these files:
ANON_KEY- replace with an
SERVICE_ROLE_KEY- replace with a
anon- replace with an
service_role- replace with a
.env file with your own secrets. In particular, these are required:
POSTGRES_PASSWORD: the password for the
JWT_SECRET: used by PostgREST and GoTrue, among others.
SITE_URL: the base URL of your site.
SMTP_*: mail server credentials. You can use any SMTP server.
Securing the Dashboard
The Docker setup doesn't include a management database for managing users and logins. If you plan to deploy the Studio to the web we suggest you put it behind a web proxy with Basic Auth or hide it behind a VPN.
To keep the setup simple, we made some choices that may not be optimal for production:
- the database is in the same machine as the servers
- the storage uses the filesystem backend instead of S3
See the following guides to deploy Docker Compose setup using your preferred tool and platform: