Staging Server¶
The staging server follows the same deployment model as the live environment to ensure configuration parity and predictable testing conditions. It runs a fully Docker-based stack with a few differences that keep it isolated from production.
Cloudflare Tunnel (systemd)¶
On staging, Cloudflare Zero Trust runs as a systemd service rather than a Docker container. This keeps the tunnel active even when Docker services are stopped or restarted.
Check status:
Restart if needed:
Stream logs (useful when diagnosing 502 errors):
Running cloudflared outside Docker provides:
- Persistent background operation independent of Docker
- Automatic recovery on system reboot
- Stable tunnel even during container maintenance
Why not run cloudflared inside Docker?¶
Running cloudflared as a container was evaluated and rejected. The problems are:
- SSH configuration through a container adds extra networking layers and permission handling.
- Tunnel routing and Zero Trust access policies become harder to reason about.
- Debugging is significantly more complex when the tunnel itself is containerized.
Keeping cloudflared at the host level makes the setup simpler, tunnel behaviour more predictable, and SSH access straightforward to manage.