For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/deploy-minecraft-server-linux.md.
  • English

Deploying a Minecraft Server in Linux

View as Markdown

OVH US Game Servers are ideal for hosting a multitude of games. With state-of-the-art hardware and our patented Anti-DDoS GAME protection, your games will run smoothly and be safe from potential attacks. This article covers how to install Minecraft on an OVH US Dedicated Server and how to connect to it.

Prerequisites 

Topics

Installing Minecraft using LinuxGSM

LinuxGSM is an open source command line tool that enables easy and fast deployment of different game servers. It streamlines the complicated process of hosting a game server. LinuxGSM supports over 80 games and has detailed instructions on how to set up a server for each game.

To get started installing Minecraft, we must first download any dependencies that it requires.

Warning

Note: For our example, we will be using Ubuntu 18.04. If you are using a different version of Linux please find the relevant dependencies from the LinuxGSM website.

The following command will download all the dependencies we need.

# sudo dpkg --add-architecture i386; sudo apt update; sudo apt install mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc jq tmux default-jre
Warning

Note: During the course of this installation, we will encounter a GUI that asks us to configure a mail server. Doing so is entirely optional and can be skipped simply by selecting all of the default options.

To proceed, we will need to create a new user and store our Minecraft server data under that user.

# adduser mcserver

Next, we will need to set a password for this user. It is recommended to use a strong password consisting of twelve or more characters utilizing upper and lower case letters, numbers and symbols.

Now that we have created our user we will need to use the substitute user command to switch to that user.

# su - mcserver

Under our new user, download the LinuxGSM tool.

$ wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh mcserver

Next, install the Minecraft server.

$ ~/mcserver install

Before we start our server we will need to set the IP address.

Note: A full list of commands for your new Minecraft server can be found by typing ./mcserver

Exploring Minecraft Server Properties

In order to have players connect to our Minecraft server, we first need to set the IP address of the server. To do so, navigate to the "serverproperties" file and edit the "server-ip" field.

$ nano serverfiles/server.properties
view-distance=10
max-build-height=256
server-ip=XXX.XXX.XXX.XXX
level-seed=
rcon.port=25575
gamemode=0
enable-command-block=false
allow-nether=true
server-port=25565
enable-rcon=false
enable-query=true
op-permission-level=4
prevent-proxy-connections=false
generator-settings=
resource-pack=
level-name=world
player-idle-timeout=0
rcon.password=adminXj_s6PWu
motd=A Minecraft Server
query.port=25565
force-gamemode=false
debug=false
hardcore=false
white-list=false
broadcast-console-to-ops=true
pvp=true
spawn-npcs=true
generate-structures=true
spawn-animals=true
snooper-enabled=true
difficulty=1
network-compression-threshold=256
level-type=DEFAULT
max-tick-time=60000
spawn-monsters=true
max-players=20
use-native-transport=true
enforce-whitelist=false
resource-pack-sha1=
online-mode=true
allow-flight=false
max-world-size=29999984

In this file, we can change various game settings such as turning off pvp-mode. For a full description of changes we can make to our Minecraft server, consult the Minecraft Wiki.

Now, we are ready to start the server. To do so, enter the following command.

$ ~/mcserver start

The last thing we need to do to ensure that players can connect to our server is ensure that our Minecraft port is listening. To do so, we first need to exit our current user and install nmap using the following commands.

$ exit
# apt install nmap

Now that nmap is installed, run the following command:

# nmap -p 25565 XXX.XXX.XXX.XXX

If everything is set up correctly we will see the following output:

PORT      STATE SERVICE
25565/tcp open  minecraft

We are now ready to connect to our server.

Connecting Minecraft to the Minecraft Server

To connect to our Minecraft server, boot up the Minecraft client on any personal device and select the Multiplayer option.

Startscreen - Deploy minecraft server Linux

From this new screen, click the Add Server button.

Warning

Note: We may also choose to use Direct Connect to connect to our server. However, if we choose to do this, the server will not be saved under "Play Multiplayer".

Multiplayerscreen - Deploy minecraft server Linux - step 2

From the "Edit Server Info" screen, choose a name to identify the Minecraft Server and enter its IP address. When finished, click the Done button.

Add server - Deploy minecraft server Linux

This will add the server to the "Play Multiplayer" list. Simply double click on the server and you will be off gathering resources and building an exciting new world.

Conclusion

Having read this article, you should now be able to install a Minecraft server utilizing LinuxGSM, explore the server properties and functionalities within Minecraft, and connect to your server using the Minecraft Client. You now have everything you need to play Minecraft with all of your friends. Enjoy the adventure!