Install Uptime Kuma 2 using Let's Encrypt SSL and Apache 2.4 on Ubuntu 24.04

This guide shows how to install Uptime Kuma 2 with Docker on Ubuntu 24.04 and publish it securely through Apache 2.4 using a reverse proxy and an automatically renewed Let's Encrypt SSL certificate.

Uptime Kuma runs on Docker port 3001, while Apache handles the public HTTP and HTTPS connections.

Install Apache, Docker and Certbot

Install Apache 2.4, Docker, Certbot and the Certbot Apache plugin:

root@lab-pc:~# sudo apt update
sudo apt install -y apache2 docker.io certbot python3-certbot-apache
sudo systemctl enable --now docker apache2

Install Uptime Kuma 2

Start Uptime Kuma 2 in Docker and store the application data in a persistent Docker volume:

root@lab-pc:~# docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2
Unable to find image 'louislam/uptime-kuma:2' locally
2: Pulling from louislam/uptime-kuma
3da948dc29b9: Pull complete
07683a18a1c6: Pull complete
3d75e56d73fd: Pull complete
7e0b8e884178: Pull complete
4ef4f0c79ca2: Pull complete
c6700029e14a: Pull complete
068fedd6b0f1: Pull complete
864b7b0f219e: Pull complete
5d96d7777a32: Pull complete
575d46df4705: Pull complete
5d2860e0a811: Pull complete
250c5b24ba65: Pull complete
fd31133e23d8: Pull complete
d7466d782dc4: Pull complete
79b3835561d3: Pull complete
44136fa355b3: Download complete
fb64dc15f466: Download complete
Digest: sha256:3e24e96c89efff0e3a4b0698cbdd36c15ad3022371db57166e5588853002ee5c
Status: Downloaded newer image for louislam/uptime-kuma:2
9f66dc1730840fd844b48cd18adfbb00770d4c6132033c82dfd529b9bbfb684c

The --restart=always option automatically starts the container after a server reboot. Uptime Kuma data is stored in the persistent uptime-kuma Docker volume.

Enable Apache Reverse Proxy Modules

Enable the Apache modules required for HTTP proxying, WebSocket connections, redirects and SSL:

root@lab-pc:~# sudo a2enmod proxy proxy_http proxy_wstunnel rewrite ssl
Enabling module proxy.
Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
Considering dependency proxy for proxy_wstunnel:
Module proxy already enabled
Enabling module proxy_wstunnel.
Enabling module rewrite.
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
systemctl restart apache2

Restart Apache:

systemctl restart apache2

Configure Apache Reverse Proxy

Create an Apache VirtualHost for the Uptime Kuma hostname:

nano /etc/apache2/sites-available/kuma.ihowto.eu.conf

Add the following configuration:

<VirtualHost *:80>
ServerName kuma.ihowto.eu

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:3001/
ProxyPassReverse / http://127.0.0.1:3001/

RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://127.0.0.1:3001/$1" [P,L]
</VirtualHost>

Replace kuma.ihowto.eu with the DNS hostname that points to your server.

Enable the Uptime Kuma Site

Enable the new Apache VirtualHost and reload Apache:

root@lab-pc:~# a2ensite kuma.ihowto.eu.conf
Enabling site kuma.ihowto.eu.
To activate the new configuration, you need to run:
systemctl reload apache2
root@lab-pc:~# sudo systemctl reload apache2

Enable Automatic Let's Encrypt SSL

Request a Let's Encrypt certificate and let Certbot automatically configure Apache:

root@lab-pc:~# certbot --apache -d kuma.ihowto.eu
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): jkliachev@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.8-July-06-2026.pdf. You must agree in
order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for kuma.ihowto.eu
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/kuma.ihowto.eu/fullchain.pem
Key is saved at: /etc/letsencrypt/live/kuma.ihowto.eu/privkey.pem
This certificate expires on 2026-11-30.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for kuma.ihowto.eu to /etc/apache2/sites-available/kuma.ihowto.eu-le-ssl.conf
Added an HTTP->HTTPS rewrite in addition to other RewriteRules; you may wish to check for overall consistency.
Congratulations! You have successfully enabled HTTPS on https://kuma.ihowto.eu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Certbot automatically creates the SSL VirtualHost, redirects HTTP traffic to HTTPS and installs a scheduled certificate renewal task. The successful certificate deployment in the original installation created kuma.ihowto.eu-le-ssl.conf.

Check Apache Configuration

Verify the Apache configuration and restart the service:

root@lab-pc:~# sudo apachectl configtest
sudo systemctl restart apache2
Syntax OK
root@lab-pc:~#

Open Uptime Kuma

Uptime Kuma is now available through the HTTPS hostname:

https://kuma.ihowto.eu



Check Automatic SSL Renewal

Certbot installs a systemd timer that automatically checks and renews Let's Encrypt certificates. Check the timer with:

root@pc-lab:~# systemctl status certbot.timer
● certbot.timer - Run certbot twice daily
Loaded: loaded (/usr/lib/systemd/system/certbot.timer; enabled; preset: enabled)
Active: active (waiting) since Tue 2026-09-01 07:38:36 UTC; 14min ago
Trigger: Tue 2026-09-01 16:53:36 UTC; 9h left
Triggers: ● certbot.service

You can also test the renewal process without modifying the active certificate:

root@pc-lab:~# certbot renew --dry-run

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/kuma.ihowto.eu.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account registered.
Simulating renewal of an existing certificate for kuma.ihowto.eu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/kuma.ihowto.eu/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Useful Commands

docker ps
docker logs -f uptime-kuma
docker restart uptime-kuma
systemctl status apache2
apachectl configtest
certbot certificates
certbot renew --dry-run