Considerations for a homeserver thats open to the internet? (Jellyfin / Nextcloud)
Hey guys,
after reading up on selfhosting for weeks now I finally decided to take the plunge today and tried setting up my own nextcloud & jellyfin instances. For this purpose I am using a mini PC. (similiar to an Intel NUC)
Now I would like to make both services available to the internet so I could show images to friends while I'm at their place / watch movies with them.
The problem is I am currently not very educated on which security measures I would have to take to ensure that my server / mini PC doesn't immediately become an easy target for a hacker, especially considering that I would host private photos on the nextcloud.
After googling around I feel like I find a lot of conflicting information as well as write-ups that I don't fully grasp with my limited knowledge so if you guys have any general advice or even places to learn about all these concepts I would be absolutely delighted!
Thank you guys sooo much in advance for any and all help, the c/selfhosted community has been nothing but a great resource for me so far!!!
General advice would be to look boring and hide your IP as much as you are able (get a domain). As long as you're not looking juicy you won't attract skilled attention. It's like locking a bike, most bad actors will just pass by looking around for one without a lock or a real fancy one worth their resources.
You can utilize Cloudflare's free offerings, starting with simple stuff. Their DNS Proxy is essentialy a single-click but will help substantially. You can build on top of that with simple WAF rules, such as droping connection attempts from IPs originating from countries notorious for "poking around". You can also reverse that rule and whitlelist only your country.
Keep your firewall tight, don't expose other ports, put your services behind a reverse proxy and redirect everything to HTTPS.
Start simple, constantly improve, learn more advanced methods/concepts.
So it makes you IP less discoverable. However, if someone finds your IP randomly (through brute force), would you still be vulnerable? Or is it possible to only port forward to a static CF address so only CF can connect to you outside of your home network?
You would, but that’s where your firewall and SSL certificates come into play. I use a reverse proxy and forward port 80/443 directly to it. Everything I host resolves to a CNAME in Cloudflare and my proxy responds with a 404 to any unknown requests.
You'd set your firewall rules to only accept requests from the cloudflare datacenter IPs for those port forwards. So, the ports would be otherwise blocked to anyone else trying to access them directly.