Skip to main content
This guide covers all configuration options for self-hosted Supabase, from environment variables to service-specific settings.

Environment Variables

All configuration is managed through the .env file in the docker directory.

Core Secrets

Never use default values in production! Generate unique, strong secrets for each installation.
.env

Generating Secrets

Use the provided utility script:
Or generate manually:

API Keys

JWT-based API keys for client authentication:
Generate new keys using the JWT tool with your custom JWT_SECRET.

URLs and Networking

For production, use your actual domain: https://api.yourdomain.com

Database Configuration

Connection Pooling (Supavisor)

Authentication Settings

SMTP Configuration

Configure email sending for auth emails:

OAuth Providers

Enable third-party authentication:
Uncomment the corresponding sections in docker-compose.yml:

Storage Configuration

Local File Storage:
S3-Compatible Storage:
S3 Protocol Access:

Image Transformations

Analytics & Logging

Edge Functions

Advanced Settings

Service-Specific Configuration

PostgreSQL

Customize Postgres settings in volumes/db/postgresql.conf:
Restart database to apply:

Kong API Gateway

Edit volumes/api/kong.yml to customize routes and plugins:
Restart Kong:

Vector Logging

Configure log pipeline in volumes/logs/vector.yml:

Database Backups

Manual Backup

Automated Backups

Create a backup script:
backup.sh
Schedule with cron:

Restore from Backup

Point-in-Time Recovery (PITR)

Enable WAL archiving for PITR:
1

Configure WAL Archiving

Add to volumes/db/postgresql.conf:
2

Create Archive Directory

3

Take Base Backup

4

Restore to Point in Time

Create recovery.conf:

Performance Tuning

Database Optimization

Connection Pooling

Always use Supavisor for web applications:

Resource Limits

Set Docker resource limits in docker-compose.yml:

Health Checks

Monitor service health:
Create monitoring script:
health-check.sh

Next Steps

Security

Harden your installation for production

Updates

Keep services up-to-date

Docker Guide

Back to Docker installation

Monitoring

Set up monitoring and alerts