This is a set of plain Kubernetes YAML files to deploy a self-hosted Supabase instance.
There are a few forks of the outdated community supported Supabase Helm chart, you can check them out.
Note
This is a Draft. Not fully tested yet.
Create namespace for Supabase and set it as default
kubectl create ns supabase
kubectl config set-context --current --namespace=supabase
Edit PVC in postgres/postgres.yaml
Create secret with postgres login/password
kubectl create secret generic supabase-db \
--from-literal=username='postgres' \
--from-literal=password='YOUR-DB-PASS'
Important
Don't use provided keys in production environments.
Create your own JWT keys here https://supabase.com/docs/guides/self-hosting/docker#generate-api-keys
kubectl create secret generic supabase-jwt \
--from-literal=secret='x2zhph7hixlm99chy3v1ad2cfemvym6pu25pr0wf' \
--from-literal=anonKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzEyMTc4MDAwLAogICJleHAiOiAxODY5OTQ0NDAwCn0.GcZn--EiwXXV88DHlOjD3m9NNCjVP2McMAO9WwvityI' \
--from-literal=serviceKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogInNlcnZpY2Vfcm9sZSIsCiAgImlzcyI6ICJzdXBhYmFzZSIsCiAgImlhdCI6IDE3MTIxNzgwMDAsCiAgImV4cCI6IDE4Njk5NDQ0MDAKfQ.FBB5oOrnKsQYrD6NzNr34Y3zf_MBUJ7dPSgm2Rk4I30'
kubectl apply -f postgres/postgres-conf.yaml
kubectl apply -f postgres/postgres.yaml
kubectl apply -f meta.yaml
kubectl apply -f rest.yaml
This service is an entry point to access all Supabase services. Don't expose other services if you don't know what are you doing.
Setup NodePort/LoadBalancer for Service in kong/service.yaml
or use kong/ingress.yaml
Create secret for dashboard basic authentication
kubectl create secret generic supabase-kong \
--from-literal=username='supabase' \
--from-literal=password='dashboard-password'
kubectl apply -f kong
kubectl apply -f realtime.yaml
Edit PVC in storage.yaml
kubectl apply -f storage.yaml
kubectl apply -f imgproxy.yaml
Set API_EXTERNAL_URL
, GOTRUE_SITE_URL
and SMTP variables in auth.yaml
Create secret for smtp authentication
kubectl create secret generic gotrue-smtp \
--from-literal=username='[email protected]' \
--from-literal=password='SMTP-PASSWORD'
kubectl apply -f auth.yaml
kubectl apply -f functions
openssl rand -hex 20
e32e83530e9981ee07b9e0757d7bbbccef9c2ef9
kubectl create secret generic supabase-logflare \
--from-literal=apiKey='e32e83530e9981ee07b9e0757d7bbbccef9c2ef9'
kubectl apply -f analytics.yaml
Set SUPABASE_URL
in studio.yaml
kubectl apply -f studio.yaml
Uses hostPath volumes to access pods logs
kubectl apply -f vector