Sellf - Self-Hosted Supabase + Docker
Ta treść nie jest jeszcze dostępna w Twoim języku.
Enable Confirm Email in Supabase and install both confirmation and magic-link templates. Guest purchases join the account after confirming the address used for the purchase. See e-mail setup.
Admin UI updates: runtime selection, supported deployments and migrations. Containers do not apply migrations on startup.
This guide is for people who want zero dependency on any cloud database provider — data residency requirements (GDPR), an air-gapped/offline environment, or simply the preference to own the whole stack. Everything runs in Docker, on a server you control.
Sellf itself does not bundle Supabase. You stand up Supabase with its own
official installer (a separate, independently-maintained project that ships
its own updates roughly every two weeks), then point a single small Sellf
container at it. This used to be a single docker-compose.fullstack.yml that
tried to bundle both — it’s gone (see Migrating from
docker-compose.fullstack.yml
below if you’re on it). Splitting the two means Supabase’s own installer keeps
Postgres/GoTrue/PostgREST/Storage patched, and Sellf only has to track its own
image tag.
If you’d rather not run Postgres yourself, use Supabase Cloud with DEPLOYMENT-COOLIFY.md or DEPLOYMENT-MIKRUS.md instead — much less to maintain.
Table of Contents
Section titled “Table of Contents”- Requirements
- Part 1 — Self-hosted Supabase
- Part 2 — Magic-link email templates
- Part 3 — Run Sellf
- Domain and SSL
- Stripe webhook
- First login
- Updating
- Backup
- Migrating from
docker-compose.fullstack.yml - Troubleshooting
Requirements
Section titled “Requirements”- A Linux server with Docker + Docker Compose v2, 8 GB+ RAM recommended when Supabase and Sellf run on the same box (Supabase alone is ~6-8 containers; add Sellf and a reverse proxy)
- A domain (or two — one for Sellf, one for Supabase’s API, can be subdomains of the same domain) with DNS you can point at the server
- A Stripe account
- Comfortable reading shell scripts and editing
.envfiles — this path trades convenience for control
Part 1 — Self-hosted Supabase
Section titled “Part 1 — Self-hosted Supabase”Use Supabase’s own installer — Sellf does not fork or vendor it, so follow the upstream docs for anything installer-specific: https://supabase.com/docs/guides/self-hosting/docker.
git clone --depth 1 https://github.com/supabase/supabasecd supabase/dockercp .env.example .env- Generate secrets — the repo ships
./utils/generate-keys.sh(or follow the manual JWT steps in the upstream guide) to fill inPOSTGRES_PASSWORD,JWT_SECRET,ANON_KEY,SERVICE_ROLE_KEY,DASHBOARD_PASSWORD, etc. in.env. - Set your public URLs —
API_EXTERNAL_URL,SITE_URL, andSUPABASE_PUBLIC_URLin.envto whatever domain you’re pointing at this stack (e.g.https://api.your-shop.example.com). - Put a reverse proxy in front (Caddy/nginx/Traefik) terminating TLS and
forwarding to the gateway container’s port (Kong or Envoy, depending on
the Supabase version you pulled — check
docker compose psafter step 4). - Start it:
Terminal window docker compose up -ddocker compose ps # everything should report healthy after a minute or two - Run Sellf’s migrations against it — from the Sellf repo, not the
Supabase one:
This is a one-time step per install. Later Sellf releases that ship new migrations are applied the same way, or via the in-app updater (
Terminal window npx supabase db push --db-url "postgresql://postgres:<POSTGRES_PASSWORD>@<supabase-host>:5432/postgres"admin-panel/scripts/upgrade.sh) if you’re running the standard release tarball flow on top.
Supabase’s self-hosted stack changes over time (new component versions,
occasionally a new default database major version) — that’s an upstream
concern, tracked and upgraded via their update.sh and any migration
notes in their release changelog, not something Sellf’s docs replicate here.
Part 2 — Magic-link email templates
Section titled “Part 2 — Magic-link email templates”Sellf’s login is a magic link, and /auth/callback requires the link to
carry token_hash — GoTrue’s default email templates don’t do that.
Without this step, self-hosted login will not work.
Point GoTrue at Sellf’s own templates, which it serves as static files at
/auth-email-templates/*.html (no server code, no secrets in them):
# In the Supabase stack's .env, alongside SITE_URL etc.:GOTRUE_MAILER_TEMPLATES_MAGIC_LINK=https://your-shop.example.com/auth-email-templates/magic-link.htmlGOTRUE_MAILER_TEMPLATES_CONFIRMATION=https://your-shop.example.com/auth-email-templates/confirmation.htmlGOTRUE_MAILER_TEMPLATES_RECOVERY=https://your-shop.example.com/auth-email-templates/recovery.htmlGOTRUE_MAILER_TEMPLATES_INVITE=https://your-shop.example.com/auth-email-templates/invite.htmlGOTRUE_MAILER_TEMPLATES_EMAIL_CHANGE=https://your-shop.example.com/auth-email-templates/email-change.html
# Also required so GoTrue accepts redirects back to your Sellf domain:GOTRUE_URI_ALLOW_LIST=https://your-shop.example.com/*Restart the Supabase auth container after editing .env. See
supabase/templates/README.md
in the Sellf repo for the full template reference (also used for Supabase
Cloud, which reads the same HTML through its dashboard/Management API
instead of a URL).
You also need working SMTP configured on the Supabase side
(SMTP_HOST/SMTP_PORT/SMTP_USER/SMTP_PASS/SMTP_ADMIN_EMAIL in its
.env) — GoTrue sends the email, Sellf only supplies the template.
Part 3 — Run Sellf
Section titled “Part 3 — Run Sellf”From the Sellf repo, use the root docker-compose.yml (a single container,
pulling the published image — no build step needed):
git clone https://github.com/jurczykpawel/sellfcd sellfcp .env.docker.example .envFill in .env:
SUPABASE_URL=https://api.your-shop.example.com # the Supabase stack from Part 1SUPABASE_ANON_KEY=<ANON_KEY from the Supabase .env>SUPABASE_SERVICE_ROLE_KEY=<SERVICE_ROLE_KEY from the Supabase .env>SITE_URL=https://your-shop.example.comCHECKOUT_BINDING_SECRET=<openssl rand -base64 32>APP_ENCRYPTION_KEY=<openssl rand -base64 32>LOGINWALL_SECRET=<openssl rand -hex 32>STRIPE_SECRET_KEY=sk_live_...STRIPE_PUBLISHABLE_KEY=pk_live_...docker compose up -ddocker compose ps # sellf should report healthy within ~30sdocker compose config refuses to run with any of the required secrets
still blank, with a message telling you which one and how to generate it —
that’s intentional, it’s cheaper to fail here than after a broken deploy.
Domain and SSL
Section titled “Domain and SSL”Put a reverse proxy in front of the Sellf container the same way you did for Supabase’s gateway — one option:
your-shop.example.com { reverse_proxy localhost:3000}(Caddy example; nginx/Traefik/Nginx Proxy Manager work the same way — forward
to whatever host/port you bound in docker-compose.yml’s SELLF_PORT.)
Stripe webhook
Section titled “Stripe webhook”After first login (see below), go to Settings → Payments in the Sellf admin and click Register webhook — Sellf creates the Stripe endpoint, subscribes to the events it needs, and stores the signing secret encrypted in the database. No manual Stripe Dashboard step needed.
First login
Section titled “First login”- Open
https://your-shop.example.com/login - Enter your email, click the magic link (see Part 2 if it doesn’t arrive with a working link)
- First registered user becomes admin automatically
Updating
Section titled “Updating”Two independent things to update:
- Supabase — follow the upstream project’s own
update.sh/ upgrade notes for the self-hosted stack. This is entirely outside Sellf’s release cycle. - Sellf — bump
SELLF_VERSIONin.env(or override it at the shell:SELLF_VERSION=2026.10.4 docker compose up -d). First back up the database and apply migrations from the target release withbunx supabase db push --db-url ..., thendocker compose pull sellfanddocker compose up -d --force-recreate sellf. The in-app updater applies migrations only for a ready standalone PM2 installation, not for the Docker service.
Backup
Section titled “Backup”Supabase’s data lives in its own Postgres container — back it up the same way regardless of how you run Sellf:
#!/bin/bash# Run from the Supabase stack's docker/ directoryBACKUP_DIR=/opt/backups/sellfmkdir -p "$BACKUP_DIR"docker compose exec -T db pg_dumpall -U postgres > "$BACKUP_DIR/sellf-$(date +%F).sql"find "$BACKUP_DIR" -name "*.sql" -mtime +7 -deleteAdd it to cron (e.g. daily at 2 AM: 0 2 * * * /opt/backups/backup.sh), and
also back up the storage_data volume if you use Supabase Storage for file
delivery.
Restore:
docker compose exec -T db psql -U postgres < /opt/backups/sellf/sellf-2026-09-01.sqlMigrating from docker-compose.fullstack.yml
Section titled “Migrating from docker-compose.fullstack.yml”If you have an older Sellf checkout with docker-compose.fullstack.yml,
that file is gone starting with this release. It bundled a broken Supabase
setup (the database’s own initialization was silently skipped after the
first restart) — anyone running it either already patched it by hand or
never had a working self-hosted install from it in the first place.
- Back up first:
docker exec <your-db-container> pg_dumpall -U postgres > sellf-backup.sql— plus thestorage_datavolume if used. - Stand up an official Supabase self-hosted stack (Part 1 above) or Supabase Cloud.
- Restore your data into the new Supabase:
psqlthe dump into the new Postgres (--schema=public --schema=auth), then run Sellf’s own migrations withnpx supabase db push --db-url ...to make sure the schema matches what the new Sellf version expects. - Point Sellf at the new Supabase — update
SUPABASE_URL,SUPABASE_ANON_KEY,SUPABASE_SERVICE_ROLE_KEYin your.env. KeepAPP_ENCRYPTION_KEYidentical to what you had — it decrypts every secret already stored in your database (Stripe keys, webhook signing secrets); rotating it makes those unreadable. - If a different Supabase project means a different
JWT_SECRET, existing sessions log out — expected, users just sign in again. - Not ready to migrate? Pin your deployment to Sellf
v2026.9.2— the last release that shippeddocker-compose.fullstack.yml— until you can. You won’t get newer Sellf releases on that pin.
Troubleshooting
Section titled “Troubleshooting”Sellf container is unhealthy / won’t start
Section titled “Sellf container is unhealthy / won’t start”docker compose logs sellfdocker compose config # confirms every required secret is actually setMagic link email doesn’t arrive or the link doesn’t log you in
Section titled “Magic link email doesn’t arrive or the link doesn’t log you in”- Check SMTP is actually configured on the Supabase side
(
docker compose logs authin the Supabase stack) - Confirm
GOTRUE_MAILER_TEMPLATES_MAGIC_LINK(Part 2) is set and the URL is publicly reachable —curlit from the Supabase server - Confirm
GOTRUE_URI_ALLOW_LISTincludes your Sellf domain - Check spam folder
Stripe payments don’t work
Section titled “Stripe payments don’t work”docker compose logs sellf | grep -i stripeConfirm the webhook is registered (Settings → Payments in the admin) and
that STRIPE_SECRET_KEY/STRIPE_PUBLISHABLE_KEY match the mode (test vs
live) of the checkout you’re testing.
Running low on disk
Section titled “Running low on disk”docker system dfdocker image prune -adocker volume pruneSecurity checklist
Section titled “Security checklist”-
.envfiles (Sellf and Supabase) are not in Git, permissions600 - SSL/HTTPS enabled on both the Sellf domain and the Supabase API domain
- Firewall allows only 22/80/443
-
APP_ENCRYPTION_KEY,CHECKOUT_BINDING_SECRET,LOGINWALL_SECRETgenerated with the commands above, not left as placeholders - Backups scheduled and tested with an actual restore
- Supabase Studio (
SUPABASE_PUBLIC_URL’s dashboard) is not publicly reachable without a password