EX200 Manage containers Practice Question
A system administrator is troubleshooting a container that fails to start with the error: 'Error: cannot start container: listen tcp4 :80: bind: address already in use'. The container is intended to serve HTTP traffic on port 80. What is the most appropriate first step to resolve this issue?
⚠ Common exam trap
Candidates often confuse container-level options like `--replace` or `--force` with host-level port management, or assume `--net=host` bypasses port conflicts, when in fact it still requires the port to be available on the host.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Check which process is using port 80 and either stop that process or use a different host port
The error 'address already in use' indicates that port 80 on the host is already occupied by another process. The correct first step is to identify that process using commands like `ss -tlnp` or `lsof -i :80` and either stop it or map the container to a different host port (e.g., `-p 8080:80`). This directly resolves the binding conflict without risking data loss or unintended behavior.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add --force to the podman run command
Why it's wrong here
The `--force` flag is not a valid option for `podman run`; it is used with `podman rm` or `podman stop` to forcefully terminate a running or stopped container without waiting for graceful shutdown. Even if you attempted to pass it, it would be rejected by Podman's CLI parser, and it would not address the underlying port conflict. To fix the error, you must either stop the process already bound to port 80 or map the container to a different host port, such as `-p 8080:80`.
- ✓
Check which process is using port 80 and either stop that process or use a different host port
Why this is correct
Start by identifying which process holds port 80 with `ss -tlnp` or `lsof -i :80`; the output shows the process ID and name. You can then stop that service with `systemctl stop` or `kill` if it is no longer needed, or simply run the container with a different host port mapping like `-p 8080:80` to avoid the conflict. This is the standard, correct approach because it either frees the required resource or selects an unused port.
- ✗
Add --replace to the podman run command
Why it's wrong here
The `--replace` option tells Podman to remove any existing container with the same name before creating the new one, so it only resolves name collisions, not port conflicts. If port 80 is already occupied, the new container will still fail to bind regardless of whether `--replace` is present, because the conflict is with an external process or another container's port forward. It is therefore the wrong tool for this scenario.
- ✗
Use --net=host to bypass the port mapping
Why it's wrong here
With `--net=host`, the container shares the host's network namespace and binds directly to host interfaces, bypassing the need for `-p` port mappings entirely. However, this does not grant any special ability to re-bind an already-occupied port: if a host process is listening on port 80, the container's service will encounter the same 'address already in use' error. The only way to avoid the conflict is to free the port or change the port that the container's service uses.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 127 original EX200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.