The snags I met taking apps from my laptop to a VPS behind HTTPS, and the habits they taught me.
01 · The setup
Containers, a reverse proxy and a certificate.
The builds are packaged with Docker and Docker Compose and published behind Traefik with Let’s Encrypt certificates on a Hostinger VPS. The apps publish no ports of their own; the proxy routes by hostname and terminates the certificate.
02 · When HTTPS does not work
Diagnose it layer by layer.
The first deployment problems were HTTPS ones. The reliable way through was to go in order: DNS, then application health, then routing, then the certificate. Checking them in that order turns one vague symptom into four small questions.
- 1 · DNSDoes the hostname point at the server?
- 2 · Application healthIs the container healthy on its own?
- 3 · RoutingDoes the proxy send this hostname to that container?
- 4 · CertificateHas the certificate been issued for it?
03 · Real snags
Small things that cost an evening.
Host and container ports are independent, which is easy to forget. Commit identity is separate from authentication, so a push can fail even when the name on the commit is right.
After deployment, an error appeared because the plain-Python path had not been given the same output-guardrail variables as the agent path. Guardrails must be consistent across every execution path, and a deployment is where the missing one shows up.
04 · Safe by default
Design the public face so it cannot leak.
ReviewLens runs one Docker image in two modes behind the reverse proxy. The public demo is pre-analysed and its container never receives the API key; live analysis sits behind a password. Containers are read-only and non-root.
Edit on the laptop, push, then pull and rebuild on the server. Do not change source on the VPS.
05 · Use it yourself
A checklist before you put an app on the internet.
- NameThe hostname has a DNS record that points at the server, and has had time to spread.
- HealthThe container starts, stays up, and logs no errors on its own.
- RouteThe proxy has a rule that sends exactly this hostname to exactly this container.
- CertificateA certificate has been issued for the hostname, and renewal is automatic.
- ExposureThe app publishes no port of its own. Only the proxy faces the internet.
- SecretsKeys sit in an environment file on the server, outside the image and outside git.
- Way backThe previous image is still available, so a bad release can be undone in a minute.
06 · When it breaks
The first four things to run.
Work down the layers and stop at the first one that fails. Each check is one short command.
- dig +short your.hostDoes the name resolve to the server’s address?
- docker ps and docker logs <name>Is the container running, and what does it say?
- curl -I https://your.hostWhat does the outside world receive: a response, a certificate error, or nothing?
- The proxy’s logsLook for the certificate request for your hostname and any error beside it.
What I took away
- Deployment is part of the product, not an afterthought.
- Debug HTTPS in order: DNS, health, routing, certificate.
- A public demo should be unable to spend or leak a key by construction.