Skip to main content

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)

VariableDescriptionExample
ENVRuntime environmentdevelopment, staging, production
PORTHTTP port the API server listens on3001
DB_URLPostgreSQL connection stringSee formats below
REDIS_URLRedis connection stringredis://localhost:6379/0
JWT_SECRETJWT signing secret (min 32 chars)openssl rand -base64 32
ENCRYPTION_KEYAES-256-GCM key — must be exactly 32 byteschangeme_exactly_32bytes_long!!!
CONCURRENCYChecker worker pool size100 (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)

VariableDescription
SMTP_HOSTSMTP server hostname
SMTP_PORTSMTP port (typically 587)
SMTP_USERSMTP username / email
SMTP_PASSWORDSMTP password
SMTP_FROMFrom address for alert emails
SLACK_WEBHOOK_URLSlack Incoming Webhook URL
TEAMS_WEBHOOK_URLMicrosoft Teams webhook URL
TWILIO_ACCOUNT_SIDTwilio account SID (for SMS)
TWILIO_AUTH_TOKENTwilio auth token
TWILIO_FROM_NUMBERTwilio sender phone number
PAGERDUTY_INTEGRATION_KEYPagerDuty Events API v2 routing key
SENDGRID_API_KEYSendGrid API key (alternative to SMTP)

Observability (optional)

VariableDescription
SENTRY_DSNSentry 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_KEY must be exactly 32 bytes. An incorrect length will cause service credential encryption to fail at startup.
  • Never commit .env to version control.
  • Rotate JWT_SECRET periodically — rotating it invalidates all active sessions.