---
title: "Deploy Healthchecks on Pethost in one click"
description: "Monitoring for cron jobs and background tasks: each job pings its URL, and you hear when a ping is late. A template for Pethost: in a minute or two the app is live on your machine, with HTTPS at its own address and nightly backups."
---

[← All templates](https://pethost.dev/templates/)

# Deploy Healthchecks on Pethost in one click

Monitoring for cron jobs and background tasks: each job pings its URL, and you hear when a ping is late

[Deploy on Pethost](https://console.pethost.dev/?template=healthchecks)

## What happens

1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
3. New project opens at the app. You fill in what it asks for and click Create project: **Email**, **Admin password**.
4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

## First steps

Sign in with the email and the admin password you gave; sign-up is closed, so nobody else gets an account. Add a check, then have your job call its ping URL. Alerts go to the integrations you add under Integrations: email needs an SMTP server first.

## What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

```
services:
  healthchecks:
    image: healthchecks/healthchecks:v4.4
    restart: unless-stopped
    environment:
      DB: postgres
      DB_HOST: postgres
      DB_NAME: hc
      DB_USER: hc
      DB_PASSWORD: ${POSTGRES_PASSWORD}
      SECRET_KEY: ${SECRET_KEY}
      SITE_ROOT: ${URL}
      PING_ENDPOINT: ${URL}/ping/
      SITE_NAME: Healthchecks
      DEBUG: "False"
      # Only the account below signs in: nobody signs up by the address.
      REGISTRATION_OPEN: "False"
      ADMIN_EMAIL: ${ADMIN_EMAIL}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    # The account is made before the server answers, the first time only.
    command:
      - sh
      - -c
      - |
        ./manage.py migrate || exit 1
        ./manage.py shell -c '
        import os, sys
        from django.contrib.auth.models import User
        sys.exit(0 if User.objects.filter(email=os.environ["ADMIN_EMAIL"].lower()).exists() else 1)
        ' || ./manage.py createsuperuser --email "$$ADMIN_EMAIL" --password "$$ADMIN_PASSWORD" || exit 1
        exec uwsgi /opt/healthchecks/docker/uwsgi.ini
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:17-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: hc
      POSTGRES_USER: hc
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U hc -d hc"]
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 30s

volumes:
  db:
```

[compose.yaml](https://pethost.dev/templates/healthchecks/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/healthchecks)

Pethost · Stephan Gomer · NIP 1133096755

[Templates](https://pethost.dev/templates/) [About](https://pethost.dev/about/) [Blog](https://pethost.dev/blog/) [Terms](https://pethost.dev/terms/) [Privacy](https://pethost.dev/privacy/) [Refunds](https://pethost.dev/refunds/) [API](https://pethost.dev/docs/api/) [CLI](https://pethost.dev/docs/cli/) [Plugin](https://github.com/pethost-dev/plugin) [support@pethost.dev](mailto:support@pethost.dev)
