Bad gateway errors after adding resources in Pangolin #494

Closed
opened 2025-11-13 12:02:09 -06:00 by GiteaMirror · 32 comments
Owner

Originally created by @SprMario on GitHub (Jul 16, 2025).

Hello everyone.

Today I tried adding a local resource to my Pangolin install (the first one) but I am receiving Bad Gateway errors. I installed the deployment using the official install script.

Edge server:

Newt logs (seems fine):

Image

Remote server:

Pangolin logs (no Docker socket access):

Image

Pangolin dashboard settings (site name changed for privacy):

Image

DNS record pointing to VPS correctly.

Can anyone advise me on what to check, I am bit lost to be honest.

Originally created by @SprMario on GitHub (Jul 16, 2025). Hello everyone. Today I tried adding a local resource to my Pangolin install (the first one) but I am receiving Bad Gateway errors. I installed the deployment using the official install script. ### **Edge server:** Newt logs (seems fine): <img width="370" height="57" alt="Image" src="https://github.com/user-attachments/assets/c0c6d341-59a1-4dec-a3ca-2cdf90c918ec" /> ### **Remote server:** Pangolin logs (no Docker socket access): <img width="824" height="108" alt="Image" src="https://github.com/user-attachments/assets/f1ae012c-f66f-41ab-a0a9-6b2493248431" /> Pangolin dashboard settings (site name changed for privacy): <img width="245" height="505" alt="Image" src="https://github.com/user-attachments/assets/2325b84a-cc62-4509-a334-1be3fd485bfd" /> DNS record pointing to VPS correctly. Can anyone advise me on what to check, I am bit lost to be honest.
Author
Owner

@oschwartz10612 commented on GitHub (Jul 16, 2025):

Bad gateway is typically Newt not being able to reach the target service. What target do you have programmed into the resource and are you sure newt can see it on your network?

@oschwartz10612 commented on GitHub (Jul 16, 2025): Bad gateway is typically Newt not being able to reach the target service. What target do you have programmed into the resource and are you sure newt can see it on your network?
Author
Owner

@SprMario commented on GitHub (Jul 16, 2025):

Bad gateway is typically Newt not being able to reach the target service. What target do you have programmed into the resource and are you sure newt can see it on your network?

To give you a bit more context. Pangolin on VPS with a resource made to target a dashboard on the home server. In this case I use portainer as an example. The target is a docker image(portainer) running on the home server. So newt and the target are in the same VM:
Image

Newt itself doesn't show any meaningful logs:

Image
@SprMario commented on GitHub (Jul 16, 2025): > Bad gateway is typically Newt not being able to reach the target service. What target do you have programmed into the resource and are you sure newt can see it on your network? To give you a bit more context. Pangolin on VPS with a resource made to target a dashboard on the home server. In this case I use portainer as an example. The target is a docker image(portainer) running on the home server. So newt and the target are in the same VM: <img width="336" height="141" alt="Image" src="https://github.com/user-attachments/assets/d5ef48c5-a708-46e5-a9f8-8d180dd5df9e" /> Newt itself doesn't show any meaningful logs: <img width="354" height="38" alt="Image" src="https://github.com/user-attachments/assets/eb3107f4-1261-4afd-b48f-36363da344ed" />
Author
Owner

@MorganKryze commented on GitHub (Jul 22, 2025):

Hi @SprMario

I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such:

services:
  newt:
    image: fosrl/newt
    container_name: newt
    restart: unless-stopped
    environment:
      - PANGOLIN_ENDPOINT=https://pangolin.example.xyz
      - NEWT_ID=a_super_id
      - NEWT_SECRET=a_super_secret
      - DOCKER_SOCKET=/var/run/docker.sock
    # Adding this volume will also let Newt access your docker socket and resolve your warning hopefully
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    # The container is added to the network "pangolin"
    networks:
      - pangolin

# This section creates a network called "pangolin"
networks:
  pangolin:
    name: pangolin
    driver: bridge

And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like):

services:
  filebrowser:
    image: filebrowser/filebrowser:s6
    container_name: filebrowser
    restart: unless-stopped
    # Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network
    expose:
      - 80
    volumes:
      - /some/data/folder:/srv
      - ./database:/database
      - ./config:/config
    environment:
      - PUID=1000
      - PGID=1000
    # Here this service is also added to the "pangolin" network
    networks:
      - pangolin

# We add a reference to the panolin network created earlier after having up the newt container
networks:
  pangolin:
    name: pangolin
    external: true

To sum up:

  • we set up a newt container that will create a network called pangolin (feel free to change the name if desired)
  • we added newt to this network
  • we created a container (filebrowser service) and added it to the network pangolin
  • we chose expose instead of ports to map the ports (expose is purely indicative and does not change the behavior of the container, but add clarity to your config)
  • we referenced the external network pangolin

Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our filebrowser service as http://filebrowser:80 and this will target the filebrowser container on port 80 without any issue as they are on the same network.

Here is the view on the dashboard:

Image

Care to save your changes!

I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this

@MorganKryze commented on GitHub (Jul 22, 2025): Hi @SprMario I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such: ```yaml services: newt: image: fosrl/newt container_name: newt restart: unless-stopped environment: - PANGOLIN_ENDPOINT=https://pangolin.example.xyz - NEWT_ID=a_super_id - NEWT_SECRET=a_super_secret - DOCKER_SOCKET=/var/run/docker.sock # Adding this volume will also let Newt access your docker socket and resolve your warning hopefully volumes: - /var/run/docker.sock:/var/run/docker.sock:ro # The container is added to the network "pangolin" networks: - pangolin # This section creates a network called "pangolin" networks: pangolin: name: pangolin driver: bridge ``` And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like): ```yaml services: filebrowser: image: filebrowser/filebrowser:s6 container_name: filebrowser restart: unless-stopped # Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network expose: - 80 volumes: - /some/data/folder:/srv - ./database:/database - ./config:/config environment: - PUID=1000 - PGID=1000 # Here this service is also added to the "pangolin" network networks: - pangolin # We add a reference to the panolin network created earlier after having up the newt container networks: pangolin: name: pangolin external: true ``` To sum up: - we set up a newt container that will create a network called `pangolin` (feel free to change the name if desired) - we added newt to this network - we created a container (filebrowser service) and added it to the network `pangolin` - we chose `expose` instead of `ports` to map the ports (`expose` is purely indicative and does not change the behavior of the container, but add clarity to your config) - we referenced the external network `pangolin` Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our `filebrowser` service as `http://filebrowser:80` and this will target the `filebrowser` container on port `80` without any issue as they are on the same network. Here is the view on the dashboard: <img width="1588" height="429" alt="Image" src="https://github.com/user-attachments/assets/2a90eca8-efcf-4340-b7b7-a1313b339a12" /> Care to save your changes! I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this
Author
Owner

@SprMario commented on GitHub (Jul 24, 2025):

Hi @SprMario

I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such:

services:
newt:
image: fosrl/newt
container_name: newt
restart: unless-stopped
environment:
- PANGOLIN_ENDPOINT=https://pangolin.example.xyz
- NEWT_ID=a_super_id
- NEWT_SECRET=a_super_secret
- DOCKER_SOCKET=/var/run/docker.sock
# Adding this volume will also let Newt access your docker socket and resolve your warning hopefully
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# The container is added to the network "pangolin"
networks:
- pangolin

This section creates a network called "pangolin"

networks:
pangolin:
name: pangolin
driver: bridge

And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like):

services:
filebrowser:
image: filebrowser/filebrowser:s6
container_name: filebrowser
restart: unless-stopped
# Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network
expose:
- 80
volumes:
- /some/data/folder:/srv
- ./database:/database
- ./config:/config
environment:
- PUID=1000
- PGID=1000
# Here this service is also added to the "pangolin" network
networks:
- pangolin

We add a reference to the panolin network created earlier after having up the newt container

networks:
pangolin:
name: pangolin
external: true

To sum up:

* we set up a newt container that will create a network called `pangolin` (feel free to change the name if desired)

* we added newt to this network

* we created a container (filebrowser service) and added it to the network `pangolin`

* we chose `expose` instead of `ports` to map the ports (`expose` is purely indicative and does not change the behavior of the container, but add clarity to your config)

* we referenced the external network `pangolin`

Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our filebrowser service as http://filebrowser:80 and this will target the filebrowser container on port 80 without any issue as they are on the same network.

Here is the view on the dashboard:
Image

Care to save your changes!

I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this

Thanks for the guide. I set this up using the install script. I will retry during the weekend to see where the issue is.

@SprMario commented on GitHub (Jul 24, 2025): > Hi [@SprMario](https://github.com/SprMario) > > I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such: > > services: > newt: > image: fosrl/newt > container_name: newt > restart: unless-stopped > environment: > - PANGOLIN_ENDPOINT=https://pangolin.example.xyz > - NEWT_ID=a_super_id > - NEWT_SECRET=a_super_secret > - DOCKER_SOCKET=/var/run/docker.sock > # Adding this volume will also let Newt access your docker socket and resolve your warning hopefully > volumes: > - /var/run/docker.sock:/var/run/docker.sock:ro > # The container is added to the network "pangolin" > networks: > - pangolin > > # This section creates a network called "pangolin" > networks: > pangolin: > name: pangolin > driver: bridge > > And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like): > > services: > filebrowser: > image: filebrowser/filebrowser:s6 > container_name: filebrowser > restart: unless-stopped > # Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network > expose: > - 80 > volumes: > - /some/data/folder:/srv > - ./database:/database > - ./config:/config > environment: > - PUID=1000 > - PGID=1000 > # Here this service is also added to the "pangolin" network > networks: > - pangolin > > # We add a reference to the panolin network created earlier after having up the newt container > networks: > pangolin: > name: pangolin > external: true > > To sum up: > > * we set up a newt container that will create a network called `pangolin` (feel free to change the name if desired) > > * we added newt to this network > > * we created a container (filebrowser service) and added it to the network `pangolin` > > * we chose `expose` instead of `ports` to map the ports (`expose` is purely indicative and does not change the behavior of the container, but add clarity to your config) > > * we referenced the external network `pangolin` > > > Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our `filebrowser` service as `http://filebrowser:80` and this will target the `filebrowser` container on port `80` without any issue as they are on the same network. > > Here is the view on the dashboard: > <img alt="Image" width="1588" height="429" src="https://private-user-images.githubusercontent.com/103436411/469487530-2a90eca8-efcf-4340-b7b7-a1313b339a12.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTMzNzc1MTIsIm5iZiI6MTc1MzM3NzIxMiwicGF0aCI6Ii8xMDM0MzY0MTEvNDY5NDg3NTMwLTJhOTBlY2E4LWVmY2YtNDM0MC1iN2I3LWExMzEzYjMzOWExMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNzI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDcyNFQxNzEzMzJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iM2QwOTk1ZjBhOGI4N2I3ODYzNDQ5Y2Y5NmIxMDJkMWI0ZTc4MmU3MmU5OWFkMzZlZmZmMGI0ZGViNjEwMTRmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.THPjC7w1wcHY-1fLUIdoufwiGdesxXefs-5HYl5Nxxw"> > > Care to save your changes! > > I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this Thanks for the guide. I set this up using the install script. I will retry during the weekend to see where the issue is.
Author
Owner

@MorganKryze commented on GitHub (Jul 24, 2025):

Would you share the content of your newt and portainer containers? The issue may be in their configs. A screenshot of your proxy tab from pangolin would also help us find the root of the issue.

@MorganKryze commented on GitHub (Jul 24, 2025): Would you share the content of your `newt` and `portainer` containers? The issue may be in their configs. A screenshot of your proxy tab from pangolin would also help us find the root of the issue.
Author
Owner

@SprMario commented on GitHub (Jul 27, 2025):

Hi Morgan,

The pangolin screenshot of the proxy page is:

Image

Not sure how you want me to share the content of the containers. They are made using docker, not compose.

@SprMario commented on GitHub (Jul 27, 2025): Hi Morgan, The pangolin screenshot of the proxy page is: <img width="1554" height="506" alt="Image" src="https://github.com/user-attachments/assets/2d306d48-384d-4387-b2a1-e45a948f9585" /> Not sure how you want me to share the content of the containers. They are made using docker, not compose.
Author
Owner

@MorganKryze commented on GitHub (Jul 27, 2025):

Hi @SprMario,
Thanks, can you send me the docker run commands used to start the portainer and newtcontainer (care to obfuscate the credentials if there is some). Or config page inside Portainer if so, I do not particularly know portainer and its network management.

My intent here is to see what is the network configuration of your containers. My suggestion would be to create a pangolin or newt (whatever you may want to call it) network and put your containers onto it so that they can communicate between each other flawlessly. Plus that brings a feature letting us call service by internal DNS addresses like : http://filebrowser:80 or http://portainer:9000.

Note: if you intend to expose your Portainer service, please make sure to limit access to the domain with the Authentication tab.

@MorganKryze commented on GitHub (Jul 27, 2025): Hi @SprMario, Thanks, can you send me the `docker run` commands used to start the `portainer` and `newt`container (care to obfuscate the credentials if there is some). Or config page inside Portainer if so, I do not particularly know portainer and its network management. My intent here is to see what is the network configuration of your containers. My suggestion would be to create a `pangolin` or `newt` (whatever you may want to call it) network and put your containers onto it so that they can communicate between each other flawlessly. Plus that brings a feature letting us call service by internal DNS addresses like : `http://filebrowser:80` or `http://portainer:9000`. Note: if you intend to expose your Portainer service, please make sure to limit access to the domain with the `Authentication` tab.
Author
Owner

@SprMario commented on GitHub (Jul 27, 2025):

Hi @SprMario, Thanks, can you send me the docker run commands used to start the portainer and newtcontainer (care to obfuscate the credentials if there is some). Or config page inside Portainer if so, I do not particularly know portainer and its network management.

My intent here is to see what is the network configuration of your containers. My suggestion would be to create a pangolin or newt (whatever you may want to call it) network and put your containers onto it so that they can communicate between each other flawlessly. Plus that brings a feature letting us call service by internal DNS addresses like : http://filebrowser:80 or http://portainer:9000.

Note: if you intend to expose your Portainer service, please make sure to limit access to the domain with the Authentication tab.

Hi @MorganKryze ,

Here is Portainer:
docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts

For newt I used the automatic install script of pangolin, I dont really know how that was executed. I can inspect the image if you want?

@SprMario commented on GitHub (Jul 27, 2025): > Hi [@SprMario](https://github.com/SprMario), Thanks, can you send me the `docker run` commands used to start the `portainer` and `newt`container (care to obfuscate the credentials if there is some). Or config page inside Portainer if so, I do not particularly know portainer and its network management. > > My intent here is to see what is the network configuration of your containers. My suggestion would be to create a `pangolin` or `newt` (whatever you may want to call it) network and put your containers onto it so that they can communicate between each other flawlessly. Plus that brings a feature letting us call service by internal DNS addresses like : `http://filebrowser:80` or `http://portainer:9000`. > > Note: if you intend to expose your Portainer service, please make sure to limit access to the domain with the `Authentication` tab. Hi @MorganKryze , Here is Portainer: `docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts` For newt I used the automatic install script of pangolin, I dont really know how that was executed. I can inspect the image if you want?
Author
Owner

@MorganKryze commented on GitHub (Jul 27, 2025):

First, my guess would be to uninstall newt from your machine as you used the script as it will not be convenient to update its configuration over the time.

If you want to stay with docker run commands, here would be the updated commands to run:

  • docker network create --driver bridge pangolin: create the pangolin network
  • docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --network pangolin portainer/portainer-ce:lts: run portainer in the new network (note that you may remove the -p 9443:9443 if you intend to only use pangolin as a reverse proxy targeting port 9000)

Finally, for newt, care to replace the variables to your own:

docker run -d \
  --name newt \
  --restart unless-stopped \
  -e PANGOLIN_ENDPOINT=https://pangolin.example.xyz \
  -e NEWT_ID=a_super_id \
  -e NEWT_SECRET=a_super_secret \
  -e DOCKER_SOCKET=/var/run/docker.sock \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  --network pangolin \
  fosrl/newt

Later, once you see that your site is online on the site tab, go to the resources tab and replace the ip address 192.168.178.110 of your machine by portainer as I have shown in my first pangolin capture.

Hopefully, that should resolve your issue

@MorganKryze commented on GitHub (Jul 27, 2025): First, my guess would be to uninstall newt from your machine as you used the script as it will not be convenient to update its configuration over the time. If you want to stay with `docker run` commands, here would be the updated commands to run: - `docker network create --driver bridge pangolin`: create the pangolin network - `docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --network pangolin portainer/portainer-ce:lts`: run portainer in the new network (note that you may remove the `-p 9443:9443` if you intend to only use pangolin as a reverse proxy targeting port 9000) Finally, for newt, care to replace the variables to your own: ```bash docker run -d \ --name newt \ --restart unless-stopped \ -e PANGOLIN_ENDPOINT=https://pangolin.example.xyz \ -e NEWT_ID=a_super_id \ -e NEWT_SECRET=a_super_secret \ -e DOCKER_SOCKET=/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock:ro \ --network pangolin \ fosrl/newt ``` Later, once you see that your site is online on the site tab, go to the resources tab and replace the ip address `192.168.178.110` of your machine by `portainer` as I have shown in my first pangolin capture. Hopefully, that should resolve your issue
Author
Owner

@MorganKryze commented on GitHub (Aug 3, 2025):

Hey @SprMario,

Could you get your service to work?

@MorganKryze commented on GitHub (Aug 3, 2025): Hey @SprMario, Could you get your service to work?
Author
Owner

@SprMario commented on GitHub (Aug 4, 2025):

No I didn't. I am going to abandon getting this to work.

@SprMario commented on GitHub (Aug 4, 2025): No I didn't. I am going to abandon getting this to work.
Author
Owner

@MorganKryze commented on GitHub (Aug 6, 2025):

Sorry to hear that, would you describe the issue you are facing, provide some logs, context?

@MorganKryze commented on GitHub (Aug 6, 2025): Sorry to hear that, would you describe the issue you are facing, provide some logs, context?
Author
Owner

@SprMario commented on GitHub (Aug 6, 2025):

The issue is in the first post. I get bad gateway errors. I did not rebuild everything as you suggested in your response, I re-ran the install script from Pangolin and restarted all the services. Didnt work > uninstall.

@SprMario commented on GitHub (Aug 6, 2025): The issue is in the first post. I get bad gateway errors. I did not rebuild everything as you suggested in your response, I re-ran the install script from Pangolin and restarted all the services. Didnt work > uninstall.
Author
Owner

@Lokowitz commented on GitHub (Aug 6, 2025):

Hi @SprMario

Portainer UI is listening on https and port 9443.
So if you want to access the Portainer Ui you have to change it in your pangolin target, currently i see http and port 9000 in your post.
Portainer documentation

@Lokowitz commented on GitHub (Aug 6, 2025): Hi @SprMario Portainer UI is listening on https and port 9443. So if you want to access the Portainer Ui you have to change it in your pangolin target, currently i see http and port 9000 in your [post](https://github.com/fosrl/pangolin/issues/1070#issuecomment-3124287677). [Portainer documentation](https://docs.portainer.io/start/install-ce/server/docker/linux#logging-in)
Author
Owner

@SprMario commented on GitHub (Aug 6, 2025):

Hi @SprMario

Portainer UI is listening on https and port 9443. So if you want to access the Portainer Ui you have to change it in your pangolin target, currently i see http and port 9000 in your post. Portainer documentation

You're right. I tried both ports as portainer listens to 9000 for http and adjusted to 9443 for https, bad gateway when I tried.

@SprMario commented on GitHub (Aug 6, 2025): > Hi [@SprMario](https://github.com/SprMario) > > Portainer UI is listening on https and port 9443. So if you want to access the Portainer Ui you have to change it in your pangolin target, currently i see http and port 9000 in your [post](https://github.com/fosrl/pangolin/issues/1070#issuecomment-3124287677). [Portainer documentation](https://docs.portainer.io/start/install-ce/server/docker/linux#logging-in) You're right. I tried both ports as portainer listens to 9000 for http and adjusted to 9443 for https, bad gateway when I tried.
Author
Owner

@Lokowitz commented on GitHub (Aug 6, 2025):

Just tried it with my server and it is working.

So could you please double check:

  • Port 80 and 443 is open on vps firewall (server with pangolin installation)
  • 192.168.178.110 is the ip of your local machine running portainer (use ip a to check)
  • you have a wildcard A record for your domain pointing to your vps (*.your.domain -> vps ip) -> just had this issue that i used the domain which is pointing to my home and not to the vps)

Did you tried to reach other sites or services or is portainer the only one?

@Lokowitz commented on GitHub (Aug 6, 2025): Just tried it with my server and it is working. So could you please double check: - Port 80 and 443 is open on vps firewall (server with pangolin installation) - 192.168.178.110 is the ip of your local machine running portainer (use `ip a` to check) - you have a wildcard A record for your domain pointing to your vps (*.your.domain -> vps ip) -> just had this issue that i used the domain which is pointing to my home and not to the vps) Did you tried to reach other sites or services or is portainer the only one?
Author
Owner

@oschwartz10612 commented on GitHub (Aug 6, 2025):

^^^ this is all good to check. I do suspect usually bad gateway comes
means you are at least getting to pangolin and through traefik.

Double check the IP info and that its reachable from where newt is
installed. You could do a curl command to test!

Also this has tripped me up a couple of times and its super stupid haha:
Make sure you have the resource on the right site!

You can see the newt logs and if it cant make it to portainer you should
see some errors.

@oschwartz10612 commented on GitHub (Aug 6, 2025): ^^^ this is all good to check. I do suspect usually bad gateway comes means you are at least getting to pangolin and through traefik. Double check the IP info and that its reachable from where newt is installed. You could do a curl command to test! Also this has tripped me up a couple of times and its super stupid haha: Make sure you have the resource on the right site! You can see the newt logs and if it cant make it to portainer you should see some errors.
Author
Owner

@mvkotowski commented on GitHub (Aug 6, 2025):

Hi @SprMario

I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such:

services:
newt:
image: fosrl/newt
container_name: newt
restart: unless-stopped
environment:
- PANGOLIN_ENDPOINT=https://pangolin.example.xyz
- NEWT_ID=a_super_id
- NEWT_SECRET=a_super_secret
- DOCKER_SOCKET=/var/run/docker.sock
# Adding this volume will also let Newt access your docker socket and resolve your warning hopefully
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# The container is added to the network "pangolin"
networks:
- pangolin

This section creates a network called "pangolin"

networks:
pangolin:
name: pangolin
driver: bridge

And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like):

services:
filebrowser:
image: filebrowser/filebrowser:s6
container_name: filebrowser
restart: unless-stopped
# Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network
expose:
- 80
volumes:
- /some/data/folder:/srv
- ./database:/database
- ./config:/config
environment:
- PUID=1000
- PGID=1000
# Here this service is also added to the "pangolin" network
networks:
- pangolin

We add a reference to the panolin network created earlier after having up the newt container

networks:
pangolin:
name: pangolin
external: true

To sum up:

* we set up a newt container that will create a network called `pangolin` (feel free to change the name if desired)

* we added newt to this network

* we created a container (filebrowser service) and added it to the network `pangolin`

* we chose `expose` instead of `ports` to map the ports (`expose` is purely indicative and does not change the behavior of the container, but add clarity to your config)

* we referenced the external network `pangolin`

Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our filebrowser service as http://filebrowser:80 and this will target the filebrowser container on port 80 without any issue as they are on the same network.

Here is the view on the dashboard:
Image

Care to save your changes!

I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this

I am experiencing sporadic Bad Gateway error messages whenever I try to add a new stack to portainer, but can access it through legacy 9000 port. I will report back on what my logs are saying and implementing your guide for network. Guacamole is also kicking me out. I initially thought it was Home Assistant getting paired with Pangolin, but after I removed it, the errors persisted. It was not this bad at initial install.

Edit 3: ports are opened:

Image

Edit 4: Tinyfiles gives the same bad gateway error, but refreshing page gets me back in.
Edit 5: Still experiencing the gateway issues even after using your format

Image

Edit 6: The only container doing anything interesting is the newt container and the gerbil container. It reconnects every minute after the following error from newt. Gerbil is simply adding and removing the same peer successfully.

Image

Edit 7: Got it Fixed!!

Image

@mvkotowski commented on GitHub (Aug 6, 2025): > Hi [@SprMario](https://github.com/SprMario) > > I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such: > > services: > newt: > image: fosrl/newt > container_name: newt > restart: unless-stopped > environment: > - PANGOLIN_ENDPOINT=https://pangolin.example.xyz > - NEWT_ID=a_super_id > - NEWT_SECRET=a_super_secret > - DOCKER_SOCKET=/var/run/docker.sock > # Adding this volume will also let Newt access your docker socket and resolve your warning hopefully > volumes: > - /var/run/docker.sock:/var/run/docker.sock:ro > # The container is added to the network "pangolin" > networks: > - pangolin > > # This section creates a network called "pangolin" > networks: > pangolin: > name: pangolin > driver: bridge > > And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like): > > services: > filebrowser: > image: filebrowser/filebrowser:s6 > container_name: filebrowser > restart: unless-stopped > # Here we choose to use "expose" instead of "ports" so we just tell that the container will expose a service on its port 80 on our network > expose: > - 80 > volumes: > - /some/data/folder:/srv > - ./database:/database > - ./config:/config > environment: > - PUID=1000 > - PGID=1000 > # Here this service is also added to the "pangolin" network > networks: > - pangolin > > # We add a reference to the panolin network created earlier after having up the newt container > networks: > pangolin: > name: pangolin > external: true > > To sum up: > > * we set up a newt container that will create a network called `pangolin` (feel free to change the name if desired) > > * we added newt to this network > > * we created a container (filebrowser service) and added it to the network `pangolin` > > * we chose `expose` instead of `ports` to map the ports (`expose` is purely indicative and does not change the behavior of the container, but add clarity to your config) > > * we referenced the external network `pangolin` > > > Now that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our `filebrowser` service as `http://filebrowser:80` and this will target the `filebrowser` container on port `80` without any issue as they are on the same network. > > Here is the view on the dashboard: > <img alt="Image" width="1588" height="429" src="https://private-user-images.githubusercontent.com/103436411/469487530-2a90eca8-efcf-4340-b7b7-a1313b339a12.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTQ1MjM5MjgsIm5iZiI6MTc1NDUyMzYyOCwicGF0aCI6Ii8xMDM0MzY0MTEvNDY5NDg3NTMwLTJhOTBlY2E4LWVmY2YtNDM0MC1iN2I3LWExMzEzYjMzOWExMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwODA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDgwNlQyMzQwMjhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MmNjZmRmMDQ3MWFjNTBhYjM5OTcyMmQ2NDNhOGVjMGE2MTRjNjk1NWQ2NmFiNzczZjdkODliZTAxMzhhNDQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Ckhw4fDDBQR89nROR9mVkaCHS0VKZoVMO34LaO9UGgg"> > > Care to save your changes! > > I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this I am experiencing sporadic Bad Gateway error messages whenever I try to add a new stack to portainer, but can access it through legacy 9000 port. I will report back on what my logs are saying and implementing your guide for network. Guacamole is also kicking me out. I initially thought it was Home Assistant getting paired with Pangolin, but after I removed it, the errors persisted. It was not this bad at initial install. Edit 3: ports are opened: <img width="902" height="131" alt="Image" src="https://github.com/user-attachments/assets/d04033b1-bf8b-4070-ae17-e310c2f09759" /> Edit 4: Tinyfiles gives the same bad gateway error, but refreshing page gets me back in. Edit 5: Still experiencing the gateway issues even after using your format <img width="1502" height="581" alt="Image" src="https://github.com/user-attachments/assets/27892175-e97c-43c2-9172-e0134e2772c1" /> Edit 6: The only container doing anything interesting is the newt container and the gerbil container. It reconnects every minute after the following error from newt. Gerbil is simply adding and removing the same peer successfully. <img width="1117" height="79" alt="Image" src="https://github.com/user-attachments/assets/b4cde460-e6db-4ab9-ba66-f77ff6468f7e" /> Edit 7: Got it Fixed!! ![Image](https://github.com/user-attachments/assets/63fefcdd-651e-485c-8932-cc0b18bd4d5f)
Author
Owner

@SprMario commented on GitHub (Aug 8, 2025):

Just tried it with my server and it is working.

So could you please double check:

* Port 80 and 443 is open on vps firewall (server with pangolin installation)

* 192.168.178.110 is the ip of your local machine running portainer (use `ip a` to check)

* you have a wildcard A record for your domain pointing to your vps (*.your.domain -> vps ip) -> just had this issue that i used the domain which is pointing to my home and not to the vps)

Did you tried to reach other sites or services or is portainer the only one?

  • Firewall rules:
Image
  • Portainer IP:
Image
  • Domain wildcard:
Image

Currently I only had portainer installed as a test, I will try bitwarden as an example next.

@SprMario commented on GitHub (Aug 8, 2025): > Just tried it with my server and it is working. > > So could you please double check: > > * Port 80 and 443 is open on vps firewall (server with pangolin installation) > > * 192.168.178.110 is the ip of your local machine running portainer (use `ip a` to check) > > * you have a wildcard A record for your domain pointing to your vps (*.your.domain -> vps ip) -> just had this issue that i used the domain which is pointing to my home and not to the vps) > > > Did you tried to reach other sites or services or is portainer the only one? - Firewall rules: <img width="924" height="371" alt="Image" src="https://github.com/user-attachments/assets/fa5ef5e3-7bfe-4beb-a088-da06476ee894" /> - Portainer IP: <img width="465" height="416" alt="Image" src="https://github.com/user-attachments/assets/586ba03d-b2c4-41b1-9ea3-e8a7471e97f9" /> - Domain wildcard: <img width="814" height="89" alt="Image" src="https://github.com/user-attachments/assets/4eecaf40-87f3-4341-be8c-37acb3541da1" /> Currently I only had portainer installed as a test, I will try bitwarden as an example next.
Author
Owner

@SprMario commented on GitHub (Aug 8, 2025):

^^^ this is all good to check. I do suspect usually bad gateway comes
means you are at least getting to pangolin and through traefik.

Double check the IP info and that its reachable from where newt is
installed. You could do a curl command to test!

Also this has tripped me up a couple of times and its super stupid haha:
Make sure you have the resource on the right site!

You can see the newt logs and if it cant make it to portainer you should
see some errors.

I remade the configuration and these suggestions are checked.

I am going to use Vaultwarden as example with the newt configuration from @MorganKryze

@SprMario commented on GitHub (Aug 8, 2025): > ^^^ this is all good to check. I do suspect usually bad gateway comes > means you are at least getting to pangolin and through traefik. > > Double check the IP info and that its reachable from where newt is > installed. You could do a curl command to test! > > Also this has tripped me up a couple of times and its super stupid haha: > Make sure you have the resource on the right site! > > You can see the newt logs and if it cant make it to portainer you should > see some errors. I remade the configuration and these suggestions are checked. I am going to use Vaultwarden as example with the newt configuration from @MorganKryze
Author
Owner

@SprMario commented on GitHub (Aug 8, 2025):

Hi all,

Today I REMADE the Pangolin installation using this install script:

https://docs.digpangolin.com/self-host/quick-install

Everything went well on the VPS:

Image Seems good 💃

Install newt on edge server and check logs:

Image

Image Seems good 💃

Try to reach Pangolin site.
This includes reaching Pangolin from external network(connecing from work):

Image Seems good 💃

Install Vaultwarden on port 8080:

Image Seems good 💃

Docker compose for BW using port 8080, expose didn't do anything:
Image Seems good 💃

Resources added in Pangolin:

Image Seems good 💃

Let's check the result:

Image Oh no, the same thing happened as before 👎

I decided to do this again so that it might help someone else in the future but I deployed Tailscale within an hour. Troubleshoot this has been a hell.

@mvkotowski here is the link you made a screenshot of:
https://github.com/fosrl/pangolin/issues/1070#issuecomment-3105131178

@SprMario commented on GitHub (Aug 8, 2025): Hi all, Today I REMADE the Pangolin installation using this install script: https://docs.digpangolin.com/self-host/quick-install Everything went well on the VPS: <img width="230" height="200" alt="Image" src="https://github.com/user-attachments/assets/9a43957d-863a-4c61-9cc3-d7e3aa9d1804" /> Seems good 💃 Install newt on edge server and check logs: <img width="430" height="432" alt="Image" src="https://github.com/user-attachments/assets/156d0b32-92cc-4d93-a766-c72f7e2d61b0" /> <img width="552" height="58" alt="Image" src="https://github.com/user-attachments/assets/0d5f3100-ad34-4573-877a-8a6331471bac" /> Seems good 💃 Try to reach Pangolin site. This includes reaching Pangolin from external network(connecing from work): <img width="258" height="102" alt="Image" src="https://github.com/user-attachments/assets/0ae4aa41-e7d3-479f-9804-1f2114a99d81" /> Seems good 💃 Install Vaultwarden on port 8080: <img width="437" height="123" alt="Image" src="https://github.com/user-attachments/assets/97032958-82d6-4020-b517-bc71b485ee31" /> Seems good 💃 Docker compose for BW using port 8080, expose didn't do anything: <img width="389" height="333" alt="Image" src="https://github.com/user-attachments/assets/e7ce1e4a-50c6-41f2-9c96-cf640883aef1" /> Seems good 💃 Resources added in Pangolin: <img width="561" height="477" alt="Image" src="https://github.com/user-attachments/assets/b66d673a-bc70-497b-b849-9159ba05b3a6" /> Seems good 💃 Let's check the result: <img width="219" height="120" alt="Image" src="https://github.com/user-attachments/assets/2521d8e9-44bc-45e5-9114-809c176bd99b" /> Oh no, the same thing happened as before 👎 I decided to do this again so that it might help someone else in the future but I deployed Tailscale within an hour. Troubleshoot this has been a hell. @mvkotowski here is the link you made a screenshot of: https://github.com/fosrl/pangolin/issues/1070#issuecomment-3105131178
Author
Owner

@MorganKryze commented on GitHub (Aug 8, 2025):

Thanks for all the efforts @SprMario !!

But before closing this issue, I described using docker DNS: as you newt and your vaultwarden are on the same subnetwork pangolin, you will need to use the address: vaultwarden 80 on the Pangolin dashboard !

You used:

ports:
  - 8080:80

Instead of:

expose:
  - 80

ports will route the port outside the subnetwork to the docker host. That is why you can access is using http://your-ip:8080 which you should not be able to. expose will tell docker on which port the container runs, but will not get anything out of it, we want the container to be accessed by newt, not on your local network, so an SSL cert can be applied to your connection for instance.

So:

  • just change the ports block to expose as shown earlier;
  • and on the pangolin dashboard route the proxy to vaultwarden (the container_name) and port 80 (where vaultwarden is exposing inside its container).

That should solve your issue!
Let me know if that helped, but we are clooose

@MorganKryze commented on GitHub (Aug 8, 2025): Thanks for all the efforts @SprMario !! But before closing this issue, I described using docker DNS: as you newt and your vaultwarden are on the same subnetwork `pangolin`, you will need to use the address: `vaultwarden` `80` on the Pangolin dashboard ! You used: ```yaml ports: - 8080:80 ``` Instead of: ```yaml expose: - 80 ``` `ports` will route the port outside the subnetwork to the docker host. That is why you can access is using `http://your-ip:8080` which you should not be able to. `expose` will tell docker on which port the container runs, but will not get anything out of it, we want the container to be accessed by newt, not on your local network, so an SSL cert can be applied to your connection for instance. So: - just change the `ports` block to `expose` as shown earlier; - and on the pangolin dashboard route the proxy to `vaultwarden` (the container_name) and port `80` (where vaultwarden is exposing inside its container). That should solve your issue! Let me know if that helped, but we are clooose
Author
Owner

@mvkotowski commented on GitHub (Aug 8, 2025):

@SprMario Sorry for being lazy. You're right and thank you for linking the screenshot link. I had hoped that changing the nomenclature to use the container names to link to proxy would have solved the bad gateway issue. So far only compose down and up seem to calm down the issue for a little while.

@miloschwartz I can confirm that the issue persists and have done the Cloudflare DNS check and port check, and am willing to help continue to troubleshoot this. I reflashed the vps yesterday and updated traefik to 3.5 and the issue seems less prevalent but still there. Maybe it's something to do with my setup at the site level? There are some things that I am not well versed enough in yet. What else can I provide to help?

@mvkotowski commented on GitHub (Aug 8, 2025): @SprMario Sorry for being lazy. You're right and thank you for linking the screenshot link. I had hoped that changing the nomenclature to use the container names to link to proxy would have solved the bad gateway issue. So far only compose down and up seem to calm down the issue for a little while. @miloschwartz I can confirm that the issue persists and have done the Cloudflare DNS check and port check, and am willing to help continue to troubleshoot this. I reflashed the vps yesterday and updated traefik to 3.5 and the issue seems less prevalent but still there. Maybe it's something to do with my setup at the site level? There are some things that I am not well versed enough in yet. What else can I provide to help?
Author
Owner

@MorganKryze commented on GitHub (Aug 8, 2025):

@mvkotowski Would you share sample of the stacks you are trying to deploy?

My guess is that you are also bridging the ports outside the docker subnetwork, thus making them available on your local network which cannot be routed through newt. My setup isolates the services to be routed only by newt to avoid local http connections and substitute ip addresses as target to container names which is more friendly on ip change (even if you change network configuration on the pangolin subnetwork).

If you want your services to be accessible on your local network using http, you may need to change my configuration though.

Will be happy to help with the necessary data to debug

@MorganKryze commented on GitHub (Aug 8, 2025): @mvkotowski Would you share sample of the stacks you are trying to deploy? My guess is that you are also bridging the ports outside the docker subnetwork, thus making them available on your local network which cannot be routed through newt. My setup isolates the services to be routed only by newt to avoid local http connections and substitute ip addresses as target to container names which is more friendly on ip change (even if you change network configuration on the `pangolin` subnetwork). If you want your services to be accessible on your local network using http, you may need to change my configuration though. Will be happy to help with the necessary data to debug
Author
Owner

@mvkotowski commented on GitHub (Aug 8, 2025):

@MorganKryze

services:
  portainer-ce:
    expose:
      - 9443
    container_name: portainer
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /some-directory:/data
    image: portainer/portainer-ce:lts
    networks:
      - pangolin
networks:
  pangolin:
    name: pangolin
    external: true

One thing that I had a question about.. I didn't change the defaults for the subnet or the IP Address of the site. Does that need to be changed and to what? I'm not entirely sure which IP address it's asking for. Is it asking for the IP address of the device on my local network?

Image
@mvkotowski commented on GitHub (Aug 8, 2025): @MorganKryze ``` services: portainer-ce: expose: - 9443 container_name: portainer restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock - /some-directory:/data image: portainer/portainer-ce:lts networks: - pangolin networks: pangolin: name: pangolin external: true ``` One thing that I had a question about.. I didn't change the defaults for the subnet or the IP Address of the site. Does that need to be changed and to what? I'm not entirely sure which IP address it's asking for. Is it asking for the IP address of the device on my local network? <img width="1575" height="185" alt="Image" src="https://github.com/user-attachments/assets/268bd7bc-dab2-49cf-b929-db9ce177d130" />
Author
Owner

@MorganKryze commented on GitHub (Aug 8, 2025):

@MorganKryze

services:
  portainer-ce:
    expose:
      - 9443
    container_name: portainer
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /some-directory:/data
    image: portainer/portainer-ce:lts
    networks:
      - pangolin
networks:
  pangolin:
    name: pangolin
    external: true

One thing that I had a question about.. I didn't change the defaults for the subnet or the IP Address of the site. Does that need to be changed and to what? I'm not entirely sure which IP address it's asking for. Is it asking for the IP address of the device on my local network?
Image

So, with this configuration and a target proxy on the pangolin dashboard set to: https portainer 9443 you are having a bad gateway? Are your certs valid?

I would not recommend changing the address ip of the site. It is a generated ip address for your site itself to route traffic correctly. On this topic I am no expert though. I am having a correct setup with multiple working sites, and did not change these addresses once.

@MorganKryze commented on GitHub (Aug 8, 2025): > [@MorganKryze](https://github.com/MorganKryze) > > ``` > services: > portainer-ce: > expose: > - 9443 > container_name: portainer > restart: always > volumes: > - /var/run/docker.sock:/var/run/docker.sock > - /some-directory:/data > image: portainer/portainer-ce:lts > networks: > - pangolin > networks: > pangolin: > name: pangolin > external: true > ``` > > One thing that I had a question about.. I didn't change the defaults for the subnet or the IP Address of the site. Does that need to be changed and to what? I'm not entirely sure which IP address it's asking for. Is it asking for the IP address of the device on my local network? > <img alt="Image" width="1575" height="185" src="https://private-user-images.githubusercontent.com/187559125/476109499-268bd7bc-dab2-49cf-b929-db9ce177d130.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTQ2NzI4MTYsIm5iZiI6MTc1NDY3MjUxNiwicGF0aCI6Ii8xODc1NTkxMjUvNDc2MTA5NDk5LTI2OGJkN2JjLWRhYjItNDljZi1iOTI5LWRiOWNlMTc3ZDEzMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwODA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDgwOFQxNzAxNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYzMxYzM1MWNiYjRjOGUyZGI4OTgxMzljZTg4YzQ1NGRhNWFlNjJiZGUwMDgxNTc5MTQyYzg4NDliM2EwYzBjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.fJcyr02qiiwUMF7_OhGzfn2qFzI5vY5KfMeaj_Hrces"> So, with this configuration and a target proxy on the pangolin dashboard set to: `https` `portainer` `9443` you are having a bad gateway? Are your certs valid? I would not recommend changing the address ip of the site. It is a generated ip address for your site itself to route traffic correctly. On this topic I am no expert though. I am having a correct setup with multiple working sites, and did not change these addresses once.
Author
Owner

@SprMario commented on GitHub (Aug 8, 2025):

Thanks for all the efforts @SprMario !!

But before closing this issue, I described using docker DNS: as you newt and your vaultwarden are on the same subnetwork pangolin, you will need to use the address: vaultwarden 80 on the Pangolin dashboard !

You used:

ports:

  • 8080:80

Instead of:

expose:

  • 80

ports will route the port outside the subnetwork to the docker host. That is why you can access is using http://your-ip:8080 which you should not be able to. expose will tell docker on which port the container runs, but will not get anything out of it, we want the container to be accessed by newt, not on your local network, so an SSL cert can be applied to your connection for instance.

So:

* just change the `ports` block to `expose` as shown earlier;

* and on the pangolin dashboard route the proxy to `vaultwarden` (the container_name) and port `80` (where vaultwarden is exposing inside its container).

That should solve your issue! Let me know if that helped, but we are clooose

@MorganKryze I am sending a virtual beer to your location. This works however I cant make sense why because of my bad routing skills. To me approaching something within the network from the same network should not be unapproachable. I am going to dive into docker networking a little more.

I would like to understand if my thought process was off, is there anything I should be thinking differently about?

End result:


services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    volumes:
      - /home/mario/docker-compose/bw/:/data/
    expose:
      - 80
    networks:
      - pangolin
      
networks:
  pangolin:
    name: pangolin
    external: true

And the resources:

Image
@SprMario commented on GitHub (Aug 8, 2025): > Thanks for all the efforts [@SprMario](https://github.com/SprMario) !! > > But before closing this issue, I described using docker DNS: as you newt and your vaultwarden are on the same subnetwork `pangolin`, you will need to use the address: `vaultwarden` `80` on the Pangolin dashboard ! > > You used: > > ports: > - 8080:80 > > Instead of: > > expose: > - 80 > > `ports` will route the port outside the subnetwork to the docker host. That is why you can access is using `http://your-ip:8080` which you should not be able to. `expose` will tell docker on which port the container runs, but will not get anything out of it, we want the container to be accessed by newt, not on your local network, so an SSL cert can be applied to your connection for instance. > > So: > > * just change the `ports` block to `expose` as shown earlier; > > * and on the pangolin dashboard route the proxy to `vaultwarden` (the container_name) and port `80` (where vaultwarden is exposing inside its container). > > > That should solve your issue! Let me know if that helped, but we are clooose @MorganKryze I am sending a virtual beer to your location. This works however I cant make sense why because of my bad routing skills. To me approaching something within the network from the same network should not be unapproachable. I am going to dive into docker networking a little more. I would like to understand if my thought process was off, is there anything I should be thinking differently about? End result: ``` services: vaultwarden: image: vaultwarden/server:latest container_name: vaultwarden restart: unless-stopped volumes: - /home/mario/docker-compose/bw/:/data/ expose: - 80 networks: - pangolin networks: pangolin: name: pangolin external: true ``` And the resources: <img width="1259" height="106" alt="Image" src="https://github.com/user-attachments/assets/d7e3583d-1cbc-414d-8303-6026736acf2c" />
Author
Owner

@mvkotowski commented on GitHub (Aug 8, 2025):

So, with this configuration and a target proxy on the pangolin dashboard set to: https portainer 9443 you are having a bad gateway? Are your certs valid?

I would not recommend changing the address ip of the site. It is a generated ip address for your site itself to route traffic correctly. On this topic I am no expert though. I am having a correct setup with multiple working sites, and did not change these addresses once.

No wonder it was upset. I had routed portainer to http portainer 9000 because of the http error it gives when you leave it default.
Sorry for the question, but how do I check my certs?

Thank you so much for your help again! I am also running close to 70 services as well and it works, the bad gateway messages are sporadic and only on certain requests.

@mvkotowski commented on GitHub (Aug 8, 2025): > So, with this configuration and a target proxy on the pangolin dashboard set to: `https` `portainer` `9443` you are having a bad gateway? Are your certs valid? > > I would not recommend changing the address ip of the site. It is a generated ip address for your site itself to route traffic correctly. On this topic I am no expert though. I am having a correct setup with multiple working sites, and did not change these addresses once. No wonder it was upset. I had routed portainer to `http` `portainer` `9000` because of the http error it gives when you leave it default. Sorry for the question, but how do I check my certs? Thank you so much for your help again! I am also running close to 70 services as well and it works, the bad gateway messages are sporadic and only on certain requests.
Author
Owner

@MorganKryze commented on GitHub (Aug 8, 2025):

I'm so glad that you could both make it work!

I'll be coming back on this with hand-crafted diagram.

Happy tinkering homelabbing fella!

@MorganKryze commented on GitHub (Aug 8, 2025): I'm so glad that you could both make it work! I'll be coming back on this with hand-crafted diagram. Happy tinkering homelabbing fella!
Author
Owner

@MorganKryze commented on GitHub (Aug 9, 2025):

Just to be clear, I am not expert, and may not give you the best explanation out there, I definitely recommend you to check pro videos like these:

The following diagrams show both approaches that you can adopt. To be consistent with my first message, we will try to route a filebrowser container, but you can replace it with whatever service you may want.

First, we run the containers without subnets on your local network. To be accessible to your laptop and your newt container, your filebrowser needs to be accessible to your local network and so, you expose the port 80 outside the container and port it to your server:

ports:
  - 80:80

If the local IP of our server is 192.168.1.11, then we should route the service in the pangolin dashboard to http 192.168.1.11 80. If your laptop is connected on the same network, you should be able to connect to http://192.168.1.11:80.

Image

Alternatively, we create a pangolin network, a subnet inside our server. We attach our filebrowser and newt container to this network to allow them to interact with each other, but preventing devices from your local network to access them. This was to me a security measure that I wanted to set up to force users that want to access my service to go through my domain and https connections. As both our containers are on the same network, we do not need the directive ports: in the compose.yml file.

But, what we require is to know filebrowser IP address inside the subnetwork. To facilitate this step, we use a stable resolving method using the container_name: directive to define a custom hostname. This way, containers in your subnetwork would be able to resolve your service IP using their container name: newt can access filbrowser at http://filebrowser:80. The expose: directive is optional as this directive has no effect on the container behavior but let the user know what is going on.

expose:
  - 80

So, you would do the same on the pangolin dashboard and route traffic to: http filebrowser 80. In case that your service is creating self-signed certificates, choose https, pangolin will not override those and be able to route traffic correctly. I said earlier to check if they are valid, what I meant was trying in local to connect to your service and see if your browser indicates that the certificates are flagged as "self-signed" which they regularly warn you about, or if they happen to flag them as "invalid". I would not be able to elaborate, this is rather empiric observations.

Image

Let me know if any of these have helped you,
Cheers

@MorganKryze commented on GitHub (Aug 9, 2025): Just to be clear, I am not expert, and may not give you the best explanation out there, I definitely recommend you to check pro videos like these: - <https://www.youtube.com/watch?v=gk_kHgNhJVo> - <https://www.youtube.com/watch?v=bKFMS5C4CG0> The following diagrams show both approaches that you can adopt. To be consistent with my first message, we will try to route a `filebrowser` container, but you can replace it with whatever service you may want. First, we run the containers without subnets on your local network. To be accessible to your laptop and your `newt` container, your `filebrowser` needs to be accessible to your local network and so, you expose the port `80` outside the container and port it to your server: ```yaml ports: - 80:80 ``` If the local IP of our server is `192.168.1.11`, then we should route the service in the pangolin dashboard to `http` `192.168.1.11` `80`. If your laptop is connected on the same network, you should be able to connect to <http://192.168.1.11:80>. <img width="1801" height="667" alt="Image" src="https://github.com/user-attachments/assets/f11be8ec-312e-4259-a260-6f89966900f3" /> Alternatively, we create a `pangolin` network, a subnet inside our server. We attach our `filebrowser` and `newt` container to this network to allow them to interact with each other, but preventing devices from your local network to access them. This was to me a security measure that I wanted to set up to force users that want to access my service to go through my domain and `https` connections. As both our containers are on the same network, we do not need the directive `ports:` in the `compose.yml` file. But, what we require is to know `filebrowser` IP address inside the subnetwork. To facilitate this step, we use a stable resolving method using the `container_name:` directive to define a custom hostname. This way, containers in your subnetwork would be able to resolve your service IP using their container name: `newt` can access `filbrowser` at `http://filebrowser:80`. The `expose:` directive is optional as this directive has no effect on the container behavior but let the user know what is going on. ```yaml expose: - 80 ``` So, you would do the same on the pangolin dashboard and route traffic to: `http` `filebrowser` `80`. In case that your service is creating self-signed certificates, choose `https`, pangolin will not override those and be able to route traffic correctly. I said earlier to check if they are valid, what I meant was trying in local to connect to your service and see if your browser indicates that the certificates are flagged as "self-signed" which they regularly warn you about, or if they happen to flag them as "invalid". I would not be able to elaborate, this is rather empiric observations. <img width="1811" height="657" alt="Image" src="https://github.com/user-attachments/assets/1f90afa2-1305-4783-99d5-4436087f65f9" /> Let me know if any of these have helped you, Cheers
Author
Owner

@SprMario commented on GitHub (Aug 12, 2025):

@MorganKryze thank you for the explanation. How I understand it now is that you expose the networks "ports" but use the docker DNS to route to the right service. I add the pangolin network to each container I want to reach from the internet, is that right?

networks: pangolin: name: pangolin external: true

@SprMario commented on GitHub (Aug 12, 2025): @MorganKryze thank you for the explanation. How I understand it now is that you expose the networks "ports" but use the docker DNS to route to the right service. I add the pangolin network to each container I want to reach from the internet, is that right? `networks: pangolin: name: pangolin external: true`
Author
Owner

@MorganKryze commented on GitHub (Aug 12, 2025):

Yup! That's it!
Furthermore, if you have a stack, let's say a webserver + database: you would create a internal network "my-stack-network" where both containers would communicate, and connect only the webserver to the "pangolin" network to route the webserver to the internet. The database would remain private which is pretty much what we want in general.

@MorganKryze commented on GitHub (Aug 12, 2025): Yup! That's it! Furthermore, if you have a stack, let's say a webserver + database: you would create a internal network "my-stack-network" where both containers would communicate, and connect only the webserver to the "pangolin" network to route the webserver to the internet. The database would remain private which is pretty much what we want in general.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#494