Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

Port Already in Use: Find the Listener with ss and lsof, Read errno 98 and Choose a Free Port

Self-Hosting & Infra beginner 4 min read $0.01 Updated 2026-10-20

Reproduced in Python on Linux: bind to 127.0.0.1 with port 0, ss -ltn showing the listener, a second bind failing with errno 98 Address already in use, and commands for ss, lsof and fuser.

Your server fails with Address already in use (EADDRINUSE, errno 98). Identify which process owns the port with ss or lsof, stop it cleanly, handle TIME_WAIT with SO_REUSEADDR, and let the OS pick free ports in tests.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →