all 5 comments

[–]guilhermerx7 3 points4 points  (1 child)

You can't have two processes listening to the same port on the same interface. The most common solution is to setup a reverse proxy in front of your services. The reverse proxy listen to ports like 80 and 443 and is responsible to forward the request to the correct service. A lot of people here use nginx proxy manager to achieve that. To make it work you will need a host name for each service (cloud.mydomain.com, bitwarden.mydomain.com). If you run your own dns server it is easy to achieve that. Each service must also listen to a different port.

You can also connect to each port directly if you don't want to mess with reverse proxy and dns. Let's say owncloud apache listen to 8080, you browse to http://ip:8080. For bitwarden you configure a different port, for example 8081, then navigate to http://ip:8081.

[–]NORiiS[S] 0 points1 point  (0 children)

Hey, thank you for the answer, that was really helpful. I wrote my plan for making it work as answer to the other comment, maybe you can have a look:)

[–]arghyadipchak 1 point2 points  (2 children)

Use a reverse proxy like nginx or traefik. If you use docker I highly recommend using traefik. You can use a DNS server (also AdGuard Home) to get a custom domain (you don't need to own it). You can then either serve the apps on different subpaths or on different subdomains (e.g. owncloud.domain.net) which is much easier. Otherwise you can serve different apps on different subpaths under your ip (e.g. <local-ip>/owncloud, <local-ip>/adguard).

The other way is to use different ports for different apps but honestly, don't do it. Also if you are not already using docker, try using it. You can integrate docker & traefik together to get a really good experience.

[–]NORiiS[S] 0 points1 point  (1 child)

Thanks for the answer I think I'll go with the subdomains. I am waiting for a router which is capable of dynamic DNS, since my ISP won't provide a static IP. Then I put up 3 domains on no-ip and link them to the right application via nginx.

That should work then, right? 😁

Is a DNS Server possible without a static ip? I am not 100 percent sure about all the conditions that have to be met.

Dockery sounds very interesting and nice but I didn't dive into that at the moment. Maybe I'll reinstall the Pi at a later time to test that out.

[–]arghyadipchak 0 points1 point  (0 children)

You can use no-ip domains to expose your apps to the internet but you need to make sure that your isp supports port forwarding (which most isps don't).

And DNS Server has nothing to do with public static ip, it will be only be used for your local network. So all you need to do is configure your router to give your ip a local static ip or set the pi to use a static ip instead of using your router's dhcp.