Host a web server in a Linux VM inside Truenas, PortForwarding etc.

GetCon

Cadet
Joined
Feb 18, 2023
Messages
2
Hello and thanks for taking the time to read and possibly respond!

I'm new to the hardware/software configuration of a server, but I'm pretty good with google. That lead to my current situation.
I built a nas, loaded up truenas, created a Linux (ubuntu 20.04) Vm, and downloaded my webpanel manager, (plesk,cloudpanel,cpanel etc)

I know I need to port forward. I know I need to use Cloudflare or something similar to its my port, to be secure. But I have no idea of where I can find the port that I need to forward, if I need to do any other configurations, and if I need to install something out of the ordinary.
I have set up VPS's with hetzner, amazon or even Bluehost, but these services already had a public IP that I could point my domains, to and were pretty much ready to use.


So what Im hoping to learn from this thread:
  1. how can i find the port i need to forward for the linux vm
  2. any steps that might need to be done before i deploy something like this
  3. recommendations, suggestions or any tutorials,videos you think might help my situation
Thanks again for taking the time!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,466
I know I need to port forward.
Yes, probably, unless you're using a Cloudflare tunnel.
I know I need to use Cloudflare or something similar to its my port, to be secure.
No idea why you'd think this. Cloudflare tunnels (mentioned above) are one way to handle things (and essentially replace port forwarding), but certainly not the only one.
But I have no idea of where I can find the port that I need to forward,
For a web server? It'd be 80 and 443, to the IP of your Linux VM. If you want to make other services on that VM public, you'd forward the ports for those services.

The simplest/safest way to handle this would likely be using a Cloudflare tunnel, assuming DNS for your domain(s) is hosted with Cloudflare (or you're willing to move it there). That involves installing the Cloudflare daemon on your Linux VM and configuring it to connect to Cloudflare, following the docs here:

Once you do that, there's no need for further configuration, dynamic DNS setup, port forwarding, or anything else; cloudflared essentially sets up a VPN connection between your VM and the Cloudflare CDN.

If you use port forwarding, you don't need (or really want) cloudflared.
 

GetCon

Cadet
Joined
Feb 18, 2023
Messages
2
wow so setting up Cloudflare tunnel, (and yes I have my domains on Cloudflare already) is the only thing I need? and I can just skip port forwarding all together?
 
Top