rjcn.dev

Homelab DNS/VPN/SSL setup

Abstract:

You have a server at home and want to access it from afar. Look no further, here is your answer.

After this tutorial you will be able to connect from anywhere in the world to your homeserver and acces your apps with a normal DNS and SSL route like:

https://nextcloud.example.com

neat.



Step 1.)

you need a VPN connection to your local LAN.

In my case I have a Fritzbox and can just add a Wireguard connection to it and add it in Ubuntu.


Step 2.)

you need a domain or a sub-domain. In my case I registered a cheap domain, but you can also use a sub-domain.

example.com

or

myhomelab.example.com

You then create an DNS A record wildcard for your local IP like so:


*.example.com
192.168.178.42 (homelab server local ip)


Step 3.)

Setup a (wildcard) SSL self signed certificate with your reverse proxy.

*.example.com


Step 4.)

add your apps to your reverse proxy:

e.g. nextcloud.example.com (fallback to wildcard SSL certificate)


Step 5.)

download the wildcard SSL certificate and import to your browser:


Et voilá, you now can connect to your local stack via SSL and DNS and not getting any “this is not safe” messages from your browser.

And you don’t need to remember the IP and all the ports of your apps! Enjoy!