---
title: "Discussion on \"How to set up a new VPS with a reverse proxy (Caddy) and Docker\" | Hashnode"
description: "Discussion on \"How to set up a new VPS with a reverse proxy (Caddy) and Docker\". Assumptions:\n\nYou have a VPS ready\nYou have purchased a domain name\n\nGenerating and uploading ssh keys\nFirst generate a ssh key pair and ensure the newly created ssh keys are in the ~/.ssh folder to m"
url: "https://hashnode.com/posts/how-to-set-up-a-new-vps-with-a-reverse-proxy-caddy-and-docker/6a444a0651222f0534b5c695"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to set up a new VPS with a reverse proxy (Caddy) and Docker](https://discovertech.hashnode.dev/how-to-set-up-a-new-vps-with-a-reverse-proxy-caddy-and-docker?utm_source=hashnode&utm_medium=feed)

Assumptions: You have a VPS ready You have purchased a domain name Generating and uploading ssh keys First generate a ssh key pair and ensure the newly created ssh keys are in the ~/.ssh folder to m

Jun 30 · 5 min read · discovertech.hashnode.dev  
Updated Nov 17  
Read the article

## Written by

[Victor Wanyungu](https://hashnode.com/@vwanyungu)

@vwanyungu

  
[View profile](https://hashnode.com/@vwanyungu)

Software Developer

## Responses 2

Markdown supported · ⌘↵ to post

[Edge Ops](https://hashnode.com/@edgecacheops)

[Nov 5](https://hashnode.com/posts/how-to-set-up-a-new-vps-with-a-reverse-proxy-caddy-and-docker/6a444a0651222f0534b5c695/comment/6aebe281f1f626b8759f65b4)

On a fresh VPS the edge stays stable when Caddy alone owns :80 and :443, every public hostname has its own site block, and reverse\_proxy targets the compose service name on a private port rather than publishing that port on the host. I keep HTTP-01 on the plain listener so the challenge path never depends on an app container that may be down, set explicit dial and response timeouts toward upstreams, and preserve Host plus X-Forwarded-Proto so absolute redirects never leak the internal network name. DNS A or AAAA for each site name should already point at the box before the first ACME attempt; a partial record set is the usual reason only one of several hosts issues cleanly.

After a Caddyfile reload I confirm the leaf SANs cover every advertised name, that the first plain HTTP request becomes a single HTTPS redirect to the canonical host, and that connect failures versus slow upstream reads stay distinct in the access log. For WebSocket or long-poll admin routes I raise only those read timeouts and disable response buffering there; a trailing-slash or Host rewrite mistake after an edit often looks like an application bug until you probe a static asset and an API path through the same public name separately.

[Victor Wanyungu](https://hashnode.com/@vwanyungu)

[Nov 11](https://hashnode.com/posts/how-to-set-up-a-new-vps-with-a-reverse-proxy-caddy-and-docker/6a444a0651222f0534b5c695/comment/6aebe281f1f626b8759f65b4#reply-6af3cfb1b826d524ee8548f3)

Thanks for sharing this
