My nephews really enjoy Minecraft and so for Christmas, I want to give them a server for us all to play on (of course, self-hosted). The issue is that I've only got a vague idea about how one can safely self-host it, any ideas are greatly appreciated.
The more safe way that I'd personally do something like this would be to VPN into my homelab (Wireguard + DuckDNS) and access the server that way. For practical reasons that's not going to fly... I'd like to connect to the game server from anywhere, with any account, and without a VPN. This will make it accessible to the kids.
When one adds a server in Minecraft, it seems like they specify a FQDN:Port (MySite.com:25565). I could punch port forwards in my firewall and call it a day, but this seems insecure. Going forward I'm not going to forward any ports without some layer of encryption or authentication on the other side (seems like the latest best practice).
Cloudflare Zero Trust sounded like the ideal solution, notably because it's free, but also that it has intrinsic protection against DoS attacks. This isn't self-hosted though, and to properly utilize this, I would need to purchase my own domain name (not opposed to that, just an extra cost).
How do you guys architect your services to be secure while also being broadly accessible on the Internet? I imagine it's a similar tale for self-hosting a website, just in this case it's a Minecraft server. Thanks much.
I just hosted it as a docker container, exposed the ports and setup a white list.
Never had an issue with it. I have a domain already for other stuff i host, so just created a play..com which can be used behind non proxied cloudflare. I have the docker restrictions pretty limited though so just enough for it to run basically and running from a non root user. I think in most cases this would be fine. White list will stop randoms from joining unless that persons account gets compromised. I also run backups as well just in case something does happen, that role based on activity. All of these are easily done and available in docker making supporting it easy, as well as utilities like Rcon etc, these obviously I don't expose.