Self-hosting GlitchMao
This guide explains how to run GlitchMao with Docker Compose for local development and self-hosted environments.
Prerequisites
- Docker and Docker Compose
- Nix (recommended for local tooling consistency)
Environment variables
GlitchMao runtime variables are documented in the dedicated reference:
Important security variables for app -> signer communication:
SIGNER_SECURITY_MODE=secure|insecure_localSIGNER_JWT_SECRETSIGNER_JWT_TTL_SECSIGNER_INSECURE_BIND
Important email variables for password reset:
SMTP_HOSTSMTP_PORTSMTP_SECURESMTP_USERSMTP_PASSSMTP_FROMPASSWORD_RESET_BASE_URL
Copy the example file before starting local runs:
bash
cp .env.example .envCompose profiles
Development stack
bash
docker compose -f docker-compose.dev.yml up --buildServices:
web: Nuxt dev server on port3000signer: Rust signer service on internal port4000postgres: PostgreSQL 16 on port5432
Startup behavior:
- The web container installs dependencies
- SQL migrations are applied with
npm run db:migrate:sql --prefix apps/web-nuxt - Nuxt starts in development mode
web-migrationswatchesinfra/db/migrations/*.sqland reapplies SQL migrations automatically
Production-like stack
bash
docker compose up --buildServices:
webrunsbuild + previewmodesignerruns in release modepostgrespersists data inpg_data_prodwebandsignerhave healthchecks andrestart: unless-stoppedfor container platforms
Coolify notes
When deploying docker-compose.yml on Coolify:
- set
VERIFICATION_BASE_URLandPASSWORD_RESET_BASE_URLto your public app URL, - set a strong
SIGNER_JWT_SECRET, - keep
SIGNER_SERVICE_URL=http://signer:4000(service-to-service network), - do not expose
postgresexternally unless you need direct database access.
Test stack
bash
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from web-testThe web-test service runs:
db:migrate:sqlnpm test(apps/web-nuxt)npm run build(apps/web-nuxt)
Operational notes
- GPG private key material is isolated in the signer container volume (
/gnupg). - The web service never mounts signer keyring storage.
SIGNER_SERVICE_URLshould target the signer service endpoint reachable fromweb.VERIFICATION_BASE_URLshould be set to your public URL in self-hosted production.- In
securemode, signer requests are authorized with short-lived JWT delegation from the web API. insecure_localmode is intended for standalone local CLI usage only and must bind to localhost.