0
0
Supabasecloud~30 mins

Self-hosting Supabase - Mini Project: Build & Apply

Choose your learning style9 modes available
Self-hosting Supabase
📖 Scenario: You want to run your own Supabase backend on your server instead of using the cloud service. This helps you control your data and customize your setup.
🎯 Goal: Set up a basic self-hosted Supabase environment using Docker Compose with the required services.
📋 What You'll Learn
Create a Docker Compose file with Supabase services
Add environment variables for configuration
Define the main Supabase service with ports and volumes
Complete the Docker Compose file to be deployable
💡 Why This Matters
🌍 Real World
Many companies prefer to self-host Supabase to keep full control over their data and infrastructure.
💼 Career
Knowing how to configure and deploy self-hosted cloud services is a valuable skill for cloud engineers and DevOps professionals.
Progress0 / 4 steps
1
Create the initial Docker Compose file
Create a file named docker-compose.yml and add the version line version: '3.8' and an empty services section.
Supabase
Hint

Start with the version and services keys in YAML format.

2
Add environment variables for Supabase
Inside the services section, add a service named supabase with an environment key containing POSTGRES_PASSWORD: examplepassword and API_PORT: 8000.
Supabase
Hint

Indent environment variables under the supabase service.

3
Define ports and volumes for Supabase service
Under the supabase service, add ports mapping 8000:8000 and volumes mapping ./data:/var/lib/postgresql/data.
Supabase
Hint

Use dash (-) for list items under ports and volumes.

4
Complete the Docker Compose file with image and restart policy
Add image: supabase/postgres:latest and restart: always under the supabase service to finalize the configuration.
Supabase
Hint

Place image and restart keys at the same level as environment, ports, and volumes.