Me

That's me!

Visitors:

1337

Quick Links

Follow Me

Minecraft Server Hosting with Tailscale and Caddy

📅 June 26, 2026
#minecraft #tailscale #caddy #homelab
💬 25 comments 👀 320 views ⏱️ 9 min read

How to host a Minecraft server in your homelab and make it accessible to friends outside your network using Tailscale and Caddy.

Context

I want to host a minecraft server with some requirements: - It has a public address (mc.example.com) - Hosted at my homelab - My friend outside my network can join

Problem

My router don't have a public IP where I can forward to do expose it to do reverse proxy.

Solution

Tailscale. It's free.

  • Get a VPS with static IP
  • Install Tailscale on both the VPS and your homelab hosting the Minecraft server (Make sure to have MagicDNS turned on for local domain)
  • Both the server must be in the same subnet
  • Reverse proxy the MagicDNS domain from the VPS
  • Point the DNS A record to the VPS
What this does is basically, when the player tries to connect to mc.example.com in their Minecraft client, it will fo through that VPS first. The VPS will then proxy that request into your homelab, since it is callable from the same subnet.

Reverse proxy with Caddy

Make sure to have Layer4 extension of Caddy for it to support TCP/UDP proxy. Refer here 🔗 for installation guide.

This is due to a Minecraft server is not an HTTP server(duh) where you can configure normally.

Here a snippet of my Caddyfile:

{
        debug

        layer4 {
                :25565 {
                        route {
                                proxy {
                                        upstream vm01.homelab.qud:25565
                                }
                        }
                }
        }
}

(ffs i hate Caddyfile for using 4 spaces tab instead of 2 like yaml)

So the structure for the whole networking thing would looks something like this:

flowchart TD

A(Players) -->|Connect the Minecraft server address| B(VPS)

B -->|Reverse Proxy the Tailscale IP| C(Minecraft Server in homelab)

Tailscale will handle the request from outside into your local subnet. As you can see, I'm using vm01.homelab.qud here since i setup my MagicDNS that way. If you are unsure, can just put the Tailscale IP there; it would work just the same.

👋 Thanks for reading!

Did you enjoy this post? Let me know what you think! I love hearing from readers.

← Back to Blog

Written with ❤️ by Quddus

Last updated: 6/25/2026

💌 Want more awesome content?

Subscribe to get notified when I publish new posts!

* No spam ever, just quality content delivered straight to your inbox!

🌟 Enjoying the retro vibe? This website is best experienced with a dial-up connection! 📞

© 2024 Quddus Portfolio. Best viewed in Netscape Navigator.