Minecraft "Failed to bind to port": find it and kill it
Failed to bind to port means another process already holds your server's port. Find the PID with ss or netstat, kill it, then check the port settings.
Quick answer “Failed to bind to port” (often with
java.net.BindException: Address already in use) means the operating system refused the server’s port because something already holds it. Most often that is an older copy of the same server that never exited [6]. Find the owner withss -ltnp 'sport = :25565'on Linux ornetstat -ano | findstr :25565on Windows, confirm it is your server, andkill <pid>it (Windows:taskkill /PID <pid>). If the port is free and the error stays, checkserver-port, a port below 1024, and anything else sharing the port, such as Geyser.
The lines you will see
The wording differs by server software and OS. One host’s knowledge base lists these variants, all meaning the same thing [6]:
java.net.BindException: Address already in use: bind
**** FAILED TO BIND TO PORT!
The exception was: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
Perhaps a server is already running on that port?
Under the hood that is the OS error EADDRINUSE, “tried to bind to an address already in use” [5]. If your container runtime prints something like Bind for ... failed: port is already allocated, it is the same family of problem one layer up [6], covered near the end.
Find what holds the port
The default port is 25565. Swap in yours if you changed it.
Linux. -l listening sockets only, -t TCP, -n numeric, -p show the owning process, and sport = :25565 filters by port [2]:
ss -ltnp 'sport = :25565'
Example output, so you know what to look for. This is not from Minecraft and not from an Omne server. It comes from my own six-line Java test program that opens a ServerSocket on the port and sleeps, run on Java 25.0.3 on Linux on 2026-11-17, using port 25577 instead of 25565. Your PID will differ:
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 50 *:25577 *:* users:(("java",pid=1385903,fd=5))
Starting a second copy of that program on the same port printed Exception in thread "main" java.net.BindException: Address already in use and a stack trace. What you need from the output above is pid=1385903.
If you get no output but the error persists, re-run with sudo, since the owner may be another user’s process. The lsof equivalent is lsof -nP -iTCP:25565 -sTCP:LISTEN, and its manual notes that on security-restricted builds a non-root user may list only their own processes’ files [3].
Windows. -a all connections and listening ports, -n numeric, -o adds the process ID, which you match to an application in Task Manager’s Processes tab [4]:
netstat -ano | findstr :25565
(findstr is a Windows text filter, not part of netstat.)
I ran ss, ps and kill for this post, against the test program above. lsof, netstat and taskkill come from their manual pages and I did not run them. macOS I did not touch.
Check that the owner is your server, then kill it
Do not kill a PID just because it owns the port. Look at what it is first:
ps -o args= -p 1385903
args prints the process’s full command line [12]. If it is java ... server.jar or your start script, you found the old instance. If it is something else (a web map, a voice-chat daemon, another game server), move one of the two to a different port instead of killing it.
Ways an old instance ends up there: a start script ran twice, a screen or terminal tab from last week is still running the server, or a service manager restarted it after you started one by hand. If you can still reach its console, type stop there. If you cannot, kill it:
kill 1385903
Plain kill sends the TERM signal, which the manual says to prefer over KILL because a process can handle TERM and clean up before it exits [7]. Re-run the ss command. When the line is gone, start your server. Use kill -9 only if the process ignores TERM: KILL cannot be caught or ignored [13], so the server gets no chance to run its own shutdown.
On Windows:
taskkill /PID 1234
taskkill /PID 1234 /F
The first asks the process to end. /F forces it [8].
The port is free and it still fails
Work through these in order.
1. The port line in server.properties. The keys are server-port (TCP, default 25565) and query.port (UDP, default 25565, used only when enable-query is true, which it is not by default). Both accept 1 to 65534 [1]. Two servers on one machine each need their own server-port, and their own query.port if query is on.
2. A port below 1024. On Linux, binding a privileged port needs the CAP_NET_BIND_SERVICE capability [5]. A server-port=80 can fail for that reason even when nothing else is on port 80. Use a high port and an SRV record instead: point a domain at your server with SRV records.
3. server-ip is not blank. The wiki says an empty server-ip listens on all addresses and recommends leaving it empty [1]. Paper’s troubleshooting page lists a misconfigured server-ip as one of two causes of this error (the other is a server already running), and stresses it is not a placeholder for your external IP: it picks which network interface to bind [14]. An address that does not belong to this machine is EADDRNOTAVAIL at the OS level [5], so the console text may differ from the lines above; I did not capture it. If you find a value there you did not set on purpose, blank it and restart.
4. Geyser or voice chat on the same number. The GeyserMC setup page says Geyser uses its port (default 19132) over both TCP and UDP, and that no other program can use that port on either protocol. It names voice chat mods and Query as UDP examples, and another server or a web map as TCP examples [9]. A mixed Java and Bedrock server hits this more easily than a plain one. Give each service its own port: Geyser and Floodgate setup, Simple Voice Chat ports.
5. A server that just crashed. ip(7) says a bound TCP address is unavailable for some time after closing unless SO_REUSEADDR is set [5]. I did not verify whether the Minecraft server sets it. If ss shows nothing listening and the error appears right after a crash, that is the candidate. It is unproven here.
On a panel or in Docker
On a Pterodactyl-style panel you do not own the port line. The Paper egg in the pterodactyl/game-eggs repository declares a config parser for server.properties that sets server-ip to 0.0.0.0 and both server-port and query.port to the server’s allocated port [10]. Change the port in the panel’s allocation, not in the file, because the file is rewritten at start. The longer version is in server.properties explained.
In Docker, the conflict is usually on the host side of the mapping. -p 8080:80 maps host port 8080 to container port 80 [11], so to run a second server next to the first, publish -p 25566:25565 and leave the server’s own port alone. The full setup is in running a server in Docker with itzg.
Bind error or firewall problem
They look different. A bind error stops the server from starting at all, and the error is in its console [6]. A firewall or forwarding problem leaves a healthy server that outside players cannot reach. The wiki notes server-port must be forwarded when the server sits behind NAT [1]. If the server starts and you can join from the same machine, the bind is fine. Forwarding is covered in self-hosting on your own PC.
Not covered
- macOS, and the Windows commands (documented, not run here).
- Bedrock Dedicated Server’s own port settings.
- Whether a wrong
server-ip, orserver-portandquery.portset to the same number, changes the error text. Not tested.
Questions people ask
Is 'Failed to bind to port' a port forwarding problem?
No. Sparked Host's support article says the error has nothing to do with your router or port-forwarding settings [6]. It means the machine running the server could not claim the port. Forwarding only matters for players reaching a server that did start [1].
How do I see what is using port 25565?
On Linux run ss -ltnp 'sport = :25565', which lists the listening socket and the owning process [2]. On Windows run netstat -ano | findstr :25565 and look up the PID that `-o` adds in Task Manager [4].
What port does a Minecraft Java server use by default?
25565 for both server-port (TCP) and query.port (UDP) [1]. query.port only matters if enable-query is true, which is false by default [1].
Can two Minecraft servers run on one machine?
Yes, if each has its own server-port, and its own query.port if query is on [1]. Two servers on the same port is the classic way to get this error [6].
Sources
- server.properties (Minecraft Wiki)
- ss(8) manual page
- lsof(8) manual page
- netstat (Microsoft Learn)
- ip(7) manual page
- Failed to Bind to Port Error on Minecraft Server (Sparked Host)
- kill(1) manual page
- taskkill (Microsoft Learn)
- Geyser setup (GeyserMC wiki)
- Paper egg for Pterodactyl (pterodactyl/game-eggs)
- Publishing ports (Docker docs)
- ps(1) manual page
- signal(7) manual page
- Basic troubleshooting (PaperMC Docs)