# Error: listen EACCES: permission denied 0.0.0.0:80 — how to fix it

> Error: listen EACCES: permission denied 0.0.0.0:80 means your app asked Linux for a port below 1024 without the privilege to bind one. Ports 0 to 1023 are privileged, and a process that is not root and lacks the CAP_NET_BIND_SERVICE capability gets EACCES. Python reports the same refusal as PermissionError: [Errno 13]. Don't run the app as root: listen on the port in PORT, or on a high port behind a reverse proxy that holds 80 and 443.

Source: https://livops.dev/en/guides/error-listen-eacces-permission-denied

By Livops team, the people who build and run Livops. Updated 1 December 2026.

What Node prints when it happens:

```text
Error: listen EACCES: permission denied 0.0.0.0:80
    at Server.setupListenHandle [as _listen2] (node:net)
    ...
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 80
}
```

Python's version is `PermissionError: [Errno 13] Permission denied`, and Uvicorn prints `[Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied`. This page explains why Linux refuses the port, lists the causes from the most common, shows how to serve on 80 and 443 without root, and says which port to use on Livops.

## What does the error mean?

On Linux, port numbers below 1024 are privileged ports. Only a privileged process, one with the `CAP_NET_BIND_SERVICE` capability, may bind to them[1]; binding to one without it fails with `EACCES`[1]. That capability exists for exactly this: binding a socket to a port number less than 1024[2]. Root has it; an ordinary user does not.

Node builds the message from the system call, the error code, its text and the address: `listen` + `EACCES: permission denied` + `0.0.0.0:80`[3]. In Python, `PermissionError` is the exception for `EACCES` and `EPERM`[5]. An asyncio server, such as Uvicorn, rewords it as "error while attempting to bind on address … : permission denied"[6], and Uvicorn logs that line and exits[7].

So the port is not busy. The system refused it to your process. Ports 80 (HTTP) and 443 (HTTPS) are the usual ones, because those are what browsers connect to.

## Causes, most common first

### 1. The code listens on 80 or 443 itself

`app.listen(80)`, `uvicorn main:app --port 80`, `python -m http.server 80`, or a config file with `port: 443`. On your computer this often worked because you ran it with `sudo`, or on another operating system. On a server, as a normal user, it fails.

Listen on a high port, and on a platform, the port it gives you:

```js
// Node / Express
app.listen(Number(process.env.PORT) || 3000, '0.0.0.0')
```

```sh
# Python
uvicorn main:app --host 0.0.0.0 --port ${PORT:-8000}
gunicorn app:app --bind 0.0.0.0:${PORT:-8000}
```

### 2. PORT is set to a privileged port

The code reads `PORT`, but something sets it to 80: an `.env` file, a `Dockerfile` line `ENV PORT=80`, or a systemd unit. Remove that line on a platform, which sets `PORT` for you; on your own server, pick 3000 or 8000 and point the proxy there.

### 3. A Docker image switched to a non-root user, but kept port 80

An image whose `Dockerfile` has `USER node` (or any non-root user) and a server still configured for port 80. Inside the container the user is not root and has no capability to bind 80. Change the server's listen port to 8080 or another port of 1024 or higher, and publish that port: `docker run -p 80:8080 myimage` maps the host's 80 to the container's 8080, and the container never needs the privilege.

### 4. The address is a Unix socket file, not a port

`listen EACCES: permission denied /run/app.sock` has a path instead of an address. Here `EACCES` is the file kind: an access to a file forbidden by its permissions[4]. The process cannot create the socket in that folder. Put the socket in a folder the app's user owns, or listen on a TCP port.

## How to serve on 80 and 443 without root

Don't run the app as root to get the port. `sudo node server.js` makes every bug and every dependency run with root's rights. Three ways that keep the app unprivileged, best first:

1. **A reverse proxy holds 80 and 443.** nginx or Caddy listens on 80 and 443, terminates HTTPS, and forwards to the app on `127.0.0.1:3000`. This is how most servers run, and the proxy also serves static files and handles certificates.

   ```nginx
   server {
     listen 80;
     server_name example.com;
     location / {
       proxy_pass http://127.0.0.1:3000;
       proxy_set_header Host $host;
     }
   }
   ```

2. **A platform holds 80 and 443.** On a hosting platform the app listens on the port in `PORT`, and the platform's own proxy takes visitors' HTTP and HTTPS. You never bind 80 yourself.

3. **Grant the one capability.** On a server you manage, file capabilities can be attached to a program with `setcap`[2]:

   ```sh
   sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node
   ```

   This lets every script run by that `node` binary bind low ports, not just your app. Prefer the proxy.

## How to confirm the fix locally

Start the app as your normal user, the way the server will, with a high port:

```sh
PORT=8080 npm start &
curl -i http://127.0.0.1:8080/
lsof -nP -iTCP:8080 -sTCP:LISTEN     # macOS and Linux
id -u                                # not 0: you are not root
```

If it answers on 8080 without `sudo`, the error is gone for good. A container test is closer to a server:

```sh
docker run --rm --user 1000 -e PORT=8080 -p 8080:8080 myapp
curl -i http://localhost:8080/
```

## On Livops

- **The port is given to you.** A web app must listen on the port in the `PORT` variable: 3000 by default, and for a Docker image, the port you specified. Listen on `0.0.0.0` and `PORT`; never on 80 or 443.
- **HTTPS is handled for you.** Every service gets a `<name>.livops.app` address and an HTTPS certificate automatically, and your own domain gets one too. The app does not open 443.
- **Docker images run without privileges.** A Docker image runs as user 1000, without any Linux capabilities, and an image built with `USER root` won't start. The port you enter for it must be 1024 or higher. An image whose server listens on 80 has to be changed to a higher port, as in cause 3.
- **A crash on start is a failed deploy, not an outage.** If the app exits on this error, the deploy fails as `start_failed`, the **Logs** page shows the app's last lines with the error, and a web app's previous version keeps running.

What the platform does when the app listens on the wrong port: [App not listening on $PORT](https://livops.dev/en/guides/error-app-not-listening-on-port). When the port is taken rather than refused: [EADDRINUSE: address already in use](https://livops.dev/en/guides/error-port-already-in-use). In the docs: [The app did not start](https://livops.dev/en/docs/error-start) and the [platform-provided variables](https://livops.dev/en/docs/variables).

## Questions

**Why can't a normal user open port 80 on Linux?**

Ports below 1024 are privileged ports. Only a process with the CAP_NET_BIND_SERVICE capability may bind to them, and root has it. Any other process gets EACCES, which Node prints as listen EACCES and Python as PermissionError: [Errno 13].

**Can I just run the app with sudo?**

It works, and it gives the whole app root on the machine. A bug or a vulnerable dependency then runs as root too. Listen on a high port instead and let a reverse proxy, or the platform, take ports 80 and 443.

**How do I serve on port 80 without root?**

Put a reverse proxy such as nginx or Caddy on 80 and 443 and have it forward to your app on a high port like 3000. On a server you manage, you can instead grant the program the CAP_NET_BIND_SERVICE capability with setcap.

**Is it the same error as EADDRINUSE?**

No. EADDRINUSE means another process already holds the port. EACCES means the system refused your process the port, even though it may be free. Moving to a high port fixes EACCES; it does not fix EADDRINUSE.

**Which port should my app listen on when deployed?**

The one in the PORT environment variable, on 0.0.0.0. On Livops PORT is 3000 by default, and for a Docker image it is the port you specified, which must be 1024 or higher.

**My Docker image works locally but fails with EACCES on Livops. Why?**

A Docker image on Livops runs as user 1000 without any Linux capabilities, so it cannot bind a port below 1024. Make the server listen on a port of 1024 or higher and enter that port when you deploy the image.

## Sources

1. [Linux man-pages — ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html). Checked 1 December 2026.
2. [Linux man-pages — capabilities(7)](https://man7.org/linux/man-pages/man7/capabilities.7.html). Checked 1 December 2026.
3. [Node.js source — lib/internal/errors.js](https://github.com/nodejs/node/blob/main/lib/internal/errors.js). Checked 1 December 2026.
4. [Node.js docs — Errors, common system errors](https://nodejs.org/api/errors.html). Checked 1 December 2026.
5. [Python docs — Built-in exceptions](https://docs.python.org/3/library/exceptions.html). Checked 1 December 2026.
6. [CPython source — Lib/asyncio/base_events.py](https://github.com/python/cpython/blob/main/Lib/asyncio/base_events.py). Checked 1 December 2026.
7. [Uvicorn source — uvicorn/server.py](https://github.com/encode/uvicorn/blob/master/uvicorn/server.py). Checked 1 December 2026.
