Macvlan connecting to nginx proxy manager problem

hi, i was busy setting up nextcloud aio a while back and continued this week but ran into a problem. I want to run multiple nextcloud environments separately on a docker environment (for different friends). i wanted to do this with macvlans, so that i can run each nextcloud environment on its own physical network. i use npm to link it to my domain, i have already managed to do this, but now i am only stuck when the other containers are installed i cannot use the macvlans on the other containers like the apache container the koppel to the npm. If i link the aio default network to the containers my macvlan no longer works for what i need to link to my npm and if i only link the macvlan i get to see in the logs that the containers cannot reach each other. anyone a solution? thank you in advance.

Hi @Andy_d1 unfortunately a lot of information to help you is missing as you ignored the required support template. Please edit into your post and add as many information as possible. This will give us the technical info and logs needed to help you!

especially post your compose files and npm config. a drawing of the system architecture would help as well.

ok thanks i will edit my post. when i made the post on my phone i missed the template but will update my post what the template.

The Basics
Nextcloud AIO version: v11.0.0
Operating system: Ubuntu 24.04
Web server: Apache 2.4.25 (inside Nextcloud AIO containers)
Reverse proxy: NGINX Proxy Manager (Nginx 1.27.2)
Is this the first time you’ve seen this issue? Yes
When did the issue start? After configuring the domain in the AIO setup and the automatic creation of additional Nextcloud containers.
Installation method: AIO via Docker
Using Cloudflare, mod_security, or similar tools? No

Summary of the issue you are facing:
hi, i was busy setting up nextcloud aio a while back and continued this week but ran into a problem. I want to run multiple nextcloud environments separately on a docker environment (for different friends). i wanted to do this with macvlans, so that i can run each nextcloud environment on its own physical network. i use npm to link it to my domain, i have already managed to do this, but now i am only stuck when the other containers are installed i cannot use the macvlans on the other containers like the apache container the koppel to the npm. If i link the aio default network to the containers my macvlan no longer works for what i need to link to my npm and if i only link the macvlan i get to see in the logs that the containers cannot reach each other. anyone a solution? thank you in advance.

Steps to replicate it (hint: details matter!):

  1. Installed Ubuntu, Docker, and Portainer on the host system.
  2. Created a macvlan Docker network (bound to interface enX4) and opened the required firewall ports: 80, 443, and 8080.
  3. Deployed NGINX Proxy Manager (NPM) on the macvlan network using a Docker Compose script.
  4. Deployed the nextcloud-aio-mastercontainer using a Docker script and initially accessed it on port 8080.
  5. After the initial setup, configured NGINX Proxy Manager to route a domain (e.g. cloud.example.com) to the internal IP of the nextcloud-aio-mastercontainer (192.168.159.20:8080).
  6. Accessed the AIO setup wizard via domain (e.g. cloud.example.com) and completed it using the passphrase.
  7. During this step, the AIO Mastercontainer created several additional Nextcloud containers (like nextcloud-aio-apache, nextcloud-aio-db, etc.).
  8. At this point, I attempted to switch all containers to the macvlan network to give them dedicated LAN IPs and make them accessible.
  9. Problem: Once on the macvlan network, the containers could no longer communicate with each other internally and if i had both netwerken (the default aio network) the containers wil connect internal in docker but not what the npm anymore.

Log entries
each other, but then the macvlan doesn’t work anymore and if I remove the internal network they can’t communicate with each other internally anymore, which gives me the bad gateway. if I put nginx back to the master container 8080 then I just get to the nextcloud page, but here it says that I need the apache container, probably because I created this container myself and the apache container was created by the setup.

Configuration
nextcloud

docker run -d \
--name nextcloud-aio-mastercontainer \
--restart always \
--network root_macvlan \
--ip 192.168.159.21 \
-p 8080:8080 \
-p 8443:8443 \
-v nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-e NEXTCLOUD_DATADIR="/mnt/ncdata/nextcloud_naam" \
-e NEXTCLOUD_URL="[https://domain](https://domain/)" \
-e SKIP_DOMAIN_VALIDATION="true" \
-e APACHE_PORT=11000 \
-e APACHE_IP_BINDING=0.0.0.0 \
[ghcr.io/nextcloud-releases/all-in-one:latest](http://ghcr.io/nextcloud-releases/all-in-one:latest)

Nginx proxy manager

version: "3.7"

services:
  nginx_proxy_manager:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginx-proxy-manager
    restart: always
    networks:
      macvlan:
        ipv4_address: 192.168.159.22
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    environment:
      - DISABLE_IPV6=true

 
volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

 
networks:
  macvlan:
    driver: macvlan
    driver_opts:
      parent: enX4
    ipam:
      config:
        - subnet: 192.168.159.0/24
          gateway: 192.168.159.1

screenshots
Docker macvlan


domain webpage

npm

I hope this is understandable. This is the best I understand if I need to look for something else let me know.

You should not touch the child containers - mastercontainer is responsible to create and manage them (customizations will be lost once container is updated). There is an option --env APACHE_ADDITIONAL_NETWORK="" \ to use if reverse proxy is attached to specific network

PS: please use code tags ` (single line) or ``` (multiline) to improve readability!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.