this post was submitted on 15 Aug 2026
41 points (95.6% liked)

Selfhosted

61978 readers
1112 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I've been using Linux for decades, I've worked as a software engineer/architect/sre for around a decade, but networking has always been my biggest gap in knowledge.

I have a local server, I have caddy spun up, a glinet router running their version of openwrt, and I have a domain name purchased through porkbun.

I am looking to setup "local.domain.com" to point to my local server, ideally without exposing it publicly, and enable devices on my home network to be able to access it from that url. Id also like to be able to access containers running on that server by something like "searxng.local.domain.com" or "local.domain.com/searxng" aka without using the port suffix. Id also like to enable https.

I have read so many guides that have fragments of what I need, but nothing that ties enough together to get it working. And with all the options around different domain registers, let's encrypt, reverse proxies, etc, im struggling just a bit.

Are their any guides (prefer text over YouTube, but beggars cant be choosers) that people recommend that encompass the whole process, instead of just pieces? Id like to understand it instead of just fumble through it.

you are viewing a single comment's thread
view the rest of the comments
[–] un_ax@lemmy.today 6 points 3 weeks ago (1 children)

The other answers covered options on hooking up the internal DNS, so here is the https part for the sake of completeness.

One option is running an internal CA, but that's for crazy people. And you have to distribute your root CA to every device using it, which can be annoying if you don't have centralized configuration management in place.

If you want https with caddy and don't want it exposed you can use a DNS challenge with your external DNS provider. Check the list here for your provider.

Assuming docker and your dns isn't built in you build a custom docker image with the plugins you need. This is a Dockerfile for route53 based on here:

FROM caddy:builder AS builder

RUN xcaddy build \
    --with github.com/caddy-dns/route53

FROM caddy:alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

And then a docker-compose.yml in the same dir to use it:

services:
  caddy:
    build: .
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
      - 443:443/udp
    volumes:
      - ./caddy_data:/data
      - ./caddy_config:/config
      - ./conf:/etc/caddy

With this mount setup you write conf/Caddyfile and include the DNS provider specific configuration relevant to your plugin, probably documented in its repo.

[–] dimjim@sh.itjust.works 1 points 3 weeks ago* (last edited 3 weeks ago)

I’ll add on to this fantastic comment, this is exactly what I do. I use the DNS challenge with a domain I purchased to point to a private IP (my caddy server). I probably do it a bit inefficiently, but I literally have a dns entry for every subdomain of mine and have a separate caddy section for each of them for https. I’ll give an example of a simple entry that uses namecheap as the domain/dns provider:

https://subdomain.domain.net/ {

  tls {
    dns namecheap {
      api_key APIKEY
      user username
      api_endpoint https://api.namecheap.com/xml.response
      client_ip 1.1.1.1
    }
  }

  reverse_proxy 192.168.1.1:1234

} ```

You’ll probably have a different tls section for your specific domain/dns, and of course your reverse proxy will sometimes require additional config items.