Introduction
Deploying your own monitoring service is a rewarding step, but understanding the underlying mechanics is what transforms a simple gadget into a reliable infrastructure.
On my Raspberry Pi 4 (Ubuntu Server, 4 GB RAM), I deployed Uptime Kuma
(Node.js application) and Nginx Proxy Manager via Docker, exposing the
monitoring dashboard (up.jamyvetter.net) over HTTPS.
In this article, we’ll dissect the setup: how Docker’s virtual networks (bridges, veth pairs, user-defined networks) route traffic, how services persist after reboot, and how we configured a wildcard Let’s Encrypt certificate for an A+ SSL rating.
1. Network Architecture: From WLAN to Virtual Interfaces
By default, Docker creates a virtual bridge on the host (docker0). This acts
like a software switch: each container receives a virtual Ethernet interface
pair (veth pair), with one peer inside the container network namespace
(typically eth0) and the other peer attached to a bridge on the host.
The figure below illustrates this concept: containers connect via their veth peers to virtual switches on the host, enabling inter-container communication and network address translation (NAT) to the external network.
In practice, Docker manages network bridges on the host to route container
traffic. For example, on my Pi, ip addr shows both docker0 and a user-defined
bridge (br-1d79a610db3d, created for web-network), alongside the physical
wlan0 interface on the local network:
|
|
Here, docker0 (172.17.0.1/16) is Docker’s default bridge, while
br-1d79a610db3d (172.18.0.1/16) is a user-defined bridge network.
A veth pair acts like a virtual Ethernet cable spanning two network
namespaces: one peer interface resides inside the container namespace
(typically named eth0 or eth1), while the opposite peer resides on the
host and is enslaved to a bridge (indicated by master docker0 or
master br-...). A container can be connected to multiple networks, receiving
an interface for each. In this output, the presence of these two host-side
veth endpoints simply demonstrates that virtual interfaces are actively
attached to their respective bridges (docker0 and br-1d79a610db3d),
routing traffic between container namespaces and host networking.
User-defined networks enable service isolation: containers attached to the same
custom bridge can discover and communicate with each other privately. To expose
services, Docker publishes container ports onto the host. As shown in the
systemctl status docker output below, docker-proxy helper processes bind
the requested ports across both IPv4 (0.0.0.0) and IPv6 (::) host sockets:
|
|
Here, the host kernel listens on port 443 and forwards incoming TCP streams to the Nginx Proxy Manager container. Publishing a Docker port binds the service to the selected host interfaces. Actual accessibility from the local network or the Internet still depends on host and network firewall rules.
2. System Persistence and Resilience
A robust monitoring setup must recover automatically after reboots or crashes.
On my Pi, systemd manages the Docker daemon (dockerd), ensuring the
Docker service starts at boot (Enabled: yes in systemctl). Checking
systemctl status docker confirms Docker has been running continuously since
boot.
To ensure each container restarts reliably, I configured Docker’s restart
policy with restart: always (or unless-stopped). Docker will automatically
restart the container if it exits unexpectedly or when the host daemon boots:
|
|
This confirms the uptime-kuma container is configured to restart
automatically. In normal operation, these containers consume minimal resources
on the Raspberry Pi. A check via docker stats --no-stream confirms modest
footprint (~210 MB RAM combined, negligible CPU):
|
|
With approximately 210 MiB of total memory consumed, over 90% of the host RAM remains free for additional services and system operations.
3. SSL/TLS and Certificate Management
TLS Termination and HTTP/2
All HTTPS (TLS) termination is handled by the Nginx Proxy Manager container. Inside Docker, Nginx Proxy Manager acts as a reverse proxy: it listens on ports 80 and 443, handles TLS handshakes, and forwards decrypted HTTP requests to backend containers such as Uptime Kuma over the private Docker network.
Uptime Kuma itself does not terminate public TLS; it serves HTTP on its internal Docker port 3001, while Nginx Proxy Manager handles certificate management and HTTPS termination.
The NPM configuration confirms this architecture. Its generated proxy host
configuration for up.jamyvetter.net includes:
|
|
Key points from this configuration:
- Port Listening: NPM binds ports 80 and 443 and performs the TLS
handshake (
listen 443 ssl). - HTTP/2 Enabled:
http2 onenables multiplexing over TLS for improved throughput and lower latency. - TLS Certificate: Paths
/etc/letsencrypt/live/npm-1/*.pempoint to the persisted Let’s Encrypt keys inside the container volume. - HSTS Directive: The header
Strict-Transport-Security "max-age=63072000; preload"instructs supporting browsers to enforce HTTPS connections for 2 years (63,072,000 seconds). Thepreloadflag indicates an intention to submit the domain to Google’s HSTS Preload list (used by major browsers). However, official submission requires serving the header on the base domain with theincludeSubDomainsdirective. In practice,includeSubDomainsmust not be added automatically: it strictly commits all current and future subdomains to HTTPS, which requires verifying that every internal and external sub-service fully supports TLS. - Redirect to HTTPS: The included
force-ssl.confensures inbound HTTP traffic on port 80 is redirected to HTTPS.
Importantly, no Apache or Nginx service runs on the host OS itself; all web serving operates inside isolated Docker containers.
Security Headers and Cipher Suites
Achieving an A+ rating on SSL Labs requires strict transport security and modern cipher configurations:
- Strict HSTS: Enforces HTTPS connections for 2 years via
max-age=63072000. Note that activating this header is distinct from formal enrollment in the browser HSTS Preload list, which requires manual submission on hstspreload.org. - Strong Cipher Suites & TLS Versions: Modern ciphers (ECDHE with AES-GCM or ChaCha20, SHA-256/384) with TLS 1.2 and TLS 1.3 only. Legacy protocols (TLS 1.0/1.1) are disabled by default.
- HTTP→HTTPS Redirection: Plain HTTP traffic is automatically upgraded.
- SSL Session Caching and Request Hardening: NPM includes SSL session cache
settings (
ssl-cache.conf) and additional request filtering rules (block-exploits.conf).
Let’s Encrypt: DNS-01 Challenge and Remote Access Architecture
For certificate issuance, I configured Nginx Proxy Manager to use Let’s Encrypt with a DNS-01 challenge managed through the Cloudflare DNS API. The process operates as follows:
- Certificate Request: NPM’s ACME client initiates a certificate order
for
*.jamyvetter.net(wildcard). - DNS-01 Challenge: Let’s Encrypt requests proof of domain control through
a specialized DNS TXT record. Using Cloudflare API credentials, NPM
automatically provisions
_acme-challenge.jamyvetter.net. - Validation: The Let’s Encrypt CA queries Cloudflare’s authoritative DNS
servers for that TXT record. Locating the matching token confirms domain
ownership. Using DNS-01 enables wildcard certificates. The certificate
*.jamyvetter.netcovers first-level subdomains such asup.jamyvetter.net, but does not automatically cover the apex domain or deeper nested subdomains. - Certificate Issuance: Let’s Encrypt issues the certificate, stored by NPM
under
/etc/letsencrypt/live/npm-1/. - Renewal: NPM checks certificate expiration daily via internal cron and automates renewals through the same DNS-01 mechanism before the 90-day validity expires.
Infrastructure Context: CGNAT, IPv6 Firewall, and DNS-01
Understanding the relationship between DNS-01 and network accessibility requires examining the actual topology of my home infrastructure:
- IPv4 and CGNAT: My home internet connection (provided by an SFR router) operates under Carrier-Grade NAT (CGNAT) for IPv4. Because public IPv4 addresses are shared across multiple subscribers, standard inbound IPv4 port forwarding (NAT) is not available in this configuration.
- IPv6 Connectivity and Firewall Rules: IPv6 is fully operational with a
delegated prefix. The Raspberry Pi receives a global IPv6 address on its
local network interface. On the router’s IPv6 firewall, a specific rule
named
HTTPS-Piauthorizes inbound TCP traffic on port 443 directed to the Raspberry Pi’s IPv6 address. No inbound rule exists for port 80. - Publication vs. Internet Reachability: It is critical not to confuse
Docker port publication with external accessibility. As seen in
systemctl status docker,docker-proxybinds ports 80, 81, 443, and 3001 locally on the Pi (0.0.0.0and[::]). This allows local routing on the host and LAN, but incoming traffic from the public Internet is blocked by CGNAT on IPv4 and strictly filtered on IPv6 (where only TCP 443 is permitted). - The DNS-01 Advantage: The standard Let’s Encrypt HTTP-01 challenge requires an inbound HTTP connection on port 80 from the public Internet, which would fail under an IPv4 CGNAT environment without public port 80 exposure. In contrast, the DNS-01 challenge operates entirely out-of-band at the DNS level via Cloudflare API calls. Port 80 does not need to be accessible from Internet, making DNS-01 ideal for domestic and restricted network environments.
Certificate Verification
We can verify the certificate chain and expiration using OpenSSL. The following historical output shows the certificate issued during the initial deployment, with a validity period starting on December 28, 2025:
- Chain and Expiration Inspection:
|
|
- SSL Labs Verification: Visiting SSL Labs confirms the A+ rating and details supported protocols and cipher suites.
- Certificate Storage: Certificates are stored under
/etc/letsencrypt/live/npm-1/, persisted on a dedicated Docker volume so renewals survive container re-creations:
|
|
The presence of the npm-1 folder confirms the active certificate.
Conclusion and Best Practices
This technical analysis highlights the system and network layers operating on a personal Raspberry Pi monitoring server:
- Network Isolation: User-defined bridge networks allow backend containers (like Uptime Kuma) to communicate with the reverse proxy over isolated private subnets, keeping internal HTTP traffic segmented from other host workloads.
- Port Mapping & Exposure: Remember that publishing ports via Docker
creates local listening sockets on the host (
docker-proxy), but upstream reachability from the Internet depends entirely on router firewalls and ISP NAT architectures (such as CGNAT). - Systemd + Restart Policies: Ensure the Docker daemon is enabled on boot.
Use
--restart=always(orunless-stopped) for persistent services. - Resource Monitoring: Use
docker statsto verify memory and CPU consumption periodically. - TLS Offloading: Terminating TLS at the reverse proxy (Nginx Proxy Manager) simplifies backend container configuration and ensures strong security headers.
- Let’s Encrypt with DNS-01: For wildcard certificates and environments where inbound port 80 is not available or desired (such as CGNAT), DNS-01 via DNS API credentials provides an automated, reliable verification path.
By understanding Docker’s network layer, configuring systemd persistence, and implementing robust TLS parameters, a personal Raspberry Pi becomes a resilient, well-structured monitoring server.
Thanks for reading!
Written with passion (and a few command lines) on my Raspberry Pi.