Supabase Pico
Stack
Supabase's API surface - Postgres, Auth (GoTrue) and REST (PostgREST) - in 512 MiB total.
Configuration
TypeComposelinuxADDITIONAL_REDIRECT_URLS=''ANON_KEY=''API_EXTERNAL_URL=''DISABLE_SIGNUP=falseENABLE_ANONYMOUS_USERS=falseENABLE_EMAIL_AUTOCONFIRM=trueENABLE_EMAIL_SIGNUP=trueENABLE_PHONE_AUTOCONFIRM=falseENABLE_PHONE_SIGNUP=falseJWT_EXPIRY=3600JWT_SECRET=''MAILER_URLPATHS_CONFIRMATION=/auth/v1/verifyMAILER_URLPATHS_EMAIL_CHANGE=/auth/v1/verifyMAILER_URLPATHS_INVITE=/auth/v1/verifyMAILER_URLPATHS_RECOVERY=/auth/v1/verifyPGRST_DB_EXTRA_SEARCH_PATH=publicPGRST_DB_MAX_ROWS=1000PGRST_DB_POOL=2PGRST_DB_SCHEMAS=public,graphql_publicPOSTGRES_DB=postgresPOSTGRES_HOST=supabase-dbPOSTGRES_PASSWORD=''POSTGRES_PORT=5432SERVICE_ROLE_KEY=''SITE_URL=''[email protected]SMTP_HOST=''SMTP_PASS=''SMTP_PORT=587SMTP_SENDER_NAME=SupabaseSMTP_USER=''Template by deployable-sh·Source
Report issueServices
gateway
Configuration
Ports5000:5000JWT_SECRET=${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}ANON_KEY=${ANON_KEY:-}SERVICE_ROLE_KEY=${SERVICE_ROLE_KEY:-}unless-stopped./gatewayauth
Configuration
Imagesupabase/gotrue:v2.189.09999GOTRUE_API_HOST=0.0.0.0GOTRUE_API_PORT=9999API_EXTERNAL_URL=${API_EXTERNAL_URL}GOTRUE_DB_DRIVER=postgresGOTRUE_DB_DATABASE_URL=postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}GOTRUE_SITE_URL=${SITE_URL}GOTRUE_URI_ALLOW_LIST=${ADDITIONAL_REDIRECT_URLS:-}GOTRUE_DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}GOTRUE_JWT_ADMIN_ROLES=service_roleGOTRUE_JWT_AUD=authenticatedGOTRUE_JWT_DEFAULT_GROUP_NAME=authenticatedGOTRUE_JWT_EXP=${JWT_EXPIRY:-3600}GOTRUE_JWT_SECRET=${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}GOTRUE_JWT_ISSUER=${API_EXTERNAL_URL}/auth/v1GOTRUE_EXTERNAL_EMAIL_ENABLED=${ENABLE_EMAIL_SIGNUP:-true}GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED=${ENABLE_ANONYMOUS_USERS:-false}GOTRUE_MAILER_AUTOCONFIRM=${ENABLE_EMAIL_AUTOCONFIRM:-true}GOTRUE_SMTP_ADMIN_EMAIL=${SMTP_ADMIN_EMAIL:[email protected]}GOTRUE_SMTP_HOST=${SMTP_HOST:-}GOTRUE_SMTP_PORT=${SMTP_PORT:-587}GOTRUE_SMTP_USER=${SMTP_USER:-}GOTRUE_SMTP_PASS=${SMTP_PASS:-}GOTRUE_SMTP_SENDER_NAME=${SMTP_SENDER_NAME:-Supabase}GOTRUE_MAILER_URLPATHS_INVITE=${MAILER_URLPATHS_INVITE:-/auth/v1/verify}GOTRUE_MAILER_URLPATHS_CONFIRMATION=${MAILER_URLPATHS_CONFIRMATION:-/auth/v1/verify}GOTRUE_MAILER_URLPATHS_RECOVERY=${MAILER_URLPATHS_RECOVERY:-/auth/v1/verify}GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE=${MAILER_URLPATHS_EMAIL_CHANGE:-/auth/v1/verify}GOTRUE_EXTERNAL_PHONE_ENABLED=${ENABLE_PHONE_SIGNUP:-false}GOTRUE_SMS_AUTOCONFIRM=${ENABLE_PHONE_AUTOCONFIRM:-false}unless-stoppedImage details
rest
Configuration
Imagepostgrest/postgrest:v14.12postgrest3000PGRST_DB_URI=postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}PGRST_DB_SCHEMAS=${PGRST_DB_SCHEMAS:-public,graphql_public}PGRST_DB_MAX_ROWS=${PGRST_DB_MAX_ROWS:-1000}PGRST_DB_EXTRA_SEARCH_PATH=${PGRST_DB_EXTRA_SEARCH_PATH:-public}PGRST_DB_ANON_ROLE=anonPGRST_DB_POOL=${PGRST_DB_POOL:-2}PGRST_JWT_SECRET=${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}PGRST_DB_USE_LEGACY_GUCS=falsePGRST_APP_SETTINGS_JWT_SECRET=${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}PGRST_APP_SETTINGS_JWT_EXP=${JWT_EXPIRY:-3600}unless-stoppedImage details
db
Configuration
Commandpostgres,-c,config_file=/etc/postgresql/postgresql.conf,-c,data_directory=/var/lib/postgresql/data/pgdata,-c,log_min_messages=fatal,-c,shared_buffers=64MB,-c,max_connections=30,-c,maintenance_work_mem=16MB,-c,autovacuum_max_workers=1,-c,max_parallel_maintenance_workers=0,-c,max_wal_size=256MB5432/var/lib/postgresql/data : dbdataPOSTGRES_HOST=/var/run/postgresqlPGDATA=/var/lib/postgresql/data/pgdataPGPORT=${POSTGRES_PORT:-5432}POSTGRES_PORT=${POSTGRES_PORT:-5432}PGPASSWORD=${POSTGRES_PASSWORD}POSTGRES_PASSWORD=${POSTGRES_PASSWORD}PGDATABASE=${POSTGRES_DB:-postgres}POSTGRES_DB=${POSTGRES_DB:-postgres}JWT_SECRET=${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}JWT_EXP=${JWT_EXPIRY:-3600}unless-stopped./dbStandalone Install
Select an install method, to see config/commands for deploying Supabase Pico
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Supabase Pico, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
name: supabase
services:
gateway:
networks:
default:
aliases: [supabase-gateway]
build: ./gateway
restart: unless-stopped
ports:
- 5000:5000
healthcheck:
test:
- CMD
- wget
- --no-verbose
- --tries=1
- --spider
- http://127.0.0.1:5000/health
interval: 5s
timeout: 5s
retries: 5
depends_on:
db:
condition: service_healthy
environment:
JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
ANON_KEY: ${ANON_KEY:-}
SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY:-}
auth:
networks:
default:
aliases: [supabase-auth]
ports:
- "9999"
image: supabase/gotrue:v2.189.0
restart: unless-stopped
healthcheck:
test:
- CMD
- wget
- --no-verbose
- --tries=1
- --spider
- http://localhost:9999/health
timeout: 5s
interval: 5s
retries: 3
depends_on:
db:
condition: service_healthy
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: ${API_EXTERNAL_URL}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
GOTRUE_SITE_URL: ${SITE_URL}
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS:-}
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false}
GOTRUE_JWT_ADMIN_ROLES: service_role
GOTRUE_JWT_AUD: authenticated
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_JWT_EXP: ${JWT_EXPIRY:-3600}
GOTRUE_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
GOTRUE_JWT_ISSUER: ${API_EXTERNAL_URL}/auth/v1
GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP:-true}
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: ${ENABLE_ANONYMOUS_USERS:-false}
GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM:-true}
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL:[email protected]}
GOTRUE_SMTP_HOST: ${SMTP_HOST:-}
GOTRUE_SMTP_PORT: ${SMTP_PORT:-587}
GOTRUE_SMTP_USER: ${SMTP_USER:-}
GOTRUE_SMTP_PASS: ${SMTP_PASS:-}
GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME:-Supabase}
GOTRUE_MAILER_URLPATHS_INVITE: ${MAILER_URLPATHS_INVITE:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_CONFIRMATION: ${MAILER_URLPATHS_CONFIRMATION:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_RECOVERY: ${MAILER_URLPATHS_RECOVERY:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: ${MAILER_URLPATHS_EMAIL_CHANGE:-/auth/v1/verify}
GOTRUE_EXTERNAL_PHONE_ENABLED: ${ENABLE_PHONE_SIGNUP:-false}
GOTRUE_SMS_AUTOCONFIRM: ${ENABLE_PHONE_AUTOCONFIRM:-false}
rest:
networks:
default:
aliases: [supabase-rest]
ports:
- "3000"
image: postgrest/postgrest:v14.12
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public,graphql_public}
PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
PGRST_DB_ANON_ROLE: anon
# Pool of 2 halves PostgREST's resident memory (~290 MiB at the
# default 10). Caps REST concurrency - that's the pico trade-off.
PGRST_DB_POOL: ${PGRST_DB_POOL:-2}
PGRST_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
PGRST_DB_USE_LEGACY_GUCS: 'false'
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY:-3600}
command:
- postgrest
db:
networks:
default:
aliases: [supabase-db]
ports:
- "5432"
restart: unless-stopped
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
test:
- CMD
- pg_isready
- -U
- postgres
- -h
- localhost
interval: 5s
timeout: 5s
retries: 10
environment:
POSTGRES_HOST: /var/run/postgresql
PGDATA: /var/lib/postgresql/data/pgdata
PGPORT: ${POSTGRES_PORT:-5432}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
PGPASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATABASE: ${POSTGRES_DB:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
JWT_EXP: ${JWT_EXPIRY:-3600}
# Mirrors the CMD baked into db/Dockerfile (compose command: overrides
# do not reach Miget per-app deploys) so local runs match the platform.
command:
- postgres
- -c
- config_file=/etc/postgresql/postgresql.conf
- -c
- data_directory=/var/lib/postgresql/data/pgdata
- -c
- log_min_messages=fatal
- -c
- shared_buffers=64MB
- -c
- max_connections=30
- -c
- maintenance_work_mem=16MB
- -c
- autovacuum_max_workers=1
- -c
- max_parallel_maintenance_workers=0
- -c
- max_wal_size=256MB
build: ./db
volumes:
dbdata: null
Or deploy it directly from the source:
git clone https://github.com/deployable-sh/stacks
cd stacks
docker compose -f supabase-pico/compose.yaml up -dMore install options in our documentation.
Container Documentation
rest Documentation
REST API for any Postgres database
Serve Supabase Pico on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.
Proxying supabase-pico.example.com to http://rest:3000
Add this to your Caddyfile
supabase-pico.example.com {
reverse_proxy http://rest:3000
}Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Port already in use
If deployment fails with "Bind for 0.0.0.0:5000 failed: port is already allocated", something else on your server is using that port.
- Find what's using it:
sudo ss -tlnp | grep :5000 - Stop the other service, or pick a different host port. In
5000:5000only the left number is yours to change, the right one belongs to the app.
Published on a random port
This template exposes 9999 without setting a host port,
so Docker picks a random free one on every deploy.
- Find it in the Ports column of Portainer's container list, or with
docker port <container>
Running but the page won't load
The container is up but nothing appears in your browser.
- Use your server's real IP:
http://your-server-ip:5000. The 0.0.0.0 link Portainer shows isn't a real address. - Give it a minute after first deploy, supabase-pico can take a while to initialise.
- Make sure your firewall allows the port, e.g.
sudo ufw allow 5000
Image won't pull
Test the pull directly on the host: docker pull supabase/gotrue:v2.189.0
- "manifest unknown" means the tag no longer exists.
- "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue within supabase-pico's repo
- Template not working: Open an issue on deployable-sh/stacks
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
Supabase Pico is a Compose stack, a set of containers (4 of them) defined in one file and brought up together by Portainer, then started and stopped as a single app.
The services
This stack is built from 4 containers that run side by side. Here's each one, with the image it runs and anything it waits for first:
gateway, starts after dbauthrunssupabase/gotrue:v2.189.0, starts after dbrestrunspostgrest/postgrest:v14.12, starts after dbdb
Ports
A port is the door the app answers on. A mapping like 5000:5000 means it's reachable on port 5000 of your server, where the left number is yours to change and the right one belongs to the app. It opens:
5000:50009999, published on a random host port3000, published on a random host port5432, published on a random host port
Volumes
A volume is where Supabase Pico keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/var/lib/postgresql/datakept in thedbdatavolume Docker manages
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Supabase Pico takes 51 of them, all with defaults you can leave alone or tweak:
JWT_SECRET, defaults tosuper-secret-jwt-token-with-at-least-32-characters-longANON_KEY, pulled from your own environmentSERVICE_ROLE_KEY, pulled from your own environmentGOTRUE_API_HOST, defaults to0.0.0.0GOTRUE_API_PORT, defaults to9999API_EXTERNAL_URL, pulled from your own environmentGOTRUE_DB_DRIVER, defaults topostgresGOTRUE_DB_DATABASE_URL, defaults topostgres://supabase_auth_admin:POSTGRES_PASSWORD@supabase-db:5432/postgresGOTRUE_SITE_URL, pulled from your own environmentGOTRUE_URI_ALLOW_LIST, pulled from your own environmentGOTRUE_DISABLE_SIGNUP, defaults tofalseGOTRUE_JWT_ADMIN_ROLES, defaults toservice_roleGOTRUE_JWT_AUD, defaults toauthenticatedGOTRUE_JWT_DEFAULT_GROUP_NAME, defaults toauthenticatedGOTRUE_JWT_EXP, defaults to3600GOTRUE_JWT_SECRET, defaults tosuper-secret-jwt-token-with-at-least-32-characters-longGOTRUE_JWT_ISSUER, defaults toAPI_EXTERNAL_URL/auth/v1GOTRUE_EXTERNAL_EMAIL_ENABLED, defaults totrueGOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED, defaults tofalseGOTRUE_MAILER_AUTOCONFIRM, defaults totrueGOTRUE_SMTP_ADMIN_EMAIL, defaults to[email protected]GOTRUE_SMTP_HOST, pulled from your own environmentGOTRUE_SMTP_PORT, defaults to587GOTRUE_SMTP_USER, pulled from your own environmentGOTRUE_SMTP_PASS, pulled from your own environmentGOTRUE_SMTP_SENDER_NAME, defaults toSupabaseGOTRUE_MAILER_URLPATHS_INVITE, defaults to/auth/v1/verifyGOTRUE_MAILER_URLPATHS_CONFIRMATION, defaults to/auth/v1/verifyGOTRUE_MAILER_URLPATHS_RECOVERY, defaults to/auth/v1/verifyGOTRUE_MAILER_URLPATHS_EMAIL_CHANGE, defaults to/auth/v1/verifyGOTRUE_EXTERNAL_PHONE_ENABLED, defaults tofalseGOTRUE_SMS_AUTOCONFIRM, defaults tofalsePGRST_DB_URI, defaults topostgres://authenticator:POSTGRES_PASSWORD@supabase-db:5432/postgresPGRST_DB_SCHEMAS, defaults topublic,graphql_publicPGRST_DB_MAX_ROWS, defaults to1000PGRST_DB_EXTRA_SEARCH_PATH, defaults topublicPGRST_DB_ANON_ROLE, defaults toanonPGRST_DB_POOL, defaults to2PGRST_JWT_SECRET, defaults tosuper-secret-jwt-token-with-at-least-32-characters-longPGRST_DB_USE_LEGACY_GUCS, defaults tofalsePGRST_APP_SETTINGS_JWT_SECRET, defaults tosuper-secret-jwt-token-with-at-least-32-characters-longPGRST_APP_SETTINGS_JWT_EXP, defaults to3600POSTGRES_HOST, defaults to/var/run/postgresqlPGDATA, defaults to/var/lib/postgresql/data/pgdataPGPORT, defaults to5432POSTGRES_PORT, defaults to5432PGPASSWORD, pulled from your own environmentPOSTGRES_PASSWORD, pulled from your own environmentPGDATABASE, defaults topostgresPOSTGRES_DB, defaults topostgresJWT_EXP, defaults to3600
Restart policy
The restart policy here is unless-stopped, so Docker restarts Supabase Pico after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Portainer puts these services on one shared private network, so they can find each other by name (like gateway) while only the ports above are open to you.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Supabase Pico up. Add the template list to Portainer once, then deploying Supabase Pico is a click rather than a wall of config.