how to host a minecraft server on a debian 8 vps

Covers the general process of setting up a basic Minecraft server from start to finish. Along with how to configure some of the server’s properties and user permissions.

  • Uses Java (OpenJDK in this case) as a dependency.
  • Requires GNU Screen to maintain a shell session.
  • The Minecraft game client is necessary to test access to the server.
  • Suitable Server Hardware specifications are addressed.

Check out: Minecraft’s Official Website

Reading: how to host a minecraft server on a debian 8 vps

1 – Update System Packages

Ensure the packages are up to date on the system with the command:

[alert-announce]

  1. $ sudo apt-get update && sudo apt-get upgrade

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Confirm the action by entering y for any prompts in this step.

2 — Install Screen

Screen is used to keep the Minecraft server running in a persistent shell session, it also allows us to disconnect or re-attach to the session when needed.

[alert-announce]

  1. $ sudo apt-get install screen

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

3 – Install Open JDK

Install the open JDK platform with Debian’s package manager:

[alert-announce]

  1. $ sudo apt-get install openjdk-7-jre-headless

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Note: “It is recommended that Linux users avoid using OpenJDK 6 for server hosting, as it has been known to cause issues.”

4 – Create Dedicated User

Add a user with a suitable name who’ll run and store the server software in its home directory:

[alert-announce]

  1. $ sudo adduser minecraft

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

5 – iptables Firewall

If using iptables you’ll need to allow access on the Minecraft server’s TCP port 25565 for incoming connecting clients.

Here is one command to add this, tweak it to your own needs and firewall setup:

[alert-announce]

  1. $ sudo iptables -I INPUT 3 -p tcp -dport 25565 -j ACCEPT -m comment -comment “allow connections on port 25565 Minecraft server”

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Remember to re-save your updated rules (IPv4 in my case).

[alert-announce]

  1. $ sudo iptables-save > /etc/iptables/rules.v4

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

6 – Download Minecraft Server Software

SSH to the new minecraft user (or whatever you named them).

[alert-announce]

  1. $ ssh [email protected]

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Download the latest version of the Minecraft server jar file.

The current version number is 1.8.8 at the time of writing this:

[alert-announce]

  1. $ wget -v wtbblue.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Note: Amend your command to include the version number that is currently in release. Previously found at wtbblue.com/download towards the bottom of the page.

7 – Create Minecraft Executable Script

With a text editor create a shell script named something similar to the following:

[alert-announce]

  1. $ vim wtbblue.com

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

In the newly created script add the code in the next snippet, replacing the two java parameter values with your own preferred memory usage values.

[alert-announce]

Related: How To Make A Bud Switch In Minecraft, Tutorials/Block Update Detector

~/run-minecraft-server.sh

  1. #!/bin/bash

  2. BINDIR=$(dirname “$(readlink -fn “$0″)”)
  3. cd “$BINDIR”

  4. java -Xmx1024M -Xms1024M -jar minecraft_server.*.*.*.jar nogui

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

See the next image for recommendations on server requirements from the official Minecraft wiki, to determine your values.

minecraft wiki

Note: Xms256M dictates the lowest amount of system memory the Minecraft server will consume, and Xmx512M specifies the upper limit of server memory it can max out at.

Save your changes to the script and exit back to the command line.

Finally in this step use chmod to make the previous script executable.

[alert-announce]

  1. $ chmod +x wtbblue.com

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

8 – Run Executable Script

Run it from the command line by adding the ./ prefix.

[alert-announce]

  1. $ ./run-minecraft-server.sh

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

You’ll see the following output if the script has been written correctly:

[alert-announce]

  1. [09:10:50] [Server thread/INFO]: Starting minecraft server version 1.8.8
  2. [09:10:50] [Server thread/WARN]: To start the server with more ram, launch it as “java -Xmx1024M -Xms1024M -jar wtbblue.com”
  3. [09:10:50] [Server thread/INFO]: Loading properties
  4. [09:10:50] [Server thread/WARN]: wtbblue.comerties does not exist
  5. [09:10:50] [Server thread/INFO]: Generating new properties file
  6. [09:10:50] [Server thread/WARN]: Failed to load wtbblue.com
  7. [09:10:50] [Server thread/INFO]: You need to agree to the EULA in order to run the server. Go to wtbblue.com for more info.
  8. [09:10:50] [Server thread/INFO]: Stopping server
  9. [09:10:50] [Server Shutdown Thread/INFO]: Stopping server

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

9 – Agree to EULA

The EULA you must agree to is located in the same user’s home directory.

Again using a text editor open it for writing:

[alert-announce]

  1. $ vim wtbblue.com

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Set the eula directive to true like in the example below:

[alert-announce]

  1. #By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
  2. #Mon Oct 05 09:10:50 EDT 2015
  3. eula=true

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Save changes and exit the text editor.

Back on the command line begin a screen session by providing the full path to your executable script:

[alert-announce]

  1. $ screen ./run-minecraft-server.sh

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

The server now runs and begins to generate the in-game content.

10 – Client Connections

The server should now be running continually and Minecraft clients can connect to it.

Connect with a Minecraft client to the server IP.

Everything should be functioning as intended, and the server is ready for use!

You can leave and detach from the screen session by pressing CTRL + d then a on your keyboard, back in the terminal.

11 – Administration

Logged in once again as the Linux user minecraft or whatever you chose to call your dedicated user, re-attach to the minecraft screen session from earlier with:

[alert-announce]

  1. $ screen -r

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Shut down the server which saves player created progress and the in-game content.

[alert-announce]

  1. /stop

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Now the server has been stopped you can begin to play around with its file structure.

[alert-announce]

  1. $ ls

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

There are several key files in in regards to maintaining the server, and two other directories to consider.

Any time you modify these files while the game is running, you will need to stop and restart the server for the changes to take effect.

ops.json

This file named wtbblue.com contains usernames of players that have ops privileges on your server.

It is empty until you add player usernames however.

Warning: Players listed in this file can change their game mode, input certain commands, and ban or unban other players from the server.

You can either add user details directly to this .json file, if you understand the formatting involved.

Or create a completely separate wtbblue.com file with a list of usernames inside.

[alert-announce]

  1. $ vim ~/ops.txt

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

The text file you create is then converted into the wtbblue.com file from earlier once the server is next booted.

It is recommended that you follow this method if you are unfamiliar with JSON formatting.

For more information on ops or operators in Minecraft click the next link: Minecraft Wiki Operators Page

server.properties

The bulk of in-game settings and properties are stored in the following text file.

[alert-announce]

  1. $ vim ~/server.properties

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

There are a longer list of properties you can add to the file that are listed at this next URL: Minecraft Wiki wtbblue.comerties Page

wtbblue.com & wtbblue.com

In order to ban an IP address from connecting to the server, the full IP address must be specified; – impartial addresses or wildcards are not supported here.

Any players who are banned in this manner see “Your IP address is banned from this server!” when attempting to connect through the client.

In-game an operator can instead use “/ban-ip ipaddress”, where “ipaddress” is the IP address of the user they wish to ban. To remove and undo a ban, the operator can issue “pardon-ip ipaddress”. Or if they have access, edit the server’s wtbblue.com file.

white-list.json

This essentially can be used to make a server private to a select group of clients. To do so add their usernames to the file wtbblue.com. You will need to edit the wtbblue.comerties file, changing white-list=false to white-list=true .

Alongside this you can also use this file to change the public message on your Minecraft server.

[alert-announce]

  1. $ vim ~/white-list.txt

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Edit motd=A Minecraft Server to show the name or phrase that you want to display publicly to clients.

World Directories

This directory and its subdirectories contain map and player data for the realms in your game.

It is worth backing up these directories regularly so that you can revert to previous versions in case of in-game mishaps or unwanted trolls. These directories may be in different locations, depending on which version of the Minecraft server you installed.

Also note that the directories for the nether and the end will not be created until a player visits the area at least once on the server.

Log Directory

Anything and everything that goes on is stored in the logs directory. It’s worth reviewing it’s contents every now and then or if any technical problems arise.

[alert-announce]

  1. $ less ~/logs/latest.log

View more: How To Make Vines Grow Faster In Minecraft, Grow Vines Real Fast

[/alert-announce]

Previous logs are compressed automatically as and when needed.

Console Commands

The link below contains a table that summarizes all available commands. Some of which have been mentioned here, but most of which have not.

View more: what are mipmap levels minecraft

Leave a Comment