Tutorials/Setting up a server

= Windows =

Verifying and Installing the Latest Java

 * 1. Make sure that you have Java 6 installed. To do so first we need to open up CMD.
 * In Vista/7 open the start menu and enter cmd in the search field, and press enter.
 * In XP open the start menu and click Run, then enter cmd and press enter. You can also hold the Windows key down and press R to open Run.
 * At the command prompt, enter the following command, and press enter:
 * Java then should display it's version, and should read "java version 1.6"
 * 2. If you have a previous version (less than 1.6) or you get this error: " ", then you need to install/update the computers java version. You can do so at the java download page
 * 3. After you installed the latest java try again with.
 * If you get an error at this point, try the following to add java to your system path.
 * Right click Computer
 * Click properties
 * Click "Advanced system settings"
 * Click "Environment Variables"
 * Under system variables, find the Path variable
 * Click edit, and append to the end of the value: ";C:\Program Files (x86)\Java\jre6\bin"
 * Now re-open the command prompt and try again.

Download the Minecraft Server
Download minecraft_server.exe from the Minecraft multiplayer page or  download custom server software elsewhere.

Start the Minecraft Server
Double click on the "Minecraft_Server.exe" The server should start.

Configure the Minecraft Server

 * 1. Configure the server by editing the server.properties.
 * 2. Add your username to the admin.txt and op.txt. Admin.txt allows you to execute server commands, and op privileges allows you to destroy/place blocks.
 * 3. If your computer is connected to a router, open and forward the port that is set for use with the server (The default is 25565). For help with port forwarding, portforward.com is a good source, alternatively one can read the documentation supplied with the router, modem, or other ISP related hardware.
 * 4. Verify the port is open and note your external IP by using a open port check tool.

Connect to the Minecraft Server
To test your server (even if the ports aren't open), select the "Multiplayer" option in the game client (or browser client), and type in "localhost".

To allow yourself and other players to destroy and build blocks, add their user names to the ops test document.

For people connecting from the internet, they must connect using your external IP. This can be found using the open port check tool mentioned earlier. The port must show as open for these users to connect.

For more information about how to run and maintain a server check Maintaining a server.

If all else fails, the official Minecraft forums have users with information and tutorials for hosting servers.

= Linux = This tutorial for how to set up a Minecraft server on Linux was designed for people who don't have a lot of experience with Linux. There is a more advanced tutorial in the forums. This tutorial was tested on Ubuntu 9.10 32-bit but should work with the descendants of Debian.

Verifying Java version
This step is pretty much the same as in Windows. Open the terminal from Applications > Accessories > Terminal. Enter. It should look something similar to this screenshot from Windows:

Make sure that you got version 1.6 (marked with a red box in the image)

Installing Java
If you get  (which may be followed by more text) or if you do have another java version than 1.6 then you need to install java. Simply type this in terminal and press enter:

(Note: In Fedora and Red Hat you use )

If it asks for a password enter your password. If you get asked "Is this OK [y/n]" Enter Y and press enter if required.

Java is now installed

Setting up the Minecraft Server
Download the latest Minecraft server here.

Create a new folder in your home folder (Places > Home) called "minecraft_server" or something similar. Extract the contents of the .zip file to this folder.

To change the server settings edit the Server.properties file.

Start the Minecraft server
Open the terminal again (Applications > Accessories > Terminal). Enter the following commands: (change minecraft_server to the same name of the folder you extracted the server to)

Startup and maintenance script
Alternatively you can automate the startup of the Minecraft server.

Server_startup_script

= Mac OS X = Setting a server up in Mac OS X is "more involved" than in Windows because Notch has not provided an executable.

Installing Java
Mac OS X already comes with its own version of Java that is updated automatically via Software Update (Apple menu > Software Update).

Setting up the Minecraft Server
  Download the latest version of minecraft_server.jar from here   Create a folder and put minecraft_server.jar into it. For example, create a folder on the Desktop named minecraft_server and drag the jar file into it.  Open TextEdit, set the format to plain text (Format > Make Plain Text), copy and paste in the following code, and save the file as "start.command" in the same folder as minecraft_server.jar. cd `dirname $0` java -Xmx1G -Xms1G -jar minecraft_server.jar This will give the server enough RAM to run. The amount of RAM can be changed by editing the  to something else, such as   for 2 GB.   Open Terminal (in /Applications/Utilities/Terminal). Type in, with a space after it, then drag and drop the start.command file into the terminal window, then press enter. (This gives run permission to the script.)   Double-click the start.command file to start the server.
 * 1) !/bin/bash

Next, set up port mapping by following the directions below.

For server settings, see the relevant steps in the section Configure the Minecraft Server, but skip the port forwarding steps if you followed the port mapping directions below.

Setting up Port Mapping
A server behind a router requires port mapping (also called port forwarding) to allow others to connect to it over the Internet. This is very easy because most routers support automatic port mapping:


 * 1) Download and run Port Map.
 * 2) Add a mapping with the local port and public desired port set to 25565 (the  default).
 * 3) Give it an optional description such as "Minecraft".

Run Port Map each time you run the minecraft server if you want it to be reachable over the Internet.

You can keep minecraft_server.jar and Port Map.app in the same folder for convenience.

= Reporting problems in the forum = Before you can ask for help in the forums make sure that your problems is not listed in the Common Problems

If your problem is not listed you can create a new thread asking for help in the Server Administration Make sure to include as much information as possible:
 * Operating system
 * What you were trying to do
 * What you did so far
 * Any errors you encountered
 * Screenshots of the problem (if possible)

= Other tutorials = Here are some other tutorials on how to set up a Minecraft server. Linux tutorial for more advanced users Windows tutorial with focus on how to forward a port Guide to setting up an alpha server using Virtualbox.