Linux Address Already in Use
Warningnetwork
Overview
Linux "Address already in use" (EADDRINUSE) means another process is already listening on the requested port.
Key Details
- errno 98 — bind() failed because port is occupied
- Common when restarting services quickly
- TIME_WAIT state can also block port reuse
- Only one process can bind to a specific port
Common Causes
- Previous instance of the service still running
- Another service using the same port
- Port in TIME_WAIT state after recent connection
- Zombie process holding the port
Steps
- 1Find what is using the port: ss -tlnp | grep :port
- 2Kill the process using the port: kill PID
- 3Use SO_REUSEADDR socket option in your code
- 4Wait for TIME_WAIT to expire (usually 60 seconds)
Tags
linuxnetworkaddress already in usetroubleshootingfix
More in Network
windows-651-pppoe-connection-failedWindows Error 651 — PPPoE Connection Failed
Warningwindows-691-authentication-failedWindows Error 691 — Authentication Failed
Warningwindows-720-ppp-connection-failedWindows Error 720 — PPP Connection Failed
Errorwindows-800-vpn-tunnel-failedWindows Error 800 — VPN Tunnel Failed
Warningwindows-network-error-619Windows VPN Error 619 — Connection Could Not Be Established
Warningwindows-network-error-868Windows VPN Error 868 — Remote Server Not Resolved
WarningFrequently Asked Questions
Run: ss -tlnp | grep :80 or lsof -i :80 to see the process.