Healthchecks

Open-source cron job and background task monitoring service, written in Python & Django.

Truy cập

  • Mở trình duyệt của bạn và truy cập: https://<SERVER_IP>
  • Cảnh báo SSL của trình duyệt (chứng chỉ tự ký) là điều bình thường.

Create Admin Account

Before logging in, you must create an admin account.

Run the following command:

docker exec -it healthchecks /opt/healthchecks/manage.py createsuperuser

Follow the prompts to enter:

  • Email address
  • Mật khẩu

Once completed, you can log in using the newly created credentials.

Các tập tin và thư mục quan trọng

  • Thư mục cài đặt: /root/healthchecks
  • Tệp môi trường: /root/healthchecks/.env
  • Tệp Docker Compose: /root/healthchecks/docker-compose.yml
  • SQLite database: /var/lib/docker/volumes/healthchecks_healthchecks-data/_data
  • Cấu hình trang web Nginx: /etc/nginx/sites-available/healthchecks
  • Enabled site: /etc/nginx/sites-enabled/healthchecks
  • Chứng chỉ SSL: /etc/nginx/ssl/fullchain.pem, /etc/nginx/ssl/privkey.pem
  • Admin credentials: /root/.cloudzy-creds

Manage the Stack

cd /root/healthchecks

# Start services
docker compose up -d

# Stop services
docker compose down

# Restart services
docker compose restart

# View logs
docker compose logs -f

Email Settings Configuration (Optional)

Email configuration is required to enable notifications (e.g., alerts, reports).

Ensure SMTP connections are allowed on this server. Request SMTP access if it is currently disabled.

Edit the environment file:

nano /root/healthchecks/.env

Uncomment and configure the following variables with your SMTP provider details:

# DEFAULT_FROM_EMAIL=fixme-email-address-here
# EMAIL_HOST=fixme-smtp-host-here
# EMAIL_HOST_PASSWORD=fixme-smtp-password-here
# EMAIL_HOST_USER=fixme-smtp-username-here
# EMAIL_PORT=587
# EMAIL_USE_TLS=True

Apply the changes by restarting the service:

docker compose up -d

Kích hoạt SSL với tên miền (Tùy chọn)

1. Trỏ tên miền của bạn đến địa chỉ IP của máy chủ.

2. Edit .env to set your domain as SITE_ROOT: SITE_ROOT=https://yourdomain.com

3. Tái tạo các dịch vụ:

cd /root/healthchecks/
docker compose up -d

4. Chỉnh sửa cấu hình Nginx và thay thế cả hai server_name <IP>; với tên miền của bạn (<yourdomain.com>) cho cả khối HTTP (cổng 80) và HTTPS (cổng 443):

vim /etc/nginx/sites-available/healthchecks

5. Cài đặt Certbot:

apt install -y certbot python3-certbot-nginx

6. Chạy lệnh sau để tạo chứng chỉ Let's Encrypt hợp lệ:

certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com

7. Thay thế đường dẫn SSL trong cấu hình Nginx (phần TLS):

vim /etc/nginx/sites-available/healthchecks
# Before:
    # ssl_certificate /etc/nginx/ssl/fullchain.pem;
    # ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
    # ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

8. Khởi động lại Nginx để áp dụng các thay đổi:

systemctl restart nginx

9. Mở trình duyệt của bạn và truy cập: https://yourdomain.com

Thông tin ứng dụng