this post was submitted on 12 Sep 2025
19 points (95.2% liked)

Selfhosted

52444 readers
1192 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

First off, I think I have the right basic plan but am open to exploring some others, especially if I have some basic assumptions wrong.

GOAL: Allow myself and family to access my various hosted apps without needing to teach VPN or Tailscale.

What I have: Proxmox with Home Assistant VM and some additional LXC containers. I do not intend to do Docker, not interested unless I have to (actually, isn't HAOS using Docker, but beyond that one.) IT Tools is one nice to have I want to get to from work and works as a good test case. Some other LXCs are one for Caddy and one for PiHole. Also, I registered a personal domain through CloudFlare.

PLAN: Get Caddy working internally using PiHole pointing my domain to the internal IP of Caddy and CloudFlare Tunnels and DNS to help get to services from outside going Cloud flare -> Caddy -> service.

I don't know why but nothing I tried seems to work, I can't find a good Caddy HowTo or maybe the relatively recent update of Caddy to v2 changed things??? I don't know. But I really just need some help walking through some of this Caddy setup.

I am going to make another attempt today and will replay with progress. But right now Caddy file is basically back to original OTB. I did add the module for CloudFlare and at one point confirmed that was loaded. I assume that module is needed to get Caddy to talk to CF DNS to confirm I own the domain for creating the certs, but I couldn't figure out what to do with the token, one guide had me adding something to the Caddy file but that just created an error.

So any comments on the plan or insightful nuggets would be appreciated.

you are viewing a single comment's thread
view the rest of the comments
[–] anonion@lemmy.anonion.social 7 points 1 month ago (2 children)

This is really all you need to get started. Assuming you have built caddy with the cloudflare dns module

{
    acme_dns cloudflare cloudflare_api_key
    email your@email.com
}
pihole.yourdomain.com {
    reverse_proxy http://192.168.0.4/
}

Your cloudflare API key needs this: "API Token: Zone.Zone:Read and Zone.DNS:Edit permissions for the domain(s) you're managing with Caddy"

One thing to mention, you probably want to configure the DNS settings on the caddy LXC to be something like 1.1.1.1 or 8.8.8.8 instead of pihole.

[–] BlackEco@lemmy.blackeco.com 3 points 1 month ago

I would add that you can follow this guide for building Caddy with DNS Provider modules. For Docker you can start from the instructions for Caddy Docker Proxy

[–] cwisch@midwest.social 1 points 1 month ago (1 children)

Hmm, I confirmed cloudflare module with "caddy list-modules" and see:

<list of standard modules>
  Standard modules: 127

dns.providers.cloudflare

  Non-standard modules: 1

  Unknown modules: 0

But when I do a reload I get "Error: adapting config using caddyfile: Caddyfile:12: unrecognized global option: acme_dms"

[–] anonion@lemmy.anonion.social 5 points 1 month ago (1 children)

You have a typo. Its "acme_dns" not "dms"

[–] cwisch@midwest.social 2 points 1 month ago

Thank you, getting old sucks. Didn't even see that.