Ubuntu 14.04 Secure Minecraft Server Setup

I want to limit any damage that could occur by running a minecraft server. Therefore I will be running it as a limited system user without access to other files. Here is how I set it up.

I will be installing this to /opt/minecraft/.

To install the prerequisites:

sudo apt-get install openjdk-v7-jre

First, lets make a minecraft user:

sudo adduser --system --no-create-home --home /opt/minecraft minecraft

Set the password, etc., then:

sudo mkdir /opt/minecraft/
cd /opt/minecraft
sudo chown minecraft:minecraft .
su minecraft

Now as the minecraft user, go ahead and wget the minecraft server, we will do the spigot server here:

wget http://ci.md-5.net/job/Spigot/lastSuccessfulBuild/artifact/Spigot-Server/target/spigot.jar

To get it going:

script /dev/null
screen -r minecraft
java -jar spigot.jar

Leave a Reply

Your email address will not be published. Required fields are marked *