This docker-compose.yml
project makes it really simple to deploy a self hosted uptime monitoring system with Uptime Kuma and Caddy as a reverse proxy with TLS support.
It also includes Ntfy for push notifications to your phone, and email notifications.
-
A linux server with a public IP address. You can get one for free from Oracle Cloud or Google Cloud.
-
Docker and Compose installed and running on your system.
-
A domain name. If you host your DNS with Cloudflare, you can use their API to automatically deploy and renew TLS certificates with Caddy.
-
An account in any mail service provider that supports SMTP.
-
Clone this repository:
git clone [email protected]:jschwindt/uptime-kuma-caddy-ntfy-smtp.git cd uptime-kuma-caddy-ntfy-smtp
-
Copy the
.env.example
file to.env
and fill in the required values:cp .env.example .env
The
.env
file needs updates to the following variables:Variable Description KUMA_BASE_URL
Your https base url for the uptime
service.NTFY_BASE_URL
Your https base url for the ntfy
service.CLOUDFLARE_EMAIL
Your Cloudflare account email. CLOUDFLARE_API_TOKEN
The token for Caddy to handle DNS changes in Cloudflare. Get it here with DNS:Edit
permissions.RELAY_xxxx
The config for your SMTP service provider account. The example given is for the Sendgrid service. -
Start the containers:
docker-compose up -d
The first time you run this command, it will take a while to download the images and build the containers.
Check the logs to see if everything is working:
docker-compose logs -f
-
Create a new admin user for
ntfy
. Follow the instruction in the help message or see here:docker compose exec -it ntfy ntfy user add --role=admin --help
With those credentials, you can log in to the
ntfy
web interface athttps://ntfy.yourdomain.com/
and create a new notification channel and an API key to use later in theuptime
configuration. -
Finally go to the
uptime
web interface athttps://uptime.yourdomain.com/
, create a new user and start adding monitors. Use the following settings for the notification channels:Notification Type Settings Email (SMTP) Hostname: smtp
, Port:25
, Security:None / STARTTLS (25, 587)
Ntfy Server URL: https://ntfy.example.com
(the same in .env), Authentication Method:Username and Password
orAccess Token