I want to host websites on my TrueNas Scale 24.10.2 System. Nothing too fancy, just some small static web apps and in the future I also plan to expand that to websites with persistent databases and things of the sort.
On my system I already run:
A Nextcloud instance
A Collabora instance
A Nginx Proxy Manager instance that handles Nextcloud
A ddns-updater instance to handle possible global IP changes (though as I’ve discovered, my public IP does tend to be pretty stable)
I also have:
My own domain complete with DNS and DDNS records
On my router I have also obviously forwarded the necessary ports to handle all of this and can do so again if need be (just in case it’s worth mentioning, I have a double NAT setup which does make it a hassle to port forward but there is not much that I can do about it.)
What is a simple way to start running a web server and host a few websites on my system? I’ve seen many conflicting pieces of advice online. From running a docker container to a custom Linux VM.
Do I need to run a second instance of NPM in a separate container, or anything like that? Where do I need to situate my files (HTML, CSS, JS, etc)?
I am kind of lost on this since every single even remotely relevant post I found about this online put me on a completely different path, and now I can’t really tell what I should do.
Any advice on this helps - even just some rough pointers on what I need to do to get on the right path.
Either of these would be fine–the docker container probably simpler, though. Spin up a container of nginx (straight nginx, not NPM), Apache, Caddy, or whatever web server you like (I like Caddy, personally), give it a host path for configuration and for its web root, and have it listen on whatever port you like. Create hosts in NPM for whatever FQDNs you want to serve, pointing to that port. Put your content in the web root host path, and write whatever webserver configuration you need (which is a big reason I like Caddy).
Getting something up and running isn’t too difficult, getting it secure is the harder part. Make sure you do your research before putting anything home spun up open to the wild as you will get a LOT of unwanted visitors as well as welcome traffic.
I second the point @Jailer is making about security!
Without being a real expert this is a dangerous setup.
If we are talking about a pure playground system that is strongly isolated from everything else via a separate physical network, I wouldn’t be too concerned. But with the information provided here I would strongly discourage that route.
Is there a special reason not to go for something hosted? A V-server should not be more than 10-15 EUR/USD per month.
As I did more research on this I realized that security would indeed be the biggest challenge.
However that would be a welcome part of it if I do end up going through with it - I am looking to get into cybersecurity and I think this would be a decent challenge. I’ll do my best to take all the necessary precautions and create a safe sandbox environment.