Skip to content

Rootless Podman: Listen failed for port 80: Permission denied

Containertested on Podman 5.7.0, Ubuntu 24.04

Rootless containers run with your user's rights. Ports below 1024 are privileged: pasta, the network for rootless containers, may not open them. As a Quadlet service, systemctl only says “failed” – the cause is in the journal.

Symptom

systemctl --user start r15-web.service; echo "Exit: $?"
Job for r15-web.service failed because the control process exited with error code.
Exit: 1

The Quadlet service is meant to serve nginx “normally” on port 80 (PublishPort=127.0.0.1:80:80). The dry run was clean.

Diagnosis

The cause is in the unit's journal, the limit in a sysctl.

systemctl --user is-active r15-web.service
journalctl --user -u r15-web.service --no-pager -o cat \
  | grep -E 'pasta|Listen|restart counter|Start request' | tail -5
sysctl net.ipv4.ip_unprivileged_port_start
failed
Listen failed for HOST TCP port 127.0.0.1/80: Permission denied
Error: pasta failed with exit code 1:
r15-web.service: Scheduled restart job, restart counter is at 5.
r15-web.service: Start request repeated too quickly.
net.ipv4.ip_unprivileged_port_start = 1024

Causes

port 80Privileged port in rootless mode

Below net.ipv4.ip_unprivileged_port_start (1024) only root may bind. pasta runs as your user.

Restart=on-failuresystemd gives up after five tries

Restart=on-failure tries five times; then systemd reports “Start request repeated too quickly” and won't start the unit again until reset-failed resets the counter.

Fix

Use a free high port, reload the units, reset the failure counter and start.
sed -i 's#^PublishPort=127.0.0.1:80:80#PublishPort=127.0.0.1:8088:80#' \
  "$q/r15-web.container"
systemctl --user daemon-reload
systemctl --user reset-failed r15-web.service
systemctl --user start r15-web.service && sleep 2
r15-web	Up 2 seconds	127.0.0.1:8088->80/tcp
HTTP/1.1 200 OK

Don't: Lower net.ipv4.ip_unprivileged_port_start to 80 for all users just so one container gets port 80 – it then applies to every process of every user.

▶
Break it yourself and find it – free
Container tools hands-on, Day 16: repair ten broken container setups with Podman, Quadlet, crane, skopeo and cosign.
Go to day 16 →

FAQ

How do I still get port 80 or 443?

In production a reverse proxy or load balancer listens on 80/443 and forwards to the high port.

Why doesn't systemctl start alone work after the fix?

After five quick failures systemd refuses further starts. systemctl --user reset-failed resets the counter.

Related error patterns

More