The Complete Guide to Set Up a Minecraft Server

Minecraft is one of the most engrossing PC games to come out in the last few years, and with the semi-recent additions to SMP mode, it’s more fun than ever to host your own custom server. Getting the basic server up and running isn’t that difficult, but that’s only part of the picture. Once the software is running, you’ve still got to set up dynamic DNS, port forwarding, and user control. And when THAT’S done, you’ve got to configure the game itself. In this guide, we’re going to cover all of that in enough detail to get you and your server up and running with as little hassle as possible.

Note: The exact step-by-step procedure can vary from one OS to another. Whenever possible we will include details enough to work everywhere, but it’s possible your system may not behave exactly as indicated here. Additionally, Minecraft is still in development and is currently in Beta 1.4. Some of this information may change over time.

Basic Server Startup

While there is a Windows-format .exe file to run the server, all platforms can use the .jar file identically, therefor this guide will cover the .jar method. You will of course need a working Java installation on the machine which will be running Minecraft. For best performance and stability, Linux users are encouraged to use the official Java runtime instead of an open alternative.

If Java is installed and the .jar file is downloaded to an appropriate location, open up your command prompt/terminal to the location where you saved the .jar file. You’ll want to make sure the file is in its own directory, as it will generate several other files and directories the first time it is run.

To launch the server, enter the following command (all OSes):

At this point, the server will generate the needed config files as well as a base world for players to join.

minecraftserver-firstrun

Configuring the Server

You may be tempted to load up the client and play right away, but at this point, nothing is configured. Shut down the server and take a look at the .jar file’s directory again, and you’ll see several new files.

minecraftserver-afterfirstrun

Most are pretty self-descriptive. But for the sake of being thorough, here’s a summary:

  • world – Directory containing map data
  • banned-ips.txt – List of IP addresses specifically banned from connection
  • ops.txt – List of Operator (admin) names
  • server.properties – Main server configuration file
  • banned-players.txt – List of banned players by name
  • server.log – Server’s log file
  • white-list.txt – List of players specifically allowed via whitelisting

The one we’re most concerned with is server.properties. This file holds pretty much all the configuration options the server allows. The default one looks something like this, but with comments added for clarity.

External Access

If you’re attempting to run this on a home broadband connection, you likely have a few extra steps you’ll need to take before anyone but you can access your server. First, you’ll need to know if you need port forwarding. In short, anything running as a server on your computer binds itself to a certain port number. That way, any data coming into that computer labeled with that port number will be routed to the correct program. If you’re behind a home router, the router must be made aware that you’re running a server so that all incoming data on that port goes to the right computer.

Still with me? Port forwarding can be tricky but here’s a summary of how to get the job done. If it’s not enough, here’s a great site devoted entirely to helping with this task.

For starters, we’ll need to know the IP address of the Minecraft server. There are a dozen ways to do that graphically depending on your OS, so here are two ways that’ll work on any major OS from the command line:

On home networks, it’ll likely start with 192.168.x.x. Take note of this as the server’s IP. Your router’s IP is likely very similar, but replace the final number in the set with a 1. For example, if ifconfig showed you 192.168.1.50, your router’s IP is likely to be 192.168.1.1.

Now that we’ve got the server IP and a good guess at the router’s IP, open a new tab in your web browser and enter the router’s IP into the address bar (once again, likely 192.168.1.1 or 192.168.0.1). Chances are you’ll face a login screen. If you don’t know the password, try using the factory login.

Once you’ve got logged into your router, look around for NAT, Virtual Server, or Port Forward settings and enter the IP and port of your server as required.

minecraftserver-portforward

Once again I highly recommend PortForward.com if you run into any trouble.

Dynamic DNS

Most home broadband users have a dynamic IP address, meaning it changes every so often. For people to be able to easily access your server, you’ll need to have a good name they can always access instead of an ever-changing IP. That’s where dynamic DNS comes in. When you sign up with a (often free) dynamic DNS provider, they give you a name like myserver.dyndnsprovider.com. You run a small client program on your server that connects to the provider every so often and informs them of any changes to your IP. Whenever someone accesses the name, they forward the request to your current IP.

There are several such providers out there, but this author has always had good luck with No-IP.com. Signup is quick and free and they provide client software for every major OS.

Additionally, some routers and modems have built-in support for many popular dynamic DNS providers. It may be worthwhile to check your device before trying to install local client software, as it could save you a lot of headache.

Conclusion

It may have taken a little bit of time, but hopefully at this point you’ve got a solid server up and running. Setting up any server can be a hassle. This one, at least, is all but guaranteed to keep you and your friends entertained for quite some time.

66 comments

  1. Hello, I have tried your guide, which, by the way, is marvellous, anyway, I have tried it and when I attempt logon, it feeds me the message : “Failed to verify username”.

    • Thanks, and there are a few things that come to mind about what may be causing your problem.

      First – Do you have a valid account with Minecraft? Your server will check with the Minecraft.net server to authenticate users, even you.

      Second – If you wish, you can edit your server.properties and set online-mode to false. This will disable the authentication checking mentioned above.

      I haven’t toyed around much with offline mode, but if I understand it correctly, that may make it more difficult to update the software when new versions are released (and you WILL want 1.6)

  2. I am currently using 1.5_02 and I’ve tried many different ways of creating a server. Hamachi, official, dedicated pirated – you name it. But I want me and a dew buddies to play on our own little server, and if I can’t log in…. ( I type in localhost cuz I am hosting this server on my computer.)

    • Edit : I tried the online-mode=false.
      Message comes out : “You are not white-listed on this server” . Wrote my name in the white-list txt didn’t work

      • And you have white-list=false in properties?

        The only situations I’ve ever encountered with login failure were caused by either a genuinely bad login (which I’ll assume isn’t the problem), local server unable to communicate with minecraft.net, or the occasional short-term glitch after logging in/out repeatedly in a short time.

        Occasionally minecraft.net itself goes down and all logins fail, but it sounds like you’ve been having this problem for a while?

    • I made it owrk last night. A couple of people joined. But now on the next day……No one can join. “Timed out”.
      Also my no-ip.com host doesn’t work at all.

  3. 24/7 hamachi server!
    Join the best role playing server ever! All the stuff you can wish for in just 1 world!
    Features:
    Anti-Grief
    Money System
    Anti-TNT
    Accepting Admins
    Custom Spawn
    Lock you’re houses and chests
    And WAYYY more features in game!
    IP: 5.220.146.134
    Hamachi ID: Jukili1-5
    Password: 123

  4. I set up the server fine and im using a mac, but every time im not on my mac goes into sleep mode and the server goes down, disconnecting anyone who is online. How do i keep it running through sleep mode?

    • I don’t see how it could keep keep running THROUGH sleep mode, as sleep means the disk and cpu and basically inactive.  If you want the server to run all the time, then sleep will have to be disabled.  

      Your BIOS might have a “wake on LAN” feature that could help if you REALLY want to keep sleep going, but the minecraft will only be running when the server is fully powered.  

    • lolz, you have to desable sleep mode or have the server run somewhere other than on your computer.

  5. Hello, I have problem with logging in to my server after I’v restarted my computer. I think i know why and that is because my ip is changed every time i start my comp, but i still wonder if there is a solution to my problem and i beg of you to help me because it seems you know alot about minecraft!

    • I don’t know how to solve the problem with your IP changing every time, but it shouldn’t effect YOU too much. If you’re running it from your own network just typing in localhost in the multiplayer IP text box should take you to your server. For other people not on your network to join is a whole different story.

    • run Himachi. Use the IP address provided by this service. You weill never have to worry about incorrect IP parameters ever again. :D Very easy setup

  6. hi my friend has a server we are all finished with it the port and ip all of that stuff but how to i unwhitelist it?
    if u know how please tell me cause i cant get on when its whitelisted :(

    • Whitelisting is an option in the server.properties file shown above.  You (or whoever runs your server) can just set white-list=false, as shown in the “Configuring the Server” portion.  

    • Make different server folders.  For each server, put a different port number in its server.properties file.  Then to connect, use that port at the end of your address.
      Example:
      These are your servers:
      C:mc_serversserver-a…
      C:mc_serversserver-b…

      “…server-aserver.properties” uses port 25565 (default)
      “…server-bserver.properties” uses port 25556

      To connect to each server, you would type (in Minecraft):
      123.456.0.4:25565 for server-a (since it is the default, 123.456.0.4 would also work).
      123.456.0.4.25556 for server-b
      Of course, fill in your IP address or URL (eg: mc.obsidian.com) instead of the one I made up.

    • Yes, you can, but it would not be advised if your A) playing the game, or B) using a computer that scales to moderate specifications. i.e. If your computer has lower than a Duo core processor. Servers take up a lot of resources and if your not cautious, a fried system can become apparent.

    • Because most of the time, the game can figure out the appropriate address, and if you were to fill in a local IP (ie 192.168.1.10 oe 127.0.0.1) when it wanted a public ip (63.72.221.19) or vice versa, things could get crazy.  

      I’ve been running a server accessible to internal and external clients for about a year, and never had to mess with the IP field.  

    • I actually just use Himachi to generate a public IP. Himachi is a type of VPN service, so it uses your actual IP address, but masks it with a whole new IP to allow for security. This designated IP address provided by Himachi is what you would use for the IP configuration. Give the address to anyone you want. ;)

  7. I’m using a hardwired comp and I cannot port forward because I don’t have a LAN. Can I still host?

    • Any time you open/forward a port it’s potentially a security risk.  

      I’m no security expert, not by a long shot, but I would consider it a minimal risk in this case.  The port’s traffic will be received by minecraft and so far I haven’t heard of it causing any security problems.  

  8. When i put “java -Xmx1024M -Xms1024M -jar minecraft_server.jar” into my command prompt(no “”s) it says java is recognized as an internal or external command. Help!

    • First put:
      cd *Location of folder* (without the *)

      then after that put “java -Xmx1024M…”

    • That just means that the java executable (java.exe) is not in the command path.

      Even if you don’t understand any of that, it’s no big deal.  You just need to write the full path to that file along with the command.  On windows it’d be something like

      c:pathtojava.exe -Xmx1024m… etc

  9. Can someone send me some goood information about setting up a local minecraft server?
    I have tried severeal things but i cant get a local server. It says Connection refused connect. I have opened port number 25565 to TCP send the IP of the server ( 192.168.2.15:25565 ) and then it says Connection refused connect. So please someone send me some good information.

    joeyschroder@hotmail:disqus .com
     Thanks

    • You mean it’s saying something like “Java is not recognized as an internal or external command?”

      If so, read the comment a few spots below this which addresses the same question. 

      • I get this error when my buddy disconnects from our private server. He is the host and when he leaves, the game obviously becomes unstable and causes The Java runtime error.

  10. Hi. 
    I would like to host a minecraft server. I downloaded the minecraft_server.jar file from minecraft.net.The server seems to work fine, but when I try to log in, it takes a really long time and then I get disconnected by the server. In the server log, I can see that I failed to log in.
    I think the problem is in RAM, even though the server didnt inform me about low RAM limits.
    I tried to write the command from above, but it doesnt work. The terminal keeps on telling me that the directory java doesnt exist. I just cant figure out what exactly is the name of the directory. What should I type, when my java is placed in home/user/.java? (I use Linux Mint 10)

    Thanks a lot, I would really appreciate your help.

    • I managed to fix the RAM problem, but I still can not log in. I didnt set the port forwarding yet, because I will be using the server just from my home network. Maybe the problems are caused by that?
      Please help

      • To make sure there’s no misunderstanding – you do still need (even for a local game/server) to have a valid minecraft login ID as purchased from Mojang.  You’ve got that right?  

        • Yes, I bought the premium account. I can connect to official minecraft servers hosted by other people without any problems.

          • Hmm tough one.  

            So you’ve downloaded the jar, edited the config and launched the server on one machine, and when you attempt to connect to it over the LAN from another machine you get a login error?  

            Are you pointing to the server by IP or hostname?  Did you change the port in server.properties or is it still at 25565?  Have you tried including the port number when connecting, ie “192.168.1.10:25565”?

          • OK, the server just started working. I just moved it to a different directory, and now it works fine. But I still have no idea what went wrong.
            Thank you very much for the tutorial, it was very helpful.

    • I believe your java error is comming from a game and/or java script downloaded by the wrong bit. If your running a 32-bit, then make sure your have a java 32-bit. I have unzipped my Minecraft (cracked) 1.9.6 prerelease and done so with wrar.exe. My unzipping tool was in a different bit format then I needed.. I am still able to play, but I will come across errors in the future do to the incorrect bit. As For your Java issue. You can find Java.exe in the System32 file directory. 

  11. Hi everyone,

    Here is what I have going on and I can’t get other friends to join in a multiplayer server.  I use the windows minecraft-server.exe that is on the download section of the MC site.  

    I host the server from a laptop and I play the game from this same laptop.  I am able to port forward through my router (although I have 2 routers – 1 is a wireless and does not lease out the IP addresses and the second is the one connected to my cable modem which gives out the IP)

    When I launch the server and then launch the game as a direct connection I type in localhost and I am able to see the world that I have created and the options that I have made in server-properties and the server shows that I have logged on.

    So I thought that I could give out my actual IP address (not the 192.168.#.# ) with :25565 at the end.  This doesn’t work.  

    What am I doing wrong?  Thanks so much for your help!!

    Regards,
    Walt

  12. Hi guys,
    im a father of two boys who really wants their own server on minecraft.
    I have downloaded the server, checked so my port is forwarded and open 25565. And thats ok.
    I can connect from my computer that runs the server, but when the kids try to connect the server says: lost connection…? Any one can please help us?

    Below the settings in server properties, anything wrong there?
    #Minecraft server properties#Mon Feb 20 15:07:57 CET 2012allow-nether=truelevel-name=worldenable-query=falseallow-flight=falseserver-port=25565level-type=DEFAULTenable-rcon=falselevel-seed=server-ip=spawn-npcs=truewhite-list=falsespawn-animals=trueonline-mode=truepvp=truedifficulty=1gamemode=0max-players=20spawn-monsters=truegenerate-structures=trueview-distance=10motd=A Minecraft Server

    Of course we have bought the game.
    And checked so we have the right IP number(port forwarded to the laptop running the service)
    Please helup us,
    thanks.
    From Sweden

      • Hi Josh,
        i have turned both my windows firewall and my antivirus prog off.
        I can join the server from my computer but the kids cant reach it?
        Anything else i could do?

        • Ok let’s go over this a step at a time to make sure I’ve got this.  

          You’ve got the server software running (on Windows it sounds like) and the server starts up fine.  If you run a game client from that same machine it works fine right?  What name/address do you enter in the server field?

          Now, when you run the game client on other (windows?) computers, they see the local server (by name or ip?) but when you attempt to log in, you get “lost connection”.

          yes?

          If you’ve checked all your network/firewall stuff, my next guess would be to make sure you’ve got the newest Java version running on the server and it’s it’s for the correct cpu type (32/64)

    • you will need multiple copies to play online mode, or turn server to offline mode then DL hamachi or other network software to play on lan, offline mode will mean all players are called player, except for original account will have acc name. you may need a name changer prog ( i have no idea how) otherwise it will boot players everytme they log in for having the same name e.g player entered game, player was dissconnected, player joined game.

  13. Every time i stop my server i need to change the port because it says perhaps theres a server already running on that port what do i do to fix that

  14. my ip address is 173.48.247.229  whenevr i try and check if its running it says that it is closed.ive done most websites hav told me to do but it still does not work. cood you help me please thx

    • What are you using to test that port?  

      Are you behind a router/firewall?

      If so, you say you’ve forwarded your external ip (173.48…) to your internal IP (192.168…)?

  15. ===================================================================
    ===================================================================
    soooooo my external ip is 124.168………. and my router ip is 192.168…… sooo which one do i put in to the portforwarding and which 4 the server properties ip????????

    i tryed putting 192.168….. for my server properties ip and the same for the router portforwarding ip…

    but im wondering if this will be public and what ip i use to connect???????

    plz help!!!
    or tell me what the hell u did coz using this ip has not worked publicly! only locally.. :-(
    ======================================================================
    ======================================================================

  16. How do you reconfigure the server so the multiplayer game is in creative mode?   I changed server properties but it doesnt take effect in the game.

    • yeah this can be kinda confusing – creative is a PLAYER setting, not a world or server setting.  

      What I mean is, players can set their own mode (creative, survival) and it has no bearing on other players or the world/server overall.  

      If I’m on my multiplayer server in creative mode, my friend can be right next to me in the same world but in survival.  You can switch back and forth at will with / commands.   It used to be 

      /gamemode (playername) 0     # for survival
      /gamemode (playername) 1     # for creative

      but I think you can use /survival and /creative now.  

      I’m actually a little out of the loop when it comes to newer versions so if you don’t have much luck with any of this, browse your server.properties for appropriate settings.  

  17. My question is, do you really need a good upload speed for players to play on your home made server?

    • It certainly helps.  For a while, I was running a server for a while from a home connection which only had about 512k upload speed and many players reported a noticeable lag when placing and destroying blocks.  

      I don’t have any hard numbers for you but I’d guess you’d want at least 1m upload speed (which is usually much less than your download speed) for a small group of players.  Of course, the more the better.  

      • what about upload speed of 2 and decent download speed of 25 would that do the trick for maybe 80 less players?

Comments are closed.

Sponsored Stories