Community Solution

CasaOS Apps Share Port 5000: Change the Host Port, Not the Container Port

A June 2024 CasaOS question about MusicBrainz, HandBrake, and other apps sharing port 5000; a later reply identified changing the host port while preserving the container port.

A CasaOS user installed several web applications that expected container port 5000. Only one app could be reached because multiple containers were trying to publish the same port on the Debian host. Changing both sides of the mapping caused some applications to stop responding.

The working rule is simple: keep the application’s container port unchanged unless its own documentation says the listening port is configurable. Change only the host-side port.

Read Docker Port Mappings Left to Right

5001:5000

In this mapping, 5001 is the host port used in the browser and 5000 is the port where the application listens inside the container. Docker’s official port-publishing guide uses the same host-to-container model.

Map Two Port-5000 Apps to Different Host Ports

Application Host port Container port Browser address
MusicBrainz 5001 5000 http://SERVER-IP:5001
HandBrake 5002 5000 http://SERVER-IP:5002

Each host IP and port pair must be unique. Multiple containers can still listen on 5000 internally because their network namespaces are isolated.

Why Changing the Container Port Often Breaks the Web UI

An image may start its web server on a fixed internal port. If CasaOS maps host port 5001 to container port 5001 while the process still listens on 5000, Docker forwards traffic to an empty socket. The container can look healthy even though the browser receives no response.

Only change the container port when the upstream application exposes a documented setting or environment variable that changes the process’s listen port as well.

Edit the Correct Field in CasaOS

  1. Open the app’s settings or custom-install configuration.
  2. Find the port entry that shows host and container values.
  3. Leave the container value at the image default.
  4. Choose an unused host port.
  5. Save and recreate or restart the container as prompted.
  6. Open the app through the new host port.

Verify Before Assigning a New Port

Check the CasaOS app list or container configuration for existing mappings. Also consider services installed directly on Debian, because they can occupy the same host port without appearing as a CasaOS app. Avoid assigning common infrastructure ports such as 22, 53, 80, 443, or 445 unless you understand the existing service.

Host Networking Removes This Flexibility

In host network mode, the container shares the host’s network namespace and cannot remap an already-used listen port in the normal way. Docker’s host-network documentation confirms that only one service can bind a particular host port.

CasaOS Port Conflict FAQ

Which number should I change?

Change the host port, which is the first number in HOST:CONTAINER.

Can every app use container port 5000?

Yes, if each container is isolated and each publishes a different host port.

Why did the app install but not open?

The mapping may point to a container port where the application is not listening.