Hi everyone!

I’m looking into self-hosting, and I currently have dynamic DNS set up to point to my home IP.

My question: is it worth getting a dedicated IP through a VPN?

I’m pretty technically savvy, but when it comes to networking I lack practical experience. My thought is that pointing my domain to a dedicated IP and routing that traffic to my home IP would be safer - especially if I only allow traffic on certain ports from that IP. Just curious if that idea holds up in practice, or if it’s not worth the effort.

youmaynotknow
link
fedilink
English
7
edit-2
6M

A fixed IP does make things easier at first, but I fail to see the value on that for personal use. Nothing a reverse proxy and DDNS can’t replace.

I purchased a domain, use dynamic DNS for it, and point my sub domains to an NGINX proxy server that handles where each points to.

Nothing has access to anything in my network from the internet (all ports are closed on my PFSense), other than Wireguard, and I just VPN into my network when I’m not home.

It was scary when I started, but figured it out in a couple of days. Take into consideration that I’m not even mildly smart, so it should be fairly easy for anyone.

Get into forums, ask around, watch tutorials, you’ll be up and running in no time.

Good luck.

@kakes@sh.itjust.works
creator
link
fedilink
English
26M

Thanks for the reply!

So the NGINX server hosted outside your network, then? And then reverse-proxy that into your home server?

Honestly, I feel like NGINX is a bit overkill for my situation, since I’m not expecting to have a lot of traffic. I could be wrong, though.

@marsara9@lemmy.world
link
fedilink
English
66M

Their setup sounds similar to mine. But no, only a single service is exposed to the internet: wireguard.

The idea is that you can have any number of servers running on your lan, etc… but in order to access them remotely you first need to VPN into your home network. This way the only thing you need to worry about security wise is wireguard. If there’s a security hole / vulnerability in one of the services you’re running on your network or in nginx, etc… attackers would still need to get past wireguard first before they could access your network.

But here is exactly what I’ve done:

  1. Bought a domain so that I don’t have to remember my IP address.
  2. Setup DDNS so that the A record for my domain always points to my home ip.
  3. Run a wireguard server on my lan.
  4. Port forwarded the wireguard port to the wireguard server.
  5. Created client configs for all remote devices that should have access to my lan.

Now I can just turn on my phone’s VPN whenever I need to access any one of the services that would normally only be accessible from home.

P.s. there’s additional steps I did to ensure that the masquerade of the VPN was disabled, that all VPN clients use my pihole, and that I can still get decent internet speeds while on the VPN. But that’s slightly beyond the original ask here.

@kakes@sh.itjust.works
creator
link
fedilink
English
26M

Wouldn’t this require any user to connect to the VPN though? I’m looking for something more publicly accessible - say like a website.

@marsara9@lemmy.world
link
fedilink
English
36M

Yes it would. In my case though I know all of the users that should have remote access snd I’m more concerned about unauthorized access than ease of use.

If I wanted to host a website for the general public to use though, I’d buy a VPS and host it there. Then use SSH with private key authentication for remote management. This way, again, if someone hacks that server they can’t get access to my home lan.

youmaynotknow
link
fedilink
English
36M

No, it’s inside the network. Once I’m inside my network via the VPN, the proxy server routes to the service I want based on the subdomain instead of using the IP and port as the address.

This can also be useful if, instead of going the VPN route, and you choose to go the CDN tunnel (for example, Cloudflare) way. I actually started with a tunnel via Cloudflare, but after some digging, I don’t trust them anymore. Having a tunnel allows you to close all ports coming into your network, but at the expense of having to trust the tunnel provider, and I don’t trust many companies out there.

calm.like.a.bomb
link
fedilink
English
36M

No, the nginx runs inside your network. It’s the “entry point” to it and it proxies all requests to your respective services.

@peregus@lemmy.world
link
fedilink
English
2
edit-2
6M

@kakes@sh.itjust.works It would be better to have the server on a separated VLAN

@kakes@sh.itjust.works
creator
link
fedilink
English
16M

Yeah, thats definitely something I need to look into setting up.

@kakes@sh.itjust.works
creator
link
fedilink
English
16M

Ahh okay, thanks for the clarification. Honestly I should use NGINX just for the sake of learning it, if nothing else.

Nginx isn’t for security it’s to allow hostname-based proxying so that your single IP address can serve multiple backend services.

@kakes@sh.itjust.works
creator
link
fedilink
English
16M

Thanks, I’m only very vaguely familiar with NGINX, so I appreciate the clarification.

@atzanteol@sh.itjust.works
link
fedilink
English
2
edit-2
6M

To provide a bit more detail then - you would setup your proxy with DNS entries “foo.example.com” as well as “bar.example.com” and whatever other sub-domains you want pointing to it. So your single IP address has multiple domain names.

Then your web browser connects to the proxy and makes a request to that server that looks like this:

GET / HTTP/1.1
Host: foo.example.com

nginx (or apache, or other reverse proxies) will then know that the request is specifically for “foo.example.com” even though they all point to the same computer. It then forwards the request to whatever you want on your own network and acts as a go-between between the browser and your service. This is often called something like host-based routing or virtual-hosts.

In this scenario the proxy is also the SSL endpoint and would be configured with HTTPS and a certificate that verifies that it is the source for foo.example.com, bar.example.com, etc.

@kakes@sh.itjust.works
creator
link
fedilink
English
26M

Ahh okay, interesting. I’ll have to give this a try, then.

Create a post

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!

  • 1 user online
  • 136 users / day
  • 427 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog