This repository provides a convenient template for self-hosting a complete Supabase environment using Docker Compose. It includes all the necessary services to run a full-featured Supabase instance, including the database
, authentication
, storage
, and the Supabase Studio UI
. This template comes with the pgvector
extension enabled by default for AI applications and includes minio
for local, S3-compatible object storage.
All credit to Supabase
To get your self-hosted Supabase instance up and running, follow these steps:
- Clone the repository:
git clone https://github.com/philogicae/self-host-supabase-template.git
cd self-host-supabase-template
- Deploy the Supabase stack:
Copy the .env.example
file to .env
and fill it with your own values.
Then run the deploy.sh
script:
./deploy.sh
- This script will:
- Create a Docker volume named
supabase_data
to persist your data. - Copy the necessary initialization files from the
init_volumes
directory into the volume. - Start all the Supabase services in the background using Docker Compose.
- Create a Docker volume named
- Access Supabase Studio:
Once the services are running, you can access the Supabase Studio by opening your web browser and navigating to http://localhost:3000
.
.env.example
: An example environment file that you should copy to.env
and fill with your own values.compose.yaml
: The main Docker Compose file that defines all the Supabase services.init_volumes
: Contains initialization scripts and configuration files for the various services.deploy.sh
: A script to deploy the Supabase stack.reset.sh
: A script to reset the Supabase environment.create_data_volume.sh
: A script to create the data volume and copy the initialization files into it.