---
title: "Discussion on \"Step-by-Step Guide to Hosting Your Website on a VPS Using Caddy Server and Cloudflare\" | Hashnode"
description: "Discussion on \"Step-by-Step Guide to Hosting Your Website on a VPS Using Caddy Server and Cloudflare\". Learn how to host your website on a VPS using Caddy Server and Cloudflare with this step-by-step guide"
url: "https://hashnode.com/posts/step-by-step-guide-to-hosting-your-website-on-a-vps-using-caddy-server-and-cloudflare/6732878bf7b1da97125776ff"
---

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

Discussion

# [Step-by-Step Guide to Hosting Your Website on a VPS Using Caddy Server and Cloudflare](https://dushmanta.hashnode.dev/step-by-step-guide-to-hosting-your-website-on-a-vps-using-caddy-server-and-cloudflare?utm_source=hashnode&utm_medium=feed)

Learn how to host your website on a VPS using Caddy Server and Cloudflare with this step-by-step guide

Nov 11, 2024 · 8 min read · dushmanta.hashnode.dev  
Updated Sep 25, 2025  
Read the article

-   [#vps-hosting](https://hashnode.com/tag/vps-hosting)
-   [#cloudflare](https://hashnode.com/tag/cloudflare)
-   [#digitalocean](https://hashnode.com/tag/digitalocean)
-   [#droplet](https://hashnode.com/tag/droplet)
-   [#caddy](https://hashnode.com/tag/caddy)

## Written by

[Dushmanta](https://hashnode.com/@dushmanta)

@dushmanta · Bhubaneswar, Odisha

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

Software Engineer @HyScaler

Passionate Software Engineer

## Responses 1

Markdown supported · ⌘↵ to post

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

[Nov 5](https://hashnode.com/posts/step-by-step-guide-to-hosting-your-website-on-a-vps-using-caddy-server-and-cloudflare/6732878bf7b1da97125776ff/comment/6aebeafaf1f626b8759f85f8)

On a VPS with Cloudflare in front of Caddy, the edge stays calm when origin encryption matches what Caddy actually serves on :443 and the proxy hop never strips the Host the site block expects. I keep Caddy alone on :80 and :443, leave HTTP-01 on the plain listener when DNS is grey-clouded for issuance, and switch to DNS-01 or a temporary DNS-only record when the orange cloud would swallow the challenge. Reverse\_proxy targets the compose service name on a private port; Host and X-Forwarded-Proto stay intact so Astro or any static app never redirects to an internal name.

After a Caddyfile reload I confirm the leaf SANs cover every public name, that the first plain HTTP request becomes a single HTTPS redirect to the canonical host, and that CF-Connecting-IP or the real client address still reaches access logs when you need abuse triage. A Full versus Full (strict) mismatch, or a missing AAAA while dual-stack is advertised, often looks like an intermittent browser trust failure until you compare the certificate seen at the Cloudflare edge with the one Caddy presents on the origin listener.
