4

I started a local Minecraft server on my Windows XP computer, but didn't shut it down correctly once finished by using the stop command.

Now when it starts up, it says "Failed to bind port 25565. Stopping server"

In fear of making this mistake again, I would like to know if there is a way to "unclog" the port. Any answer will do! Thank you.

  • 3
    Simple. Restart your computer. (Hopefully) I will post it as an answer if it works. – user92092 Jan 10 '15 at 14:31
  • 1
    For me at least, it happens because you didn't use "stop". So the server is still binded to your port, so nothing else can be hosted until it's told to stop. – user92092 Jan 10 '15 at 14:31
  • I don't know if your the one who upvoted Christian. But if it worked, consider accepting it as the correct answer. We both get reputation. :P – user92092 Jan 10 '15 at 14:37
  • 1
    Download CurrPorts. It will make your life easier. – Der Hochstapler Jan 11 '15 at 9:54
  • 1
    This question has nothing to do with Minecraft, and could also happen with any application that opens a server, making it off-topic on Arqade. – pppery Aug 11 '19 at 16:33
3

You posted seven hours ago, so the immediate problem may have been resolved by the reboot suggested in another answer. However, as a more fine-tuned solution, you might find this answer valuable: How to close TCP and UDP ports via windows command line.

Rebooting the entire machine will end all processes, freeing all ports used by those processes, and that includes the 'defunct' Minecraft server process using 255656. However, if you end that process itself (and any of its children), you will be able to free the port it used.

Minecraft is a good practice environment for many skills you can use later. If you ever want to run a server in a work environment, you'll want to avoid rebooting it unless absolutely necessary, so practising the more precise fix is valuable.

6

Pretend we have a sheet of paper with lots of holes. Those holes are ports.

Minecraft wants to use Port Number 25565. You allow it. So you stick a pin through that hole.

When you shut a server down properly, it tells the hole to disconnect Minecraft's pin from the ports. When you don't, the server is no longer online, but the pin's still connected. (For absolutely no reason)

The simple fix, is to restart your computer, ultimately disconnecting all used ports, refreshing it so you can simply get back to whatever you were doing when the computer turns back on...

Don't worry, this happens to everyone at one stage in their server hosting lifetime.

  • 5
    +1 for that holes analogy. I might have to steal that one. – Studoku Jan 10 '15 at 14:37
  • 4
    @Studoku Haha. I always use it. Noobs understand everytime. xD As for you Studoku, thankyou for that sneaky "We both get rep". I did steal that one. :P – user92092 Jan 10 '15 at 14:38
  • This is way overkill. On just about any modern OS, if the process that was using a port ends without giving up the port, the OS will notice after some time that the port is no longer in use and free it up again. psicopoo's answer is the correct thing to do in this case. – Chris Hayes Jan 11 '15 at 9:49
  • @ChrisHayes Thats why I put down in bold the simple fix. Because it's simple, restart the computer. I'm not the only one here, there are other good answers on this question, just simply scroll up or down to view them. I didn't find it necessary to add them in. Hope you understand. – user92092 Jan 11 '15 at 11:44
6

A currently running process is listening on port 25565 and will not give it up to the new instance of your server.

In your situation, it's likely the process that's "clogging" the port is (part of) a previous instance of your server that wasn't shut down properly.

In Windows XP, run the command prompt with Win+R>cmd. Then run the command netstat -ano to list all active connections. Find the entry whose "Local Address" is using the target port (ie: 0.0.0.0:25565) and see the PID listed on that line. That is the Process ID for the process listening/connected on that port currently. Killing that process will make the port available again.

There are a few ways to kill a process. Since we're already on the command line, I would simply type taskkill /PID %PID%, where %PID% is the PID value you obtained from netstat.

-1

Check if your IP address is correct via cmd: ipconfig

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.