This guide uses Docker Compose to run Alerta with MongoDB backend.
For Docker installation, see Docker.
mkdir -p /opt/alerta/{config,data}
cd /opt/alerta
Create docker-compose.yml:
services:
mongodb:
image: mongo:7
container_name: alerta-mongodb
volumes:
- ./data/mongodb:/data/db
restart: unless-stopped
networks:
- alerta
alerta:
image: alerta/alerta-api:9.0.4
container_name: alerta-api
depends_on:
- mongodb
ports:
- "8080:8080"
volumes:
- ./config/alertad.conf:/app/alertad.conf:ro
environment:
- ALERTA_API_KEY=your-api-key-here
- ALERTA_MONGO_URI=mongodb://mongodb:27017/alerta
- ALERTA_SECRET_KEY=change-this-secret-key
- ALERTA_CORS_ORIGINS=http://localhost:8080
restart: unless-stopped
networks:
- alerta
alerta-web:
image: alerta/alerta-web:9.0.4
container_name: alerta-web
depends_on:
- alerta
ports:
- "80:80"
environment:
- API_URL=http://alerta:8080
- ALERTA_API_KEY=your-api-key-here
restart: unless-stopped
networks:
- alerta
networks:
alerta:
driver: bridge
Create config/alertad.conf:
# Alerta API configuration
CORS_ORIGINS = ['http://localhost:8080']
PLUGINS = ['reject']
ALLOWED_ENVIRONMENTS = ['Production', 'Development']
docker compose up -d
Check container status:
docker compose ps
Access web UI at http://SERVER_IP
docker compose exec alerta alerta key
docker compose logs -f alerta
docker compose down
Deploying Alerta in containers for production? Our consulting covers:
Get expert help: office@linux-server-admin.com | Contact Page