Howto host a minecraft server on a linux box in the background with screen

This post was published 10 years, 11 months ago. Some material it contains may no longer be applicable.

This guide will show you how to host a minecraft server in a screen session on a linux box.

Note: You should NOT run the server as root! Create a special user for this, name it e.g. minecraft.

First, make sure you have java installed. If not, use your package-managment tool to install it, e.g.

aptitude install java5

Get the classic server package from & copy it to your server.

If you try to start the server with

java -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer

, you may notice that your shell is blocked. If your user session is closed, the server is a well. To avoid this we’re gonna use screen. So first make sure screen is installed:

aptitude install screen

After that, start the server in a screen session:

screen -dmS minecraft java -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer

You have to detach this screen session. To do this, press ctrl + a, d (for detach).

If you want to get an overview over running sessions, type

screen -list

To re-attach a running session, type

screen -r

Ok, the server is running.

Head over to the Isocraft guide to get a nice liveview of the map on your webseite.

One thought on “Howto host a minecraft server on a linux box in the background with screen

Leave a Reply

Your email address will not be published.