It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Howdy, Stranger!
It looks like you've been lurking for a while.
If you register, we also will remember what you have read and notify you about new comments. You will also be able to participate in discussions.
So if you'd like to get involved, register for an account, it'll only take you a minute!
apt-get update
apt-get upgrade -y
apt-get install openjdk-8-jre-headless screen
adduser minecraft
usermod -a -G sudo minecraftSwitch to the minecraft user:
su minecraft
wget https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar
Note: You can find latest version on official Minecraft's webpage.Create a script to run the Minecraft server by create file /home/minecraft/run.sh
nano /home/minecraft/run.shand pasting in this code:
#!/bin/sh
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "$BINDIR"
java -Xms1024M -Xmx1536M -jar minecraft_server.1.11.2.jar -o true
Note: The Xms and Xmx flags define the minimum and maximum amount of RAM the Minecraft server will use. The settings above are recommended for package "M", which has 2 GB of RAM used solely for this purpose. Adjust these values to fit your needs.And last but not least make run.sh executable:
chmod +x /home/minecraft/run.sh
./run.shOpen the eula.txt file and change the value of eula to true:
nano /home/minecraft/eula.txtTo ensure that the Minecraft server runs independent of an SSH connection, execute run.sh from within a GNU Screen session:
sudo screen /home/minecraft/run.sh
Note: To disconnect from the screen session without stopping the game server, press CTRL+a and then d. To resume the running screen session, use the command screen -r.