Automated infrastructure for hosting websites using Podman Quadlets, featuring Nginx as a reverse proxy, automated Certbot SSL renewals, and a systemd-based image update watcher.
certbot-renew: This container runs certbot to renew certificates. It's accompanied by a systemd timer that runs it twice a day.clueless-website: My personal website.nginx: This container runs nginx as a reverse proxy for the clueless-website container, and any other websites that I want to host.
web-gateway: This network is used to connect the nginx container to the clueless-website container, and any other websites that I want to host.
certbot-certs: This volume is used to store certificates generated by certbot.certbot-webroot: This volume is used to store the webroot for certbot.
podman-image-watch.path: Monitors~/.local/share/podman/incoming-imagesfor new.tarfiles.podman-image-watch.service: Triggered by the.pathunit, it runs a script to load images and restart affected containers.certbot-renew.timer: Triggers thecertbot-renewcontainer twice daily.
Enter the directory in which you cloned this repository and perform the following commands:
sudo apt install make
make allPerform the following steps after installing for the first time or after migrating to a different machine:
-
Reload the systemd user daemon:
systemctl --user daemon-reload
-
Enable and start the network and volumes:
systemctl --user enable --now web-gateway.network systemctl --user enable --now certbot-certs.volume systemctl --user enable --now certbot-webroot.volume
-
Generate certificates using certbot:
podman run --rm -it \ --name certbot-init \ --network host \ -v certbot-certs:/etc/letsencrypt:Z \ docker.io/certbot/certbot \ certonly \ --standalone \ -d clueless.no \ -d www.clueless.no \ --email maritim@gmail.com \ --agree-tos \ --non-interactive
-
Enable and start the remaining services:
systemctl --user enable --now nginx systemctl --user enable --now clueless-website systemctl --user enable --now certbot-renew.timer systemctl --user enable --now podman-image-watch.path
You can manage the services using standard systemctl --user commands:
# Check status
systemctl --user status nginx
# Restart a service
systemctl --user restart clueless-website
# View logs
journalctl --user -u nginxThis repository includes a mechanism to automatically update containers when new images are available.
- Drop a
.tarfile of a Podman image (e.g., frompodman save) into~/.local/share/podman/incoming-images/. podman-image-watch.pathdetects the new file.podman-image-watch.servicerunsclueless-load-and-restart.sh.- The script loads the image and restarts any running containers that use that image name and tag.
- The original
.tarfile is moved to~/.local/share/podman/processed-images/.