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
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 healthchecks;"
sudo -u postgres psql -c "CREATE USER healthchecks WITH PASSWORD 'StrongPassword123!';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE healthchecks TO healthchecks;"
sudo -u postgres psql -d healthchecks -c "CREATE EXTENSION IF NOT EXISTS pgcrypto;"
cd /opt
sudo git clone https://github.com/healthchecks/healthchecks.git
sudo chown -R $USER:$USER /opt/healthchecks
cd /opt/healthchecks
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Copy local settings:
cp hc/settings/local.py.example hc/settings/local.py
nano hc/settings/local.py
Key settings to configure:
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'healthchecks',
'USER': 'healthchecks',
'PASSWORD': 'StrongPassword123!',
'HOST': 'localhost',
'PORT': '',
}
}
# Site configuration
SITE_ROOT = "http://healthchecks.example.com"
SITE_NAME = "Healthchecks"
# Email configuration
EMAIL_HOST = "smtp.example.com"
EMAIL_PORT = 587
EMAIL_HOST_USER = "noreply@example.com"
EMAIL_HOST_PASSWORD = "smtp-password"
DEFAULT_FROM_EMAIL = "healthchecks@example.com"
# Security
SECRET_KEY = "generate-a-random-secret-key-here"
DEBUG = False
Generate a secret key:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
source venv/bin/activate
./manage.py migrate
Create superuser:
./manage.py createsuperuser
sudo tee /etc/systemd/system/healthchecks-web.service >/dev/null <<'EOF'
[Unit]
Description=Healthchecks Web Application
After=network.target postgresql.service
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/healthchecks
Environment="PATH=/opt/healthchecks/venv/bin"
ExecStart=/opt/healthchecks/venv/bin/gunicorn --workers 3 --bind 127.0.0.1:8000 hc.wsgi
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
On RHEL, change www-data to nginx.
sudo tee /etc/systemd/system/healthchecks-cron.service >/dev/null <<'EOF'
[Unit]
Description=Healthchecks Cron Job
After=network.target postgresql.service
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/healthchecks
Environment="PATH=/opt/healthchecks/venv/bin"
ExecStart=/opt/healthchecks/venv/bin/python /opt/healthchecks/manage.py sendalerts
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo tee /etc/systemd/system/healthchecks-email.service >/dev/null <<'EOF'
[Unit]
Description=Healthchecks Email Delivery
After=network.target postgresql.service
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/healthchecks
Environment="PATH=/opt/healthchecks/venv/bin"
ExecStart=/opt/healthchecks/venv/bin/python /opt/healthchecks/manage.py sendemails
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
Enable and start services:
sudo systemctl daemon-reload
sudo systemctl enable --now healthchecks-web healthchecks-cron healthchecks-email
Create Nginx configuration:
sudo tee /etc/nginx/sites-available/healthchecks >/dev/null <<'EOF'
server {
listen 80;
server_name healthchecks.example.com;
location /static/ {
alias /opt/healthchecks/static-collected/;
}
location / {
proxy_pass http://127.0.0.1:8000;
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
Collect static files:
source venv/bin/activate
./manage.py collectstatic --noinput
On Debian 13:
sudo ln -s /etc/nginx/sites-available/healthchecks /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
On RHEL 10:
sudo ln -s /etc/nginx/sites-available/healthchecks /etc/nginx/conf.d/healthchecks.conf
sudo nginx -t
sudo systemctl restart nginx
On UFW:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
On firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Open http://SERVER_IP or http://healthchecks.example.com and log in with the superuser credentials.
# Example cron job
0 * * * * /path/to/backup.sh && curl -fsS --retry 3 https://healthchecks.example.com/ping/your-uuid-here
Healthchecks supports:
Configure in Integrations section.
Use Let’s Encrypt:
sudo apt install -y certbot python3-certbot-nginx # Debian
sudo dnf install -y certbot python3-certbot-nginx # RHEL
sudo certbot --nginx -d healthchecks.example.com
Setting up monitoring systems can be complex. We offer consulting services for:
Contact us at office@linux-server-admin.com or visit our contact page.
Prefer automation? See Healthchecks Ansible Setup for an example playbook.
Prefer containers? See Healthchecks Docker Setup.
See Healthchecks Configuration for configuration guidance.
See Healthchecks Security for hardening guidance.