Pi-hole and Caddy give my homelab real HTTPS domains without forwarding a single port

Pi-hole and Caddy give my homelab real HTTPS domains without forwarding a single port

Published Dec 4, 2026, 10:30 AM EST Patrick Campanale has been in the tech space for well over a decade, specializing in PC/gaming news and reviews, as well as maker-focused products to build small businesses. With a start in technology back in 2010 surrounding the Palm/webOS ecosystem, Patrick spent his formative years developing mobile applications as well as blogging for various publications, eventually leading to starting his own website in 2014. After running a technology blog for a few years, he stepped out of that role and into the world of high-end custom PC manufacturing and building, with a focus on YouTube video production and overclocking. Then, in 2017, Patrick joined the 9to5Toys team as an editor/writer/reviewer with over 14,000 articles being published during his time there, ranging from deals and roundups to in-depth reviews on the latest technology, video games, 3D printers, and more. In his free time, Patrick loves to create projects from wood using various robots and methods, including leveraging the technologies of CNCs and lasers. If Patrick isn't working on a computer or playing video games, he's likely in his 2-car garage workshop creating something unique. In addition to all this, Patrick is also the media director at his local church where he feels God has called him to serve, and he loves every minute of it. It seems like every other day there’s another hack or another service is compromised. Did you know that your homelab is actually extremely vulnerable to intrusion when you open ports to the outside world? That’s why disabling outside access is imperative to a secure homelab. But, no external access means no reverse proxies, which means no domain names with SSL certificates inside the homelab, right? Wrong. Today, I’ll show you how a simple Pi-hole and Caddy setup can let you give a domain name to any service in your homelab without forwarding a single port. Exposing a homelab to outside access is a risky move There are pros and cons, but make sure you know what you’re doing before exposing it In a world full of AI everything, homelabs are probably one of the most vulnerable pieces of tech out there. I know that at least my setup was very poorly protected for quite some time. The thing is, a homelab is only as secure as you make it. For instance, if you open up a bunch of ports to the outside world, then those ports are open for anyone to come in through. Hackers, bad actors, or just your friends and family. Anyone with your IP address and a port scanner or knowledge of the open port can reach your servers even without your knowledge. This is where a good firewall setup comes in to stop them from doing bad things, but a homelab open to outside access is still a security risk even with the best firewall in the world. So, external homelab access should be considered carefully. Do you really need that service to be accessed outside the network, or do you just want to give it a domain name so it’s easier to access inside your home? For instance, that dashboard you built for the whole family to use—does anyone need to access it from Walmart, or are they just accessing it from a computer in the house? The Minecraft server your kids are all playing on, do people outside the network need access, or just those in the house? These are the questions that you should be asking yourself before opening any ports on your network. I didn’t ask these questions early on in my homelabbing journey and put anything and everything behind a reverse proxy in the name of easier access because typing qBt.domain.com is easier to do than remembering 192.168.1.147:8080 to access qBittorrent, and typing pi-hole.domain.com is easier than 192.168.1.74/admin to get to the Pi-hole dashboard. But, in both instances I just shared, a locally-routed domain would be a much better solution than trying to route a domain from the internet for just anyone to access, and that’s where a combination of Pi-hole and Caddy come in. Pi-hole and Caddy let me assign custom domains to self-hosted services, no external access required You can even issue SSL certificates! Before you start routing domains internally, I do recommend purchasing a domain. I know, you aren’t planning on using these subdomains externally, so why buy a domain? It’s under $12 from Cloudflare and it’ll allow you to issue proper SSL certificates that don’t require you to install self-signed certificates on every client device. It’s worth the less than $12 per year a domain takes to run—and you get the benefit of using that domain with external services hosted in your homelab or on a VPS somewhere. Once you have a domain (or if you choose to not buy one), you’ll need two pieces of software: Pi-hole and Caddy. Really, you can use any DNS software like AdGuard Home or Technitium, and you need any reverse proxy software—Nginx Proxy Manager or even pure Apache would also work. But, I like Pi-hole and Caddy, so those are what I’m writing about here today. Pi-hole is most well-known for its blocking capabilities, which it’s great at. But, Pi-hole also serves as a DNS server for any DNS request on your entire network. For instance, if you attempt to go to jellyfin.domain.com, that request first starts at your DNS server. From there, your DNS server checks its own cached or stored records to see if it has a destination IP address to send the request to. If it does, the request goes there. If it doesn’t, it reaches out to the upstream recursive resolver DNS servers like Cloudflare to see if it’s supposed to resolve somewhere. Inside of Pi-hole, you can set up DNS records so it knows where to route something. In this instance, you’re going to send DNS requests to the server that Caddy is running on. Let’s say Pi-hole is on 192.168.0.7, and Caddy is on 192.168.0.8 as an example. So, you would point jellyfin.domain.com to 192.168.0.8 inside of Pi-hole. Then, inside of Caddy, you would route it just like normal by sending all requests sent to jellyfin.domain.com to the proper port and IP address that Jellyfin is running on, say, 192.168.0.9 port 8096. From there, you’ll want to make sure that Caddy is set up with Cloudflare to issue SSL certificates if that’s something you’d want (and I would recommend doing it for sure). By default, Caddy uses Let's Encrypt SSL certificates, but those don't work with an internal-only domain. With Cloudflare, you can set up the DNS-01 challenge through the Cloudflare API which allows Caddy to issue SSL certificates for local-only internal domains using the caddy-dns/cloudflare module. My homelab balances both internally- and externally-accessed services Some things are best left off the World Wide Web Really, that’s all there is to it. Add a DNS A record inside of Pi-hole, direct that A record at the Caddy server, and have Caddy route the request where it needs to go. The best part is, this only works for records entered into Pi-hole. Let’s say you want Jellyfin to be accessible on your local network under jellyfin.domain.com like I talked about. Great, set it up following the instructions above. However, you want minecraft.domain.com to resolve to a proper IP address with a Minecraft game hosting provider. That’s simple too, just add the A record for that DNS entry with Cloudflare (or whoever you registered your domain with) and it’ll work. That’s exactly how I run my homelab. I have some subdomains accessible outside my homelab for friends or family to access, or even for full-on websites to run. Then, I have some subdomains accessible only on my local network through a separate Caddy instance. Yes, that means I’m port forwarding ports 80 and 443 with external access, but I do understand the risks associated with doing that and I have proper blocking requests in place. For instance, I have my Caddy set to only accept requests coming from Cloudflare’s IP range so if someone tries to make a request to my server without using Cloudflare’s IP range it’s instantly dropped. But, for things like my Proxmox web UI, local Open WebUI instances, Pi-hole, and several other things, I just keep everything local. Some things are better off not exposed to the internet. And, if I do want to access those services when I’m not at home, I just connect to Tailscale and everything works just as it should even when I’m not at home. Just be smart with what you expose to the internet Several months ago, I ran into a problem where I had qBittorrent exposed to the internet via a reverse proxy. I had a web login on qBt, so I figured I was safe. The problem is, qBt somehow had its password reset to default after an update and that meant everyone could get in. A cryptominer got into my network, installed cryptomining software on my server, and had my CPUs pegged at 100% until I was able to remedy the problem. I never really needed qBt to be accessible outside of my network, I just wanted it to have an easy-to-remember domain name with SSL instead of trying to remember the IP and port. It was a lesson learned though, and now I’m much more picky about what services I expose to the internet at large compared to what I keep just local.

Original Source

Read the full article at Howtogeek →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.