Fix “address already in use” error when running n8n in Docker inside LXC on Proxmox VE
Step‑by‑step guide to find and stop the process using port 5678, then launch n8n in Docker inside your Proxmox LXC without the address‑already‑in‑use error.
Before you start: versions, package names and storage identifiers change over time. Check the commands against the official documentation for your setup before running them, especially anything that creates, deletes or overwrites data.
n8n will not start and Docker reports:
Error starting userland proxy: listen tcp4 0.0.0.0:5678: bind: address already in use
Something else already holds TCP 5678. Almost always that something is a previous n8n container you thought was gone.
Find what is holding the port
Inside the LXC:
ss -tulpn | grep :5678
Read the last column. It tells you which of two very different situations you are in:
docker-proxy— a Docker container has the port. Go to the next section.- anything else (
node,python, a systemd service) — a process outside Docker has it. Skip to “a non-Docker process”.
If ss is not installed: apt install -y iproute2.
If it is a Docker container
The important flag is -a. A plain docker ps hides stopped containers, but a container in a restart loop is running just often enough to hold the binding:
docker ps -a --filter publish=5678
That filters directly to containers publishing the port, which is faster than reading the full list. Then remove the old one:
docker stop <name-or-id>
docker rm <name-or-id>
If you are using Compose, prefer:
docker compose down
That stops and removes the containers Compose created, rather than leaving an orphan that Compose no longer tracks but Docker still runs. Mixing docker run and docker compose up for the same service is the usual way people end up with two n8n containers competing for one port.
If it is a non-Docker process
Identify it before killing it — 5678 is not exclusive to n8n:
lsof -iTCP:5678 -sTCP:LISTEN
If it belongs to a systemd unit, stop the unit rather than the process, or it will come back:
systemctl stop <unit>
systemctl disable <unit>
Use kill <PID> only for something you have identified and know is disposable.
Confirm the port is free, then start
ss -tulpn | grep :5678 # expect no output
docker compose up -d
docker compose ps
Alternative: move n8n to a different host port
If the other service has a right to 5678, remap instead. Only the left-hand number changes:
ports:
- "5679:5678"
Host 5679, container still 5678. Do not change the right-hand side — that is the port n8n listens on inside the container, and changing it without also setting N8N_PORT gives you a container that starts and answers nothing.
If n8n sits behind a reverse proxy or generates webhooks, update the proxy target and set WEBHOOK_URL to the public address, or webhook URLs will keep advertising the old port.
Port appears free but the error persists
Two causes worth knowing, because they look identical from the outside:
You are checking in the wrong place. Each LXC has its own network namespace. Running ss on the Proxmox host tells you nothing about what is bound inside container 210, and vice versa. Check inside the container that actually runs Docker.
The container is restarting in a loop. It grabs the port, crashes, and grabs it again, so a single ss can catch it either way. Check for it:
docker ps -a --format '{{.Names}}\t{{.Status}}'
A status like Restarting (1) 12 seconds ago means the port conflict is a symptom, not the cause — something is making n8n exit. Read the logs:
docker compose logs --tail=50 n8n
If that log shows EACCES: permission denied, mkdir '/home/node/.n8n', the real problem is volume ownership, covered in the EACCES fix.
Sources
- Docker docs — Networking and published ports
- n8n docs — Install with Docker (default port 5678)
- Docker docs —
docker compose down
Related reading
Some links on this page may be affiliate links. If you buy through them we may earn a commission at no extra cost to you. See our affiliate disclosure.