Create your own Minecraft server

Minecraft was one of the most played video games in 2011.

It was developed by Mojang in Sweden and has sold over 176 million copies. Minecraft now has more than 112,000,000 active monthly players.

Minecraft Instances are fully customizable and allow you to customize the game to your liking.

What is Minecraft?

Minecraft is a videogame that allows players to create a 3-dimensional world with various blocks. The players must be creative in order to design and build their virtual world. By drilling and collecting blocks, users can mine and remove them from Minecraft. These pieces can then be gathered and assembled to make new items. Java Edition is currently available. This Java Edition lets players customize the game to their likings, creating new gameplay mechanics and textures.

There is no set goal for Minecraft. Any goal can be achieved by players.

However, there are some pre-defined game modes:

Creative Mode allows players to create whatever they want from the infinite resources available to them. Survival Mode requires players to explore the world to find natural resources, such as wood and stones. To survive against enemies and find food, players will need to build a home.
Multiplayer mode allows multiple players to interact in one world. You can connect to any of the worlds, or create your world with your friends using a private Minecraft server.

Why should I have my own Minecraft server?

You can create your own Minecraft server and invite your friends to join you in the game. You can install any mods you like and modify your world with elements not available at the time the game was created.

The Minecraft server is a Java app and runs flawlessly on Scaleway Instances. This allows you to deploy your Minecraft Instance in just minutes.

How do I create my Minecraft server maker?

- You have an account, and you are logged into Scaleway.
- You have successfully configured your SSH key
- Your Instance is running Ubuntu Bionic Beaver (18.04 or later).
- You have sudo privileges, or access to root user
- You have a copy the Minecraft client for your local computer
You can deploy your Minecraft server in just a few steps using a Scaleway Development Instance. If you don't have an Instance, you can deploy your first instance.

Use SSH to connect to your instance


Upgrade the software on the Instance and update the apt packet cache

Update &/or apt upgrade -y
Copy the code


OpenJDK is an open-source Java Platform and GNU Screen package.

apt install -y openjdk-8-jre-headless screen
Copy the code


Create a new minecraft account under which the Minecraft server application can run:

adduser minecraft
Copy the code

When prompted, enter the new password and confirm the password.


Log in to minecraft's user account

su minecraft
Copy the code


Change into the home directory of the user:

cd
Copy the code


Use wget to download the Minecraft server maker app. The Minecraft Server website has the link to the latest version.

wget https://launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar
Copy the code


The following command will start the Minecraft server application:

Important: The flags "-Xms" and "-Xmx" specify the RAM limit that the Minecraft server application can use. These values can be adjusted to suit your needs. It is recommended that you leave the minimum value at 1024M for best performance.


During the first run, the program creates a file called eula.txt. Open the file in a text editor, such as nano, and change the value for eula to true.

nano eula.txt
Copy the code

#By changing the setting to TRUE, you are agreeing to our$
#Fri Nov 15 14:47:37 GMT 2019
eula=true
Copy the code

Save the file by pressing CTRL+O, and exit nano by pressing CTRL+X.


To avoid screen command issues, take control of the current shell

script /dev/null
Copy the code


To run the Minecraft application, create a new screen:

screen -S minecraft
Copy the code


Re-run the Minecraft server maker app:

java -Xms1024M -Xmx2048M -jar server.jar nogui
Copy the code

The output below informs you that Minecraft server application is running.

...
[14:53.38] [Server thread/INFO] - Starting minecraft server version 1.4.4
[14:53.38] [Server thread/INFO] Loading properties
[14:53.38] [Server thread/INFO] Default game type is SURVIVAL
[14:53.38] [Server thread/INFO] : Generating keypair
[14:53.38] [Server thread/INFO] - Starting Minecraft server at *:25565
[14:53.39] [Server thread/INFO] Using epoll channel type
[14:53.39] [Server thread/INFO] - Preparing level "world".
[14:53.39] [Server thread/INFO] Reloading ResourceManager :
...
[14:54.18] [Server thread/INFO] Preparing spawn zone: 83%
[14:54:19] [Server-Worker-2/INFO]: Preparing spawn area: 85%
[14:54.19] [Server thread/INFO] Preparing spawn zone: 88%
[14:54:20] [Server-Worker-2/INFO]: Preparing spawn area: 90%
[14:54:20] [Server-Worker-2/INFO]: Preparing spawn area: 95%
[14:54.21] [Server thread/INFO] Preparing spawn zone: 97%
[14:54.21] [Server thread/INFO] Time elapsed : 14775ms
[14:54.21] [Server thread/INFO] : Done (42.088s). For help, type "help"
Copy the code


After the application has started, move the background screen by pressing CTRL+a followed with d. The session will be moved to the background. You can resume the running session by using the command screen –r.


Now you can log off your Instance to configure your Minecraft client.

The default settings are used by the Minecraft server that was created above. You can create a new world by changing the level-name directive and other settings in the server.properties. For more information, refer to the official documentation.

How do I connect to my Minecraft server maker?

Once your server is up, connect it with the Minecraft client.

Start the Minecraft client on your local machine.


After logging in to your Minecraft account click the Multiplayer button.


Click on Add Server to enter a name and public IP address for your instance.


Your server is now in the servers list. To connect to the server, click on it and then Join Server.