This guide shows you how to set up a personal Minecraft server on a VPS running Debian 7 or Ubuntu 14.04 LTS.
To use a Minecraft server you must also have a version of the game client from Minecraft.net.
Begin by updating your VPS software:
sudo apt-get update && sudo apt-get upgrade
Install OpenJDK, an open-source implementation of Java:
sudo apt-get install openjdk-7-jre-headless
Create a new user for Minecraft to run as. Take note of the password you assign:
sudo adduser minecraft
If you have a firewall configured according to our Securing Your Server guide, you will need to add an exception for port 25565. The line to add to your
1 -A INPUT -p tcp --dport 25565 -j ACCEPT
Exit your SSH session and log back in to your VPS as the
Download the latest version of the Minecraft Multiplayer Server from Minecraft.net. The current version as of this publication is 1.8.8. Refer to the linked page to download the latest version:
Create a script to run the Minecraft server:
1 2 3 4 5
#!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" java -Xms512M -Xmx1000M -jar minecraft_server.1.8.8.jar -o true
Xmxflags define the minimum and maximum amount of RAM the Minecraft server will use. The settings above are recommended for a VPS 1GB used solely for this purpose. Adjust these values to fit your needs.
chmod +x run.sh
The first time you run the Minecraft server it will create an EULA file and then exit:
1 2 3 4 5 6 7 8
$ ./run.sh [21:39:43] [Server thread/INFO]: Starting minecraft server version 1.8.8 [21:39:43] [Server thread/INFO]: Loading properties [21:39:43] [Server thread/WARN]: server.properties does not exist [21:39:43] [Server thread/INFO]: Generating new properties file [21:39:43] [Server thread/WARN]: Failed to load eula.txt [21:39:43] [Server thread/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info. [21:39:43] [Server thread/INFO]: Stopping server
eula.txtfile and change the value of
1 2 3
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). #Tue Jan 27 21:40:00 UTC 2015 eula=true
To ensure that the Minecraft server runs, dependent of an SSH connection, execute
run.shfrom within a GNU Screen session:
This time the Minecraft server console will generate a lot of output as it creates required text files and generates the Minecraft world:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[22:00:06] [Server thread/INFO]: Starting minecraft server version 1.8.8 [22:00:06] [Server thread/INFO]: Loading properties [22:00:06] [Server thread/INFO]: Default game type: SURVIVAL [22:00:06] [Server thread/INFO]: Generating keypair [22:00:07] [Server thread/INFO]: Starting Minecraft server on *:25565 .... [22:00:07] [Server thread/INFO]: Preparing level "world" [22:00:08] [Server thread/INFO]: Preparing start region for level 0 [22:00:09] [Server thread/INFO]: Preparing spawn area: 3% .... [22:00:21] [Server thread/INFO]: Preparing spawn area: 96% [22:00:22] [Server thread/INFO]: Done (14.737s)! For help, type "help" or "?"
Connecting to your Minecraft Server
Open your local Minecraft client. After logging in, click on the Multiplayer option:
Click on Add server and enter your VPS IP address or domain name. When you’re finished click Done.
Your server is now available to connect to. Click Join Server to connect:
Congratulations! You can now play Minecraft in a persistent world with your friends.
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.+