Docker Installation
Crit Alarm is distributed as a multi-architecture Docker container (linux/amd64 and linux/arm64) with an embedded SQLite database.
Docker One-Liner
Section titled “Docker One-Liner”Run the container in the background with automatic restart and persistent data storage:
docker run -d \ --name critalarm \ --restart unless-stopped \ -p 8080:8080 \ -v critalarm_data:/data \ -e CRITALARM_BASE_URL="https://alerts.example.com" \ -e CRITALARM_RELAY_URL="https://relay.critalarm.app" \ -e CRITALARM_RELAY_CONTENT="none" \ -e CRITALARM_BEHIND_PROXY="true" \ ghcr.io/anvilnine/critalarm:latestDocker Compose
Section titled “Docker Compose”Create a docker-compose.yml file:
services: critalarm: image: ghcr.io/anvilnine/critalarm:latest container_name: critalarm restart: unless-stopped ports: - "8080:8080" volumes: - ./data:/data environment: # Required: Public URL where your server is reached (no trailing slash) - CRITALARM_BASE_URL=https://alerts.example.com # Default push relay service - CRITALARM_RELAY_URL=https://relay.critalarm.app # Privacy mode: 'none' (zero message content on relay) or 'full' - CRITALARM_RELAY_CONTENT=none # Host and port to bind inside the container - CRITALARM_LISTEN=:8080 # Directory where SQLite database is stored - CRITALARM_DATA_DIR=/data # Set to true when running behind Caddy, Traefik, or Nginx - CRITALARM_BEHIND_PROXY=trueStart the service:
docker compose up -dFirst Boot and Admin Token
Section titled “First Boot and Admin Token”On first start, Crit Alarm generates an admin token (ad_...) and writes it to stdout.
View the Admin Token
Section titled “View the Admin Token”Inspect the container logs to find your token:
docker logs critalarmAlternatively, run the embedded CLI tool inside the container:
docker exec -it critalarm critalarm token showKeep this token secure. You will enter it in the Crit Alarm mobile app when connecting to your self-hosted server.
Rotate the Admin Token
Section titled “Rotate the Admin Token”If your admin token is compromised, rotate it immediately:
docker exec -it critalarm critalarm token rotateRotating invalidates old management sessions. Topics, subscriptions and incident history stay.
Verify the Installation
Section titled “Verify the Installation”Verify that the server is healthy by calling the unauthenticated info endpoint:
curl http://localhost:8080/v1/infoExpected output:
{ "name": "critalarm", "version": "0.1.0", "base_url": "https://alerts.example.com", "relay_url": "https://relay.critalarm.app", "relay_content": "none", "mode": "selfhosted"}Backups and Data Persistence
Section titled “Backups and Data Persistence”All topics, tokens, incidents, messages, and timers are saved in /data/critalarm.db.
To back up your installation:
# Safe live SQLite backupdocker exec critalarm sqlite3 /data/critalarm.db ".backup '/data/critalarm.backup.db'"docker cp critalarm:/data/critalarm.backup.db ./critalarm.backup.dbUpgrading
Section titled “Upgrading”To upgrade to the latest release:
docker compose pulldocker compose up -dDatabase migrations apply automatically on container boot.