Environment Variables
Complete reference for all environment variables used by AlertifyPro self-hosted deployments. Copy .env.example to .env and fill in your values.
Quick start
cp .env.example .env
# Edit .env with your values
make run-api
Core (required)
| Variable | Description | Example |
|---|---|---|
ENV | Runtime environment | development, staging, production |
PORT | HTTP port the API server listens on | 3001 |
DB_URL | PostgreSQL connection string | See formats below |
REDIS_URL | Redis connection string | redis://localhost:6379/0 |
JWT_SECRET | JWT signing secret (min 32 chars) | openssl rand -base64 32 |
ENCRYPTION_KEY | AES-256-GCM key — must be exactly 32 bytes | changeme_exactly_32bytes_long!!! |
CONCURRENCY | Checker worker pool size | 100 (100–500 recommended) |
DB_URL formats
# Local PostgreSQL, no password
DB_URL=postgres://postgres@localhost:5432/alertify_pro?sslmode=disable
# Local PostgreSQL, with password
DB_URL=postgres://postgres:secret@localhost:5432/alertify_pro?sslmode=disable
# Remote / SSL required
DB_URL=postgres://user:[email protected]:5432/alertify_pro?sslmode=require
note
The database is named alertify_pro by default. DB_USER, DB_PASSWORD, and DB_NAME are only used by the Docker Compose stack — the Go application only reads DB_URL.
REDIS_URL formats
# No auth
REDIS_URL=redis://localhost:6379/0
# With password
REDIS_URL=redis://:secret@localhost:6379/0
# With username and password
REDIS_URL=redis://user:secret@localhost:6379/0
# Remote TLS (Redis Cloud, Upstash, etc.)
REDIS_URL=rediss://:token@host:6380
Notification channels (all optional)
| Variable | Description |
|---|---|
SMTP_HOST | SMTP server hostname |
SMTP_PORT | SMTP port (typically 587) |
SMTP_USER | SMTP username / email |
SMTP_PASSWORD | SMTP password |
SMTP_FROM | From address for alert emails |
SLACK_WEBHOOK_URL | Slack Incoming Webhook URL |
TEAMS_WEBHOOK_URL | Microsoft Teams webhook URL |
TWILIO_ACCOUNT_SID | Twilio account SID (for SMS) |
TWILIO_AUTH_TOKEN | Twilio auth token |
TWILIO_FROM_NUMBER | Twilio sender phone number |
PAGERDUTY_INTEGRATION_KEY | PagerDuty Events API v2 routing key |
SENDGRID_API_KEY | SendGrid API key (alternative to SMTP) |
Observability (optional)
| Variable | Description |
|---|---|
SENTRY_DSN | Sentry DSN for error tracking |
Generating secrets
# JWT_SECRET (min 32 chars)
openssl rand -base64 32
# ENCRYPTION_KEY (exactly 32 chars)
openssl rand -hex 16 # gives 32 hex chars
caution
ENCRYPTION_KEYmust be exactly 32 bytes. An incorrect length will cause service credential encryption to fail at startup.- Never commit
.envto version control. - Rotate
JWT_SECRETperiodically — rotating it invalidates all active sessions.