Browse topics Database setup
Install and maintain
Database setup
Use SQLite, PostgreSQL or Supabase with your installation.
SQLite works out of the box. You can also use PostgreSQL or Supabase. Your API clients and project keys work the same way with all three.
DATABASE_PROVIDER=sqlite
DATABASE_URL=sqlite:///data/feedback.sqlite
For PostgreSQL, create a dedicated database and configure a private connection URL. Supply one stable application encryption key before first startup:
DATABASE_PROVIDER=postgres
DATABASE_URL=postgresql://USER:ENCODED_PASSWORD@HOST:5432/DATABASE?sslmode=require
APPLICATION_SECRET=YOUR_FERNET_KEY
DATA_DIR=/data
Using Docker Compose? Generate the key once, before your first remote-provider startup. These commands use Python inside the image, so nothing extra is needed on your computer:
docker compose pull supaknock
docker compose run --rm --no-deps --entrypoint python supaknock -c \
'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'
Save the output as APPLICATION_SECRET in your private .env. If you installed SupaKnock directly with Python, run the same python -c command in that environment. Preserve the exact key across restarts, backups and restores. Never put database credentials in a client.
For Compose, save the values above in a .env file next to compose.yaml. After generating the key, replace the SQLite database entries under your service’s environment with these entries. Compose only passes .env values into a container when the file references them:
DATABASE_PROVIDER: ${DATABASE_PROVIDER}
DATABASE_URL: ${DATABASE_URL}
APPLICATION_SECRET: ${APPLICATION_SECRET}
DATA_DIR: /data
Keep the existing public URL, cookie settings and /data volume. Start the installation with docker compose up -d supaknock after configuring the new database. Do this before creating data you want to keep; provider selection does not transfer it.
Using Supabase
Set DATABASE_PROVIDER=supabase and copy the project's direct or session-pooler PostgreSQL URI on port 5432. Use its database password, not a public or service-role API key. The transaction pooler on 6543 is unsupported. Keep the private supaknock schema out of Supabase's exposed API schemas.
Remote connections require TLS. Keep one app instance and its local volume for setup state and optional model weights. Changing a provider or URL does not migrate existing data. The repository's docs/database-providers.md and docs/operations.md cover connection permissions and backup/restore with matching PostgreSQL client tools.
These docs describe the current source. Check your server’s /api/v1/openapi.json for the version you run.