this post was submitted on 02 Mar 2024
14 points (81.8% liked)

Selfhosted

39937 readers
418 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:

  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!

founded 1 year ago
MODERATORS
 

Hello everyone :D

I’m looking to host some gaming servers to play with my friends (minecraft, enshrouded, and others), and some apps (paperless-ng, jellyfin, seafile, etc.). Each game server must be accessible from the Internet, but only certain applications will be accessible (jellyfin, etc.)

I don't want to open any ports on my router or share my public IP. I already have a domain name, and I'm thinking of using some VPS to host a reverse proxy with tailscale or netbird.

For the VPS, I'm thinking of using OVH with unlimited bandwidth. I already have the domain name here, and I live in France where the servers are.

A few questions :

  • Is this a good idea ? Any better solution is welcome.
  • I don't really know how I'm going to redirect subdomains to use the correct reverse proxy. Local DNS on the VPS ?
  • Tailscale or Netbird ? (I actually don't have any idea)
  • Won't using Tailscale or Netbird like this cause performance losses on game servers ?

Reverse proxy :

  • nginx for application
  • infrared or gate for minecraft server
  • Others for different game servers if needed.
all 20 comments
sorted by: hot top controversial new old
[–] Decronym@lemmy.decronym.xyz 5 points 8 months ago* (last edited 8 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
TCP Transmission Control Protocol, most often over IP
UDP User Datagram Protocol, for real-time communications
VPN Virtual Private Network
VPS Virtual Private Server (opposed to shared hosting)
nginx Popular HTTP server

7 acronyms in this thread; the most compressed thread commented on today has 9 acronyms.

[Thread #564 for this sub, first seen 2nd Mar 2024, 14:55] [FAQ] [Full list] [Contact] [Source code]

[–] peter@feddit.uk 3 points 8 months ago (1 children)

As far as I'm aware you don't need a seperate VPS if you're using tailscale, or you don't need tailscale of you use a reverse proxy via a vps. You can just host it in the same place you're hosting the games and apps.

[–] dragnansia@lemmy.world 1 points 8 months ago (1 children)

If I use the same server to host games and apps, how am I going to redirect URLs to the correct reverse proxy ? I think I need a little more research, but I agree that putting the reverse proxy in the same place as what I'm hosting is a better idea.

On the other hand, if I just use tailscale, how can people connect to the game servers without having to install anything ? Or I just don't understand how it works.

[–] peter@feddit.uk 1 points 8 months ago (1 children)

You still need a reverse proxy just doesn't need to be on a seperate server. If you want to do it without people having to install something, you may be able to use cf tunnels for the web pages but game servers definitely don't work through that and you'd have to have some sort of external forwarding. Keep in mind though that will introduce possibly an unacceptable amount of lag to the server.

[–] dragnansia@lemmy.world 1 points 8 months ago

I'm going to try the first approach of @Limonene.
I hope the amount of lag is not that high, and thank you for reminding me.

[–] Limonene@lemmy.world 3 points 8 months ago (2 children)

Using a VPN (like Tailscale or Netbird) will make setup very easy, but probably a bit slower, because they probably connect through the VPN service's infrastructure.

My recommended approach would be to use a directly connected VPN, like OpenVPN, that just has two nodes on it -- your VPS, and your home server. This will bypass the potentially slow infrastructure of a commercial VPN service. Then, use iptables rules to have the VPS forward the relevant connections (TCP port 80/443 for the web apps, TCP/UDP port 25565 for Minecraft, etc.) to the home server's OpenVPN IP address.

My second recommended approach would be to use a program like openbsd-inetd on your VPS to forward all relevant connections to your real IP address. Then, open those ports on your home connection, but only for the VPS's IP address. If some random person tries to portscan you, they will see closed ports.

[–] ArtikBanana@lemmy.dbzer0.com 3 points 8 months ago (1 children)

Just chiming in about Tailscale.
The initial connection uses their server just to reach / connect to the other peer. After that, the peers are connected directly and all communication is direct.

[–] dragnansia@lemmy.world 1 points 8 months ago

That's a good news.

[–] dragnansia@lemmy.world 2 points 8 months ago

I'm going to try your first approach, which seems to be what I want.
The second one looks tempting, but the first one seems to be more secure, I think.

[–] slazer2au@lemmy.world 2 points 8 months ago (2 children)

cloudflare tunnel?

Stick the cloudflare container in a docker network with other services you wish to expose for access.

[–] alive_posted115@lemm.ee 5 points 8 months ago

Just so everyone is aware, Cloudlfared tunnels allow Cloudflare to see all of your server's traffic

[–] dragnansia@lemmy.world 2 points 8 months ago (1 children)

This can be a solution, but only for game servers, and I'm just going to use Tailscale or Netbird for apps.

From what I can see, it's possible to use this for playing Minecraft with this mod, modflared. Not the best solution, but a working one (I hope).

[–] PeachMan@lemmy.world 2 points 8 months ago* (last edited 8 months ago) (1 children)

but only for game servers

Why? I use tunnels for everything, all sorts of apps included. They're easy to set up, and reliable.

Tailscale is a good solution, though. I use that as well.

[–] dragnansia@lemmy.world 2 points 8 months ago (1 children)

I don't know if this is paranoia, but I don't read good things on Cloudflare for privacy.
And after some thinking, using OVH VPS is not the best thing to do for privacy...

You got me 😂

[–] PeachMan@lemmy.world 2 points 8 months ago

They've had some security breaches, like most companies. If you're feeling paranoid, do some reading on nginx vulnerabilities.

Exposing your home servers to the Internet is always risky. There is no 100% safe way to do it.

[–] ArtikBanana@lemmy.dbzer0.com 1 points 8 months ago* (last edited 8 months ago) (1 children)

Tailscale funnel lets you expose services to the internet without opening any ports.

There's also the option of inviting your friends to your Tailscale network and limiting them to specific services. But they'll have to install it on their devices.

[–] dragnansia@lemmy.world 1 points 8 months ago

I'm going to look at Tailscale Funnel and I don't want my friends to have to install software to play.

[–] Dark_Arc@social.packetloss.gg 1 points 8 months ago* (last edited 8 months ago) (1 children)

ZeroTier is also an option in the same vein as TailScale.

You will share your IP with something like TailScale or ZeroTier.

Reverse proxies can be good but with gaming ... there's only so much you can do because of the custom protocols. Most of that stuff isn't going to care about the DNS. You're also introducing additional latency if you use a VPS as a "middle man."

I think you need to consider who you're going to be giving access to and what threats you're trying to protect against.

My advice would be to set up ZeroTier on all the machines that are going to play together and set it up so it only allows connections between clients and the server (there's a guide for this in their documentation). Then give the gaming machine a ZeroTier IP you put in your DNS.

Most games use different ports so there really isn't a need for lots of DNS names. However, you could assign multiple ZeroTier IPs to the same machine and give each game server its own DNS and its own IP.

[–] dragnansia@lemmy.world 1 points 8 months ago

We've already tried ZeroTier a long time ago, and it works well, but if you want to add another person to the game, it's a "lot" of steps before you can play. You're probably right that the best solution would be to use ZeroTier, but it's not the most practical for everyone. At least that's my opinion.
And you need to install a new application just to play with others, which is not what I want.