When selecting a server, make sure it has at least 1GB of RAM and preferably at least 2GB.
First, you need to connect to the server via SSH. If you are using a Mac, you can open a terminal; if you are using a PC, you can use PuTTY to connect. Once the command line is open, enter the following command to log in:
ssh username@ipaddress
Enter your password when prompted. While you can set up a server on the root user, this is not as secure as setting it under other usernames. You can check out this tutorial to learn how to add users.
Step 1: Install the required components
Before we proceed, we should quickly update apt-get, which is the program through which we will download all the components required by the server.
sudo apt-get update
After that, we need to make sure that Java is installed on our server. You can check by typing the following command:
java -version
If you do not have Java installed, you will receive a message saying "java: command not found". You can then download Java via apt-get:
sudo apt-get install default-jdk
You also need to provide the server with Screen, which will keep the server running when you disconnect:
sudo apt-get install screen
Here is a complete guide on how to install and use screen.
Step 2: Install the Minecraft server
First, create a new directory to store Minecraft files:
mkdir minecraft
After creating the directory, switch to it:
cd minecraft
In this directory, download the Minecraft server software:
wget -O minecraft_server.jar //versions/1.7.4/minecraft_server.1.7.
Since we have screen installed, you can start it (-S sets the session title):
screen -S "Minecraft server"
Once the file is downloaded, you can run it in Java:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
The startup text should look like this:
2012-08-06 21:12:52 [INFO] Loading properties 2012-08-06 21:12:52 [WARNING] does not exist 2012-08-06 21:12:52 [INFO] Generating new properties file 2012-08-06 21:12:52 [INFO] Default game type: SURVIVAL 2012-08-06 21:12:52 [INFO] Generating keypair 2012-08-06 21:12:53 [INFO] Starting Minecraft server on *:25565 2012-08-06 21:12:53 [WARNING] Failed to load operators list: : ./ (No such file or directory) 2012-08-06 21:12:53 [WARNING] Failed to load white-list: : ./ (No such file or directory) 2012-08-06 21:12:53 [INFO] Preparing level "world" 2012-08-06 21:12:53 [INFO] Preparing start region for level 0 2012-08-06 21:12:54 [INFO] Preparing spawn area: 4% 2012-08-06 21:12:55 [INFO] Preparing spawn area: 12% 2012-08-06 21:12:56 [INFO] Preparing spawn area: 20% 2012-08-06 21:12:57 [INFO] Preparing spawn area: 24% 2012-08-06 21:12:58 [INFO] Preparing spawn area: 32% 2012-08-06 21:12:59 [INFO] Preparing spawn area: 36% 2012-08-06 21:13:00 [INFO] Preparing spawn area: 44% 2012-08-06 21:13:01 [INFO] Preparing spawn area: 48% 2012-08-06 21:13:02 [INFO] Preparing spawn area: 52% 2012-08-06 21:13:03 [INFO] Preparing spawn area: 61% 2012-08-06 21:13:04 [INFO] Preparing spawn area: 69% 2012-08-06 21:13:05 [INFO] Preparing spawn area: 77% 2012-08-06 21:13:06 [INFO] Preparing spawn area: 85% 2012-08-06 21:13:07 [INFO] Preparing spawn area: 93% 2012-08-06 21:13:08 [INFO] Done (15.509s)! For help, type "help" or "?"
Your Minecraft server is now set up. You can exit screen by pressing the following key combination:
ctl-a d
To reconnect to screen, enter the following command:
screen -R
You can change the server's settings by opening the server properties file:
nano ~/minecraft/
This is the article about the methods and steps of building a Minecraft server on Linux. For more related content on building a Minecraft server on Linux, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!