[GH-ISSUE #234] Docker container only for UI #1468

Closed
opened 2026-02-27 12:10:56 +03:00 by kerem · 12 comments
Owner

Originally created by @schmittyd on GitHub (Dec 13, 2023).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/234

Is your feature request related to a problem? Please describe.
I want to include just the UI in my Docker compose as I already have a SWAG container which has NGINX, Certbot and php.

Describe the solution you'd like
A separate container just for the UI.

Originally created by @schmittyd on GitHub (Dec 13, 2023). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/234 **Is your feature request related to a problem? Please describe.** I want to include just the UI in my Docker compose as I already have a SWAG container which has NGINX, Certbot and php. **Describe the solution you'd like** A separate container just for the UI.
kerem 2026-02-27 12:10:56 +03:00
Author
Owner

@0xJacky commented on GitHub (Dec 13, 2023):

Hi, in nginx-ui, we need to execute some commands directly in the same environment with Nginx like to restart or reload it. If using a separate container just for the UI, we cannot control, test config files or get the running status of nginx.

<!-- gh-comment-id:1853309707 --> @0xJacky commented on GitHub (Dec 13, 2023): Hi, in nginx-ui, we need to execute some commands directly in the same environment with Nginx like to restart or reload it. If using a separate container just for the UI, we cannot control, test config files or get the running status of nginx.
Author
Owner

@schmittyd commented on GitHub (Dec 13, 2023):

Could you possibly add the GUI as a Docker mod to the NGINX and SWAG containers?
https://github.com/linuxserver/docker-mods

<!-- gh-comment-id:1853330003 --> @schmittyd commented on GitHub (Dec 13, 2023): Could you possibly add the GUI as a Docker mod to the NGINX and SWAG containers? https://github.com/linuxserver/docker-mods
Author
Owner

@leoperegrino commented on GitHub (Jan 3, 2024):

bump. this would be useful for those who already are running nginx images and prefer not to switch. I use linuxserver/nginx which has few modifications such as configurations mountpoints (/config), users and groups.

In case of a different image only for the UI, a form of communication of the UI and the separate nginx would be necessary. I think of shared volumes or network calls.

Shared volumes are ok if one only needs to read and write to configuration/log files, not execute commands. I don't know if nginx provides any type of RPCs or APIs for command execution, and even if it does that would pose a security risk.

Why having a shared mount between a nginx-ui UI container and a different nginx container is not enough? Maybe the only option is what @schmittyd sugested.

<!-- gh-comment-id:1875401649 --> @leoperegrino commented on GitHub (Jan 3, 2024): bump. this would be useful for those who already are running nginx images and prefer not to switch. I use `linuxserver/nginx` which has few modifications such as configurations mountpoints (`/config`), users and groups. In case of a different image only for the UI, a form of communication of the UI and the separate nginx would be necessary. I think of shared volumes or network calls. Shared volumes are ok if one only needs to read and write to configuration/log files, not execute commands. I don't know if nginx provides any type of RPCs or APIs for command execution, and even if it does that would pose a security risk. Why having a shared mount between a nginx-ui UI container and a different nginx container is not enough? Maybe the only option is what @schmittyd sugested.
Author
Owner

@Mqxx commented on GitHub (Feb 26, 2025):

bump. this would be useful for those who already are running nginx images and prefer not to switch.

It would definitely! For example I wan't to use my own Nginx because I need the RTMP module and I can not "build it into" this existing Nginx-UI container. The RTMP module requires Nginx to be build from scratch to include the community RTMP module. https://github.com/0xJacky/nginx-ui/issues/856

<!-- gh-comment-id:2685324005 --> @Mqxx commented on GitHub (Feb 26, 2025): > bump. this would be useful for those who already are running nginx images and prefer not to switch. It would definitely! For example I wan't to use my own Nginx because I need the RTMP module and I can not "build it into" this existing Nginx-UI container. The RTMP module requires Nginx to be build from scratch to include the community RTMP module. https://github.com/0xJacky/nginx-ui/issues/856
Author
Owner

@jo-chemla commented on GitHub (Jul 1, 2025):

Thanks for the implementation of managing nginx in another docker container in #977!

<!-- gh-comment-id:3022868628 --> @jo-chemla commented on GitHub (Jul 1, 2025): Thanks for the implementation of managing nginx in another docker container in #977!
Author
Owner

@Mqxx commented on GitHub (Jul 3, 2025):

Are there any documentation on how to set this up? https://github.com/0xJacky/nginx-ui/discussions/1151

<!-- gh-comment-id:3031081580 --> @Mqxx commented on GitHub (Jul 3, 2025): Are there any documentation on how to set this up? https://github.com/0xJacky/nginx-ui/discussions/1151
Author
Owner

@0xJacky commented on GitHub (Jul 3, 2025):

Are there any documentation on how to set this up? #1151

Please check this documentation: https://nginxui.com/guide/config-nginx.html#container-control

<!-- gh-comment-id:3031149201 --> @0xJacky commented on GitHub (Jul 3, 2025): > Are there any documentation on how to set this up? [#1151](https://github.com/0xJacky/nginx-ui/discussions/1151) Please check this documentation: https://nginxui.com/guide/config-nginx.html#container-control
Author
Owner

@Mqxx commented on GitHub (Jul 3, 2025):

Thanks! I will try that 🙂

<!-- gh-comment-id:3031170526 --> @Mqxx commented on GitHub (Jul 3, 2025): Thanks! I will try that 🙂
Author
Owner

@Mqxx commented on GitHub (Jul 3, 2025):

If I understand correctly I just need to specify an env variable in the docker-compose.yml called NGINX_UI_NGINX_CONTAINER_NAME= that points to the name of the container for the nginx instance.

<!-- gh-comment-id:3031197045 --> @Mqxx commented on GitHub (Jul 3, 2025): If I understand correctly I just need to specify an `env` variable in the docker-compose.yml called `NGINX_UI_NGINX_CONTAINER_NAME=` that points to the name of the container for the nginx instance.
Author
Owner

@0xJacky commented on GitHub (Jul 3, 2025):

If I understand correctly I just need to specify an env variable in the docker-compose.yml called NGINX_UI_NGINX_CONTAINER_NAME= that points to the name of the container for the nginx instance.

Yes, you're right.

<!-- gh-comment-id:3031199316 --> @0xJacky commented on GitHub (Jul 3, 2025): > If I understand correctly I just need to specify an `env` variable in the docker-compose.yml called `NGINX_UI_NGINX_CONTAINER_NAME=` that points to the name of the container for the nginx instance. Yes, you're right.
Author
Owner

@Mqxx commented on GitHub (Jul 3, 2025):

So for example my docker-compose.yml would look like this?

services:
  nginx-service:
    container_name: 'nginx-service'
    image: 'tiangolo/nginx-rtmp:latest'
    volumes:
      - './data/nginx:/etc/nginx'

    ports:
      - '1935:1935'

    restart: unless-stopped
    # ...

  nginx-ui:
    container_name: 'nginx-ui'
    image: 'uozi/nginx-ui:latest'
    depends_on:
      - nginx-service

    environment:
      - NGINX_UI_NGINX_CONTAINER_NAME=nginx-service

    ports:
      - '8080:80'
      - '8443:443'

    volumes:
      - './data/nginx:/etc/nginx'
      - './data/nginx_ui:/etc/nginx-ui'
      - '/var/www:/var/www'
      - '/var/run/docker.sock:/var/run/docker.sock'

    stdin_open: true
    tty: true
    restart: unless-stopped
<!-- gh-comment-id:3031385280 --> @Mqxx commented on GitHub (Jul 3, 2025): So for example my docker-compose.yml would look like this? ```yml services: nginx-service: container_name: 'nginx-service' image: 'tiangolo/nginx-rtmp:latest' volumes: - './data/nginx:/etc/nginx' ports: - '1935:1935' restart: unless-stopped # ... nginx-ui: container_name: 'nginx-ui' image: 'uozi/nginx-ui:latest' depends_on: - nginx-service environment: - NGINX_UI_NGINX_CONTAINER_NAME=nginx-service ports: - '8080:80' - '8443:443' volumes: - './data/nginx:/etc/nginx' - './data/nginx_ui:/etc/nginx-ui' - '/var/www:/var/www' - '/var/run/docker.sock:/var/run/docker.sock' stdin_open: true tty: true restart: unless-stopped ```
Author
Owner

@Mqxx commented on GitHub (Jul 7, 2025):

@0xJacky I tried the docker-compose.yml config that I posted, but now I have multiple problems. First of all it looks like nginx-ui creates a default user called nginx but this user does not exist so the custom image crashes, second problem is that I can not restart the image using the ui (I suppose this is because the custom image runs in a separate container). Is there a way I can fix these problems?

<!-- gh-comment-id:3045751548 --> @Mqxx commented on GitHub (Jul 7, 2025): @0xJacky I tried the `docker-compose.yml` config that I posted, but now I have multiple problems. First of all it looks like nginx-ui creates a default user called `nginx` but this user does not exist so the custom image crashes, second problem is that I can not restart the image using the ui (I suppose this is because the custom image runs in a separate container). Is there a way I can fix these problems?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#1468
No description provided.