1) Create your host machine and provision the setup with required RAM and CPU resources.
2) Once your server is updated and configured the way you like, there will be the need to install java and screen so that we can run the minecraft server.
$ sudo yum install screen java -y
3) Download the latest version (or your desired version) of the Minecraft server. The download page is located here: https://minecraft.net/download
$ wget https://s3.amazonaws.com/Minecraft.Download/versions/*****/minecraft_server.******.jar
4) Run the server for the first time so that it creates the
eula.txt. You can use
CTRL+C to close out of it.
$ java minecraft_server.*********.jar
5) Accept the EULA agreement by editing the
eula.txt file and changing the
true on Line 3 of the
6) Run the server a second time and let it generate some default terrain and spawn areas. This will also create the
server.properties file as well as the
ops.json, and default
7) Once the set up is completed, close the server out by simultaneously pressing
CTRL+C on your keyboard or typing
stop into the console of the Minecraft server.
8) Edit the
server.properties and other configuration files to your liking.
9) Create a startup script.
$ touch startserver.sh
#!/bin/bash clear echo -e "Starting Minecraft Server in 3 seconds.." sleep 3 screen -A -m -d -S minecraftserver java -Xmx1024M -Xms1024M -jar /path/to/minecraft_server.1.8.1.jar nogui
Do not forget that you can edit the
1024M to account for how much RAM you want to provide to the Minecraft server.
1024Mfor 1G of RAM
2048Mfor 2G of RAM
4096Mfor 4G of RAM
10) Make the start script executable:
$ chmod +x startserver.sh
11) If you are using IPTables firewall, do not forget to add the Minecraft server's port to the firewall to allow connections. The default port for Minecraft is 25565:
$ sudo iptables -I INPUT -p tcp --dport 25565 -j ACCEPT $ sudo service iptables save
12) Now you can start your server by running the start script. This will run the Minecraft server in a screen session in the background.
It is advisable to run the Minecraft server as a different user and not the root user.