Thursday, December 1, 2011

Minecraft Server Tutorial


Step by Step Guide to Starting Your Own Mine Craft Server
By Patrick Hill
Neumont University
Winter Quarter 2011
Introduction: 
Minecraft (MC), as you may already know, is a very popular and great game. MC is an open sand box style game; meaning there is an endless possibility of what your character can create, build and destroy. One of MC’s greatest abilities is being able to run on nearly any PC. Another attractive trait is the ability to run a server of the game, bringing MC gamers together in a single world. Unfortunately getting a server to run optimally and configuring your computer to allow others to connect and play isn’t automatic and requires some configuring.

By following this tutorial you will be able to setup your own server and configure your network to allow for other players to connect.


Please read the disclaimer below before continuing.

Disclaimer:
By following this tutorial, you do so at your own risk and willfully accept I, the creature of this tutorial, will not be held accountable for your actions, under any circumstances.

Overview
This tutorial will show you the following steps:
Downloading, Saving, Optimizing, Configuring, Testing and lastly Troubleshooting.

Tutorial Step by Step Process
  1. Downloading:
                                                              i.      Download the minecraft_server.jar file from HERE.
  1. Saving:
                                                              i.      I highly recommend making a new folder (Minecraft Stuff), in an easily accessible location (Desktop), for the purpose of all your MC needs; including a “MC Server” folder for the server files.
  1. Optimizing:
                                                              i.      MC is a java based game and as such is extremely CPU intensive. So any optimizations that can increase performance should not be taken lightly as they may help to significantly increase your server’s performance.
                                                            ii.      To fully optimize your MC server you will need to know your PCs RAM capacity. To do this, click on the “Start Button”, right click on “Computer” and select “Properties”. In the window that opens look for “Installed Memory/RAM”. We will be using RAM capacity’s in megabytes(MBs) so please you the follow to convert gigabytes(GB) to MBs: 1GB = 1024MB. Remember your RAM capacity as you will need it for the upcoming memory optimization.
                                                          iii.      You will want your server to use the maximum amount of RAM possible without causing any problems in Windows. This means you need to leave some RAM available for Windows and other programs. A good rule of thumb is to leave Windows 2GBs/2048MBs of RAM. So take your PCs RAM capacity and subtract 2048MBs. Use this RAM amount in the next step.
                                                          iv.      Open a “simple” word editor such as notepad or notepad ++ and copy this into it:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
                                                            v.      Now you need to replace both “1024” with the amount from the previous step.
BE SURE TO CONVERT GBs TO MBs AS MENTIONED!
It is perfectly acceptable to use odd numbers as well such as 1536 which is 1.5GB.
                                                          vi.      Now use the “save as” feature in your text editor to save this text file with any name of your choosing and adding “.bat” to the end of your file name. Such as, “My_File_Name.bat”. This makes the text file a batch file capable of starting your server with the desired memory optimizations arguments Java requires.**
  1. Configuring:
This step has the most margin for error, so please pay close attention and read the directions very carefully.
                                                              i.      Port Forwarding Introduction:
1.      In order for other PCs to connect to your MC server, your modem/router will need to allow those incoming connections. This is accomplished by opening the appropriate “port” inside your modem/router.
2.      To do this we will need to get the IP address for your modem/router. To find this click on the “Start Button”, and type “command” or “cmd” for short(without the quotes). A black window should open in which you need to type “ipconfig”, again without the quotes, and hit enter. A bunch of text will fill the window and you need to look for “Default Gateway” and “IPv4 Address”. Default gateway is the device giving your computer access (modem/router) while IPv4 Address is YOUR computers IP address. Please copy both temporarily as you will use them multiple times.
3.      Last IP needed is your external IP address or the IP address your ISP gives your modem/router. The easiest way to determine this is by using Google like THIS. Google refers to this IP as your “Public IP Address”. Copy this IP for later us as well.
4.      Open your internet browser, hopefully Firefox, and type your modem/routers IP (Gateway IP) address into the URL field and hit enter. You should be prompted with a username and password dialog. If you have your own personal modem/router you should have already setup a password when you installed the device. If not just Google “brand name default password” and be sure to replace “brand name” with the actual brand name of the device like THIS.
5.      If your ISP has provided you with a modem/router you will need to contact the IT/Technician department to receive the password. I do know Comcast broadband modems use; Username: cusadmin Password: highspeed
6.      Once you have logged into your modem/router you will need to find the port forwarding options. Since most manufacturers use different words/terms you will need to look for one of the following: Ports, Port Forwarding, Application Allowances, Gaming, Gaming and Applications or something similar. If given the choice of “Port Forwarding” or “Port Range” choose forwarding.
          • Add the port 25565 to any field asking for a port.
          • If TCP or UDP are options choose both, unless unable, then just choose TCP.

Lastly an IP address is needed to direct internet traffic for this port to a specific computer. You will need to put your computers IP address in this field.***
If required BE SURE TO SAVE ALL CHANGES.
5.                   Testing:

All the hard work is done, prepare to reap the benefits!
Navigate to your “Server” folder were you should have saved the minecraft_server.jar file along with the batch (.bat) file you created with the memory optimizations.
DOUBLE CLICK YOUR BATCH FILE. A black window with white text should be initializing the server and creating the spawn regions of the server’s newly generated map. If all went well….
Your last test it to load MC from outside your home network, let me say that again, from OUTSIDE OF YOUR HOME NETWORK. Add the server to your in game server list using your external (public) IP address you found through Google, and attempt the first connection to your server.
6.                   Troubleshooting:

Request Timed Out:
More than likely you did not port forward correctly.
Host Can Not Be Found:
Again your port forwarding is probably to blame.
Received an invalid key from server
This is a strange bug that appeared in MC 1.0.0 and has been submitted by myself along with many others. Just keep trying and you’ll get in. If after several attempts you continue to get this error, close MC and try again.
Took too long to log in:
This one is a little tricky to diagnose. I’ve had this error on my own server many times while others log in just fine. Personally I believe it to be due to Java's temperamental behavior and have yet to find a permanent fix. Rule of them, try and try again and if you don’t succeed. Close MC, reopen MC and try and try again.

*Keep in mind Windows needs Ram to operate correctly and using a number equal to or larger than your actual Ram will result in significant performance drop for the whole machine and could even lock or crash your PC.
**Other Java optimizations are available and recommended, depending on whom you’re asking, but the setting provided in the tutorial should be used as your foundation and should only be added to/altered when fully understood!
***PC IP address are often reused, even in a home network so it would be wise to look around in your router/modems options for “DHCP Reservations” or something along that lines to reserve that specific IP address to the computer running the server.

I truly hope this tutorial has helped you in some way or another. I still remember how frustrating it can be setting up your first server, but like anything else, becomes much easier over time.

Feel free to leave comments regarding this tutorial, any errors found, suggestions, improvements, etc.

Have fun and enjoy!

No comments:

Post a Comment