Minecraft Blogs / Tutorial

Minecraft Tutorial - Setting Up a Vanilla Server

  • 9,722 views, 3 today
  • 2
  • 0
  • 2
Karuzence's Avatar Karuzence
Level 30 : Artisan Pirate
52

Minecraft - Setting Up a Vanilla Server



Hello, and welcome to my Minecraft Tutorial! Today I'll be teaching you how to make a Vanilla Server. If you have any questions or concerns, leave a comment. Also, this might be removed from a site moderator. :( Even tho I spent time editing this.



Click to reveal
Questions - FAQ


Things you need to know before setting up a server:
  • Networking in general
  • Your System Configuration
  • Your Network Configuration
  • Your Router Configuration(Optional)
  • How to use and Configure your personal Firewall.


It's your choice, If you decide that making a server is too risky, you can always host a server.


Java


Windows:


1. Make sure that you have Java 7 installed. To check if you do, first you need to open up a Command Window (CMD).


2. In Windows7/Vista/XP hold the Windows key down and press R to open the Run command and type Cmd. Now that the Command Prompt is up, enter the following command and press enter. Java -version. Java should then display it's current version, similar to the following. "Java version 1.7"


3. If you get this error, "'Java' is not recognized as an Internal or External Command, operable Program or batch file.". If so then you might have the previous version of Java or it might not be in your System Path.


After you installed the lastest version of Java try again. If you still get an error, try the following to solve the
problem.


1.Go to your Start Menu.


2. Right click Computer.


3. Click properties.


4. Click "Advanced System Settings".


5. Click "Environment Variables".


6. Under System Variables, find the Path Variable.


7. Click Edit, and skip to the end, DONT delete any files, this may harm your Computer if deleted. Insert ;"c:Program FilesJavajre6bin" If you use a 32-bit Java on a 64-bit OS Insert ;"c:Program Files (x86)Javajre6bin"


Note that if you have Java 7 change jre6 to jre7.


8.Restart your Computer.


9. Now re-open Command Prompt(CMD) and try again.


__________________________________________________________________________________________


Mac OSX:


Mac OSX already comes with its own version of Java that is updated automatically.


__________________________________________________________________________________________


Lunix:


Works with Ubuntu 9.10 and Higher, and descendants of Debian. The Official Oracle Java is recommended.
Note that some have had experienced Issues with OpenJDK.


Debian:


Ensure that the non-free repository is being scanned by apt. You do this by adding non-free to your /etc/apt/sources.list files.e.g:


deb ftp.uk.debian.org/debian/ squeeze main non-free


Update your sources list (as root):


apt-get update


Then to Install Java, simply type this in terminal and press enter (as root):


apt-get install sun-java6-jre


Ubuntu:


Unfortunately, there has been some liscensing issues, so Sun Java has been removed on newly boughten computers but remain on old, so you must download it directly from Oracle, package it, and install it. Here is a script to easily use at this link. http://github.com/flexiondotorg/oab-java6 Just run the commands below, and if you have any troubles just go to the link. It may take a while to load.


cd ~/


wget https://github.com/flexiondotorg/oab-java6/raw/0.2.4/oah-java.sh -0 oab-java.sh


chmod +x oab-java.sh


sudo ./oab-java.sh


If you want to watch Progress, just run


tail -f ./oab-java.sh.log


Then, once the script has finished, run


sudo apt-get install sun-java6-jre


All other commands dont work anymore.


OpenSUSE:


On older versions, you can simply type zypper in java-1_6_0-sun into a terminal.


On newer versions, there is a tutorial, http://site.google.com/site/easylinuxtipsproject/java-for-opensuse#TOC-Get-JRE decribing how to install Java.


Arch Linux:


Open a terminal and run pacman -Sy openjdk6 as root.


Gentoo:


Use: emerge virtual/jre


Other Distros:


Alternatively, you can visit Java's website http://www.java.com/en/download/manual.jsp to download the Java package. Instructions for the installation of 32-bit and 64-bit packages are given on the site.
If during this installation, it ask for a password, enter your password. If you get asked "Is this OK[Y/N]" Enter Y and press enter if required. Java should now be installed.


__________________________________________________________________________________________


Setting up the Minecraft Server:


Windows Instructions:


.exe version:


1. Double click on the "Minecraft_Server.exe" You can get that from here, http://www.minecraft.net


2. Upon its initial start, it may say error messages like "File not found", this is normal, because the files are being created.


3. After the first start, you'll probably want to shut it down, to do so enter stop in the server command window, and then edit some configuration files.


.jar version:


1. Download the "Minecraft_Server.jar" or change "Minecraft_Server.exe" by right clicking it and clicking rename, then by entering Minecraft_Server.jar


2. To start the jar version, create a new file in Notepad.


3(Optional). On the very first line add in @echo off


4. On the next line write for Java 7 users


path=%PATH%;%ProgramFiles(x86)%Javajre7bin


And for Java 6 users write


path=%PATH%;%Program Files(x86)Javajre6bin


If there is problems with them then try one of these,


path=%PATH%;%ProgramFiles%Javajre7bin


path=%PATH%;%c:"Program Files"Javajre6bin


5. Finally make sure on the last line you have


java -Xms512M -Xmx1G -jar minecraft_server.jar


6. Save the file as startserver.bat, and place the file in the same folder as minecraft_server.jar.


Note that the .bat extension saves the file as a batch file.


.jar Path Modification:


1.Go to your Start Menu.


2. Right click Computer.


3. Click properties.


4. Click "Advanced System Settings".


5. Click "Environment Variables".


6. Under System Variables, find the Path Variable.


7. Click Edit, and skip to the end, DONT delete any files, this may harm your Computer if deleted. Insert (If not already) ;"c:Program FilesJavajre6bin" If you use a 32-bit Java on a 64-bit OS insert ;"c:Program Files (x86)Javajre6bin"
Note to change jre6 to jre7 if your using Java 7.


8. Exit by clicking "OK", then exit the rest.


9. Double click startserver.bat


10. Upon its initial start, it may say error messages too, like "File not found", this is normal, because the files are being created.


11. After the first start, you'll probably want to shut it down, to do so enter stop in the server command window, and then you can edit some configuration files.


__________________________________________________________________________________________


Mac OS X Instructions:
  • Create a folder, if you haven't already, and place 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 then paste in the following:
    #!/bin/bash
    cd "$(dirname "$0")"
    exec java -Xmx1G -Xms1G - jar minecraft_server.jar
  • Save the file as "start.command" in the same folder as minecraft_server.jar.
  • Open Terminal (in /Applications/Utilities/Terminal).
  • Grant execute permissions on file start.command to Owner, Group. and Public. To do so, type in chmod a+x , with a space after it. Drag and drop the start.command file into the terminal window, and then press enter.
    Note that this gives run permission to the start.command script.
  • Double-click the start.command file to start your server.
  • A new Terminal window will open and, for the first time you run the script, several error messages about missing files/directories will appear. This is normal, Now your ready to configure your server.


__________________________________________________________________________________________


Linux Instructions:


Open the Terminal, Applications > Accssories > Terminal Enter the following commands, substituting 'minecraft_server' with the name of the folder you extracted the server to:


cd minecraft_server


java -Xms1G -Xmx1G -jar minecraft_server.jar nogui


Note that if you have less than 1024MB RAM, the above line may cause problems with swapping and out of memory conditions, which makes the game hard to play.


cd minecraft_server


java -Xms1G -Xmx1G -jar minecraft_server.jar nogui


free -m


Subtract some RAM as safety. Use this code


java -Xms1536M -Xmx1536 -jar minecraft_server.jar nogui


Now it should run smoothly. If you want to spare more memory, you may set the -Xms parameters even lower, say:


java -Xms32M -Xmx512M -jar minecraft_server.jar nogui


Note that the parameter controls how much memory is reserved on startup. Your server will start with 32MD RAM and whenever it needs more memory it will allocate some untill it reaches the maximum of 512 MB. However, this will result in a little slowdown whenever the allocation is done.


__________________________________________________________________________________________


Configuring:


1. You can configure your server by editing the server.porperties file.


Note to open it with a text editor that does not add formatting.


2. Add your username to the admin.txt and/or ops.txt.
  • Ops.txt and admin.txt determine who can use server commands. In other means, "op" means operator privileges. They also allow you to control certain aspects of the game, like time/day, teleporting Players, giving items, etc.
  • Op privileges can also be granted from the server GUI(Window) by using "op ", for example, "Op Karuznece".


__________________________________________________________________________________________


Connecting to Your Server:


If you play on the same machine on which the server is running, Select the "Multiplayer" option in the via


minecraft game client, click direct connect, and then type in "localhost" instead of the IP address,


there may be issues with this command so it's not completely recommended.


__________________________________________________________________________________________


FAQ - Questions:


Have a question? No problem, ask in the comments or give me a PM(Private Message), I'll try to help as much as


I can.


You can also message me at MinecraftActionNinja@gmail.com , Yes I know, my gmail is completely random.


__________________________________________________________________________________________


Well that was the end of my tutorial, I hoped you all liked it!

Also Mojang helped me on making this =) so I didn't completely do the whole thing.
CreditKaruzence, Mojang =D
Tags

Create an account or sign in to comment.

1
07/22/2012 11:06 pm
Level 46 : Master Blob
bliipyblob
bliipyblob's Avatar
Wooooooow thats long :O
1
07/31/2012 11:35 pm
Level 30 : Artisan Pirate
Karuzence
Karuzence's Avatar
Lolz :P Kinda. It's just the Vanilla server part. I still havn't decieded on putting a CraftBukkit Server Instructions, Maintaining your server, and how to portforward or use Hamachi. :o
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome