5.0 KiB
Operator Runbook
This runbook is for people who deploy and operate DMARQ. It focuses on repeatable actions: deploy, verify, upgrade, back up, and recover. Keep secrets in 1Password or your deployment secret manager; do not paste raw values into tickets, pull requests, chat, or deployment notes.
Deployment Modes
Docker Compose
Use Docker Compose for a single-host deployment or a small production instance.
-
Put configuration in the project
.envfile, preferably mounted from a 1Password Environment. -
Use PostgreSQL for production. SQLite is acceptable for local or low-volume personal deployments.
-
Start the stack:
docker compose up -d -
Verify:
docker compose ps docker compose logs --tail=100 backend curl -fsS http://localhost:8000/health curl -fsS http://localhost:8000/api/v1/health
Coolify
Use Coolify when you want Git-based Docker deployment with managed environment variables.
- Create a Docker Compose application from the DMARQ repository.
- Configure persistent storage for:
- PostgreSQL data if Coolify manages the database.
/app/datawhen using SQLite or file-backed runtime data.
- Add environment variables in Coolify or inject them from 1Password. Keep
SECRET_KEY, database credentials, mailbox passwords, OAuth secrets,WEBHOOK_SECRET, and Cloudflare tokens concealed. - Deploy the app and confirm the backend container stays healthy.
- Verify the public URL with
/health,/api/v1/health, the dashboard, and Mail Sources.
Do not mount the source tree over the production container. Production containers should run the image contents, not a local development volume.
Manual Systemd
Use manual installation when Docker is not available.
-
Install Python 3.13 and dependencies in a virtual environment.
-
Configure a systemd unit with a restricted service user.
-
Reference an environment file mounted from 1Password or managed by the host secret store.
-
Run behind Nginx or another TLS reverse proxy.
-
Verify:
sudo systemctl status dmarq sudo journalctl -u dmarq -n 100 curl -fsS http://127.0.0.1:8000/health
Kubernetes Or GitOps
Use Kubernetes when DMARQ is deployed through a cluster-state repository.
- Store secrets in the cluster secret manager, not in manifests.
- Pin the image tag to the release or commit being promoted.
- Apply database migrations through the normal release workflow before routing traffic.
- Watch rollout status and pod logs.
- Confirm the preprod manifest update from CI before promoting the same image to production.
First Deployment Verification
After a new deployment:
- Open
/healthand/api/v1/health. - Complete the initial setup flow or confirm login works.
- Add one monitored domain.
- Upload a known-good DMARC aggregate report.
- Confirm the dashboard shows domain totals and compliance.
- Open the domain details page and verify DNS Health Summary loads.
- Add or connect a Mail Source, then run Test connection.
- Trigger a manual fetch in a safe mailbox and confirm import history records the attempt.
- Check logs for repeated database, authentication, DNS, or mailbox polling errors.
Upgrade Procedure
Use this sequence for every production upgrade:
- Read the release notes and check for migration or configuration changes.
- Follow Database Backup and Restore to create and verify a fresh backup.
- Record the current image tag, commit SHA, database type, and deployment target.
- Pull or deploy the new image.
- Apply database migrations if the release includes them.
- Restart the app.
- Run the smoke checks in Release Checklist.
- Confirm background polling still works by checking Mail Sources import history.
- Keep the previous image tag and backup available until the deployment has been stable through at least one polling interval.
Routine Operations
Daily
- Check the dashboard for report volume and compliance drops.
- Review Mail Sources import history for repeated failures.
- Confirm notifications are being delivered if alerts are enabled.
Weekly
- Verify the most recent database backup.
- Review unresolved DNS health warnings for monitored domains.
- Check app logs for repeated provider throttling, authentication, or database errors.
Monthly
- Rotate credentials according to your policy.
- Confirm the restore procedure still works in a temporary environment.
- Review
ALLOWED_HOSTS, Logto redirect URLs, Cloudflare tokens, and mailbox access.
Rollback
Rollback is safest when the database schema did not change. If a migration ran, prefer a full restore into the previous application version unless the release notes explicitly say downgrade is supported.
- Stop DMARQ.
- Restore the pre-upgrade database backup if needed.
- Repoint the deployment to the previous image tag or commit.
- Start DMARQ.
- Run health checks, dashboard checks, and Mail Sources checks.
- Record the rollback cause and open a follow-up issue.