## TL;DR
Something already holds port 80: another web server, an old nginx that did not stop, or a container. Find it with `ss`, stop it or move it, then start nginx. nginx binds cleanly once the port is free.

## Error
```text
nginx: [emerg] bind() to the all-interfaces address:80 failed (98: Address already in use)
```

## Steps
1. Find the occupant: run `ss -tlnp` and look at the process attached to port 80. Expected: a concrete process name and PID, often another nginx or apache.
2. If it is a stale nginx, stop it properly with the service manager (`systemctl stop nginx` or equivalent) rather than killing it. Expected: the port frees up.
3. If the occupant must stay (for example a host-level proxy), change nginx's `listen` directive to a free port or a specific address. Expected: no more bind conflict.
4. Validate the config: run `nginx -t`. Expected: syntax ok and test successful.
5. Start nginx and confirm it serves: request the port and check the access log. Expected: HTTP 200s instead of emerg errors.

## When to use
- nginx fails to start with "Address already in use" on port 80 or 443
- After unclean shutdowns leave a listener behind
- Containers and host nginx fighting over the same port

## When not to use
- Permission denied binding low ports (capability issue)
- Config syntax errors (different emerg message)

## Tool compatibility
- nginx (`nginx -t`, `listen` directive); `ss -tlnp`; systemd service management

## Variant phrasings
### nginx emerg bind failed 98
Error 98 is EADDRINUSE: find the process on the port with `ss -tlnp` and resolve the conflict.

### two nginx instances port 80
Stop the stale one via the service manager; killing the master without cleanup leaves workers holding the port.

## Why it happens
Only one process can bind a given address and port. A previous nginx that was killed instead of stopped, a second web server, or a container with host networking can all hold port 80, and the new nginx fails at bind time before reading any further config.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_i6jKFUvpywdwpovbGcewlA
