On Debian 13:
sudo apt update
sudo apt install -y python3 python3-pip python3-venv postgresql postgresql-contrib nginx
On RHEL 10:
sudo dnf install -y python3 python3-pip postgresql-server postgresql-contrib nginx
Create virtual environment:
sudo mkdir -p /opt/alerta
sudo python3 -m venv /opt/alerta/venv
source /opt/alerta/venv/bin/activate
Install Alerta:
pip install alerta alerta-server
On Debian 13:
sudo systemctl enable --now postgresql
On RHEL 10:
sudo postgresql-setup --initdb
sudo systemctl enable --now postgresql
Create database and user:
sudo -u postgres psql -c "CREATE DATABASE alerta;"
sudo -u postgres psql -c "CREATE USER alerta WITH PASSWORD 'StrongPassword123!';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE alerta TO alerta;"
Create configuration file:
sudo tee /etc/alerta.conf >/dev/null <<'EOF'
[server]
debug = False
base_url = http://localhost:8080
database_url = postgresql://alerta:StrongPassword123!@localhost/alerta
[alerta]
key = your-api-key-here
endpoint = http://localhost:8080
EOF
Set secure permissions:
sudo chmod 640 /etc/alerta.conf
sudo chown root:www-data /etc/alerta.conf
source /opt/alerta/venv/bin/activate
alertad migrate
sudo tee /etc/systemd/system/alertad.service >/dev/null <<'EOF'
[Unit]
Description=Alerta Server
After=network.target postgresql.service
[Service]
Type=simple
User=www-data
Group=www-data
Environment="PATH=/opt/alerta/venv/bin"
WorkingDirectory=/opt/alerta
ExecStart=/opt/alerta/venv/bin/alertad run --host 0.0.0.0 --port 8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
On RHEL, change www-data to nginx.
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now alertad
Create Nginx configuration:
sudo tee /etc/nginx/sites-available/alerta >/dev/null <<'EOF'
server {
listen 80;
server_name alerta.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
EOF
On Debian 13:
sudo ln -s /etc/nginx/sites-available/alerta /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
On RHEL 10:
sudo ln -s /etc/nginx/sites-available/alerta /etc/nginx/conf.d/alerta.conf
sudo nginx -t
sudo systemctl restart nginx
source /opt/alerta/venv/bin/activate
pip install alertaclient
Configure client:
echo "export ALERTA_API_KEY='your-api-key-here'" >> ~/.bashrc
echo "export ALERTA_ENDPOINT='http://localhost:8080'" >> ~/.bashrc
source ~/.bashrc
On UFW:
sudo ufw allow 80/tcp
sudo ufw allow 8080/tcp
On firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload
Test the API:
curl http://localhost:8080/api/management/status
Open http://SERVER_IP or http://alerta.example.com in a browser.
source /opt/alerta/venv/bin/activate
alerta key --username admin --text "Admin API Key"
alerta send --resource server01 --event HighCPU --severity major --text "CPU usage is high"
Alerta supports integrations with:
Edit /etc/alerta.conf to configure integrations.
See Alerta Hardening.
Need professional assistance with your messaging infrastructure? Our team provides:
Get in touch: office@linux-server-admin.com | Contact Page
Prefer automation? See Alerta Ansible Setup for an example playbook.
Prefer containers? See Alerta Docker Setup.
See Alerta Configuration for configuration guidance.
See Alerta Security for hardening guidance.