Self-hosting Supabase lets you run your own backend services. This gives you full control over your data and setup without relying on external servers.
Self-hosting Supabase
docker-compose.yml version: '3.6' services: supabase-db: image: supabase/postgres:latest ports: - '5432:5432' environment: POSTGRES_PASSWORD: yourpassword supabase-api: image: supabase/gotrue:latest ports: - '9999:9999' depends_on: - supabase-db environment: GOTRUE_DB_DRIVER: 'postgres' GOTRUE_DB_DATABASE_URL: 'postgres://postgres:yourpassword@supabase-db:5432/postgres' supabase-realtime: image: supabase/realtime:latest ports: - '4000:4000' depends_on: - supabase-db environment: DB_HOST: supabase-db DB_PORT: 5432 DB_USER: postgres DB_PASSWORD: yourpassword DB_NAME: postgres
This example uses Docker Compose to run Supabase services locally.
Replace yourpassword with a strong password you choose.
version: '3.6' services: supabase-db: image: supabase/postgres:latest ports: - '5432:5432' environment: POSTGRES_PASSWORD: examplepass
version: '3.6' services: supabase-api: image: supabase/gotrue:latest ports: - '9999:9999' depends_on: - supabase-db environment: GOTRUE_DB_DATABASE_URL: 'postgres://postgres:examplepass@supabase-db:5432/postgres'
This Docker Compose file runs the main Supabase services: database, authentication API, and realtime server. It uses a password you set to secure the database. You can start all services by running docker-compose up in the folder with this file.
version: '3.6' services: supabase-db: image: supabase/postgres:latest ports: - '5432:5432' environment: POSTGRES_PASSWORD: mysecretpassword supabase-api: image: supabase/gotrue:latest ports: - '9999:9999' depends_on: - supabase-db environment: GOTRUE_DB_DRIVER: 'postgres' GOTRUE_DB_DATABASE_URL: 'postgres://postgres:mysecretpassword@supabase-db:5432/postgres' supabase-realtime: image: supabase/realtime:latest ports: - '4000:4000' depends_on: - supabase-db environment: DB_HOST: supabase-db DB_PORT: 5432 DB_USER: postgres DB_PASSWORD: mysecretpassword DB_NAME: postgres
Always use strong passwords for your database to keep data safe.
Make sure Docker and Docker Compose are installed before running the configuration.
Self-hosting means you handle updates and backups yourself.
Self-hosting Supabase gives you full control over your backend.
You use Docker Compose to run Supabase services easily on your machine or server.
Remember to secure your database and manage the services regularly.