0

I bought a server and have Ubuntu 22.04 installed.

When I run various Github projects like Text Generation Webui, Automatic1111 Stable Diffusion, etc., how do I forward the port to access it from my network as 192.10.1.10:7680 or whatever the port for that project is?

Is ssh tunnel the most secure or should this be set up through the router? This is not publicly accessible, only for devices connected to my home network.

2
  • use openssl instead
    – petep
    Commented Dec 19, 2023 at 23:31
  • 2
    @petep OpenSSL has nothing to do with making ports/services open to the internal LAN network.
    – Thomas Ward
    Commented Dec 19, 2023 at 23:55

1 Answer 1

3

This isn't a 'port forwarding' issue at this point, it's a "how the applications listen on system".

You need to specify the listen address to these tools on your home networked computer of 0.0.0.0 to listen publicly on the ports they use on your computer.

Case in point, though, for Automatic1111 used for StableDiffusion as a UI, just add --listen to your launch options and then it'll automatically listen on the local system IP address on the default port it uses.

For other 'projects', it will depend on the application in question on how to specify the listen address and port on the various projects; unfortunately, every project is different and not all of them have the same way to define listening addresses/ports.

Point is, though, you don't need NAT of port forwarding if the projects can listen directly on the system ports for incoming connections.

If you have a firewall on your computer then all you have to do is permit connections to that port from other systems and you should be good to go.

5
  • I know some have the launch options but other projects don't. How would I specify the listen address and port?
    – rbur0425
    Commented Dec 20, 2023 at 13:14
  • 2
    @rbur0425 that is entirely dependent on each project, you have to look it up on that project's documentation. We are not going to be aware of any options, etc. for different software.
    – Thomas Ward
    Commented Dec 20, 2023 at 22:36
  • This is why using Docker containers for your Web UI applications (and other programs requiring TCP or UDP port access) makes things a lot easier, since Docker (Linux containers) has a unified approach to exposing and mapping ports to the host system. Commented Dec 21, 2023 at 15:38
  • @ArturMeinild Not always an option for many projects.
    – Thomas Ward
    Commented Dec 21, 2023 at 22:34
  • Agreed - just saying this gives a unified approach to exposing ports - as well as many other elements of running dedicated apps. Commented Dec 21, 2023 at 22:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .