Mapping port 80:7575

I have a goal of reaching my dashboard via dashboard.mydomain.com from within my LAN. Using portainer, I've configured and created a macvlan and updated the Homarr stack to use that network. The container is now happily running on its own reserved IP at 192.168.1.160 and I'm able to reach the dashboard at http://homarr.mydomain.com:7575. The next step, which I expected to be simple, was to have :80 on that IP forward to :7575 so that I'd have a nice tight path to the dashboard at http://homarr.mydomain.com, but that's not working out so well for me. Does anyone happen to see what I'm missing in my stack definition?
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /volume1/docker/homarr/configs:/app/data/configs
- /volume1/docker/homarr/icons:/app/public/icons
- /volume1/docker/homarr/data:/data
networks:
- lan
ports:
- '7575:7575'
- '80:7575'

networks:
lan:
external:
name: lan
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /volume1/docker/homarr/configs:/app/data/configs
- /volume1/docker/homarr/icons:/app/public/icons
- /volume1/docker/homarr/data:/data
networks:
- lan
ports:
- '7575:7575'
- '80:7575'

networks:
lan:
external:
name: lan
Solution:
💥 http://homarr.mydomain.com/board is now live! ``` version: '3' #---------------------------------------------------------------------# Homarr - A simple, yet powerful dashboard for your server. #...
Jump to solution
25 Replies
explosive parrot
Can you temporarily try a different second port? This will let us know it it's an issue with using 2 ports, or port 80 in particular.
Manicraft1001
Manicraft10016mo ago
@robwilkerson you cannot and shouldn't map the same port to two exposed ports on the bridge. It's a terrible idea and prone to failure. Please remove 7575.
robwilkerson
robwilkerson6mo ago
Tried that originally as a flier with no success, but I take your point This doesn't work either. Will keep plugging away.
networks:
- lan
ports:
- '8001:7575'
networks:
- lan
ports:
- '8001:7575'
Manicraft1001
Manicraft10016mo ago
Is the lan network really working as intended? Do you run other containers with the same configuration as well? Why not just use bridge? Do you need special routing?
robwilkerson
robwilkerson6mo ago
I wanted key containers to have their own ip so I don’t have to remember all of the various ports
Manicraft1001
Manicraft10016mo ago
Okay. Do you the same for other containers?
robwilkerson
robwilkerson6mo ago
This is my first attempt. The dashboard is the key-est web interface.
StLCards
StLCards6mo ago
I have a similar goal of using port 80 and setting up A records in my AD DNS, but running Homarr on port 80 was problematic. I use bridge on all other containers and port 80, but Homarr gets flakey. So for now staying with port 7575 keeps it working until I find a solution.
robwilkerson
robwilkerson6mo ago
The ip is working properly, just not the custom port mapping yet.
Manicraft1001
Manicraft10016mo ago
I really don't get what would be flakey. We do nothing special in the Dockerfile. Can you elaborate what "flakey" means? Does it disconnect sometimes? Certificate errors?
StLCards
StLCards6mo ago
Yeah, flakey wasn’t the best wording. It’s been a couple weeks since I messed with it, but the main page wouldn’t load up when port was set to 80. I tried different browsers, on LAN mobile devices, FQDN and IP. Finally just punted and changed back to 7575 and figured I would tackle it again sometime. On other containers I can set the port number without issue, but this one seems like it’s baked in.
robwilkerson
robwilkerson6mo ago
Yeah, this def feels odd. I assume that homarr's dockerfile exposes :7575 and the application listens on that port. It doesn't seem like it should care which port I map forward from the host, but that said, this is all within portainer on a synology nas, all of which I'm also still getting my head around so...lots of stuff in play that maybe I don't yet understand fully enough.
Manicraft1001
Manicraft10016mo ago
Can you try setting the PORT environment variable? Does it help?
robwilkerson
robwilkerson6mo ago
I see that it's currently set to 7575, so I assumed that was to tell the application where to listen, but yeah, I can try to set that manually.
Solution
robwilkerson
robwilkerson6mo ago
💥 http://homarr.mydomain.com/board is now live!
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
environment:
PORT: 80
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /volume1/docker/homarr/configs:/app/data/configs
- /volume1/docker/homarr/icons:/app/public/icons
- /volume1/docker/homarr/data:/data
networks:
- lan

networks:
lan:
external:
name: lan
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
environment:
PORT: 80
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /volume1/docker/homarr/configs:/app/data/configs
- /volume1/docker/homarr/icons:/app/public/icons
- /volume1/docker/homarr/data:/data
networks:
- lan

networks:
lan:
external:
name: lan
robwilkerson
robwilkerson6mo ago
This also allows me to remove the port mapping all together since it's not running locally as far as my LAN is concerned. Exactly where I was hoping to land.
Manicraft1001
Manicraft10016mo ago
Oh, so using the network probably removes the requirement for port mapping? Sorry, I don't use network that often myself....
robwilkerson
robwilkerson6mo ago
Follow on question about the networking of the dashboard. I have an app linking to my NAS web interface and one to my Portainer interface. Both work fine when I click on them, but the status icon indicates that they're unreachable: EHOSTUNREACH 192.168.1.25:XXXX What's the nature of the difference in behavior?
robwilkerson
robwilkerson6mo ago
Yeah, I'm kind of sorting this out myself, but it makes sense to me that if the container runs as an independent host on my network and the app runs on :80 on that independent host, i wouldn't need to map ports on my host.
Manicraft1001
Manicraft10016mo ago
It means that the container can't read it. Try pinging from the container with ping, wget or curl. We cannot help that much since it depends on your network configuration.
robwilkerson
robwilkerson6mo ago
ok, so this is a side effect that I'll need to sort out. thanks for your help!
Manicraft1001
Manicraft10016mo ago
No worries, glad that it works now. Enjoy Homarr homarr
StLCards
StLCards6mo ago
I’ll try using uppercase for environment PORT and see if that makes a difference. I’m new to containers as well, seems there are idiosyncrasies to learn
Loxion
Loxion6mo ago
Would it not be a better option to put a reverse proxy (something like Nginx) in the loop? I have Homarr running as a container on an Ubuntu VM (using Portainer) on the standard port. I also have Nginx running on a seperate vm. This means I am only exposing standard http ports (mainly 443 for Https) to the internet and then the internal port is routed via Nginx to the Homarr container on the standard port. I am not an expert by any means, but its not overly complicated to setup. I pay for my own domain and use LetsEncrypt for https certification. Also means you can then make other elements accessible externally if you want to, but it all comes into your home IP on the same http/https port and just routed internally to where it needs to go/
robwilkerson
robwilkerson6mo ago
Yeah, I could do that as well, and may yet have to, but was hoping to avoid more containers. In this case, the complexity of fewer containers is starting to look worse than the complexity of more containers. So...yeah. 😄