Methods of payment Abuse

How to install Minecraft on VPS/VDS on Linux

08.02.2023, 22:41
Installing Minecraft server on VPS/VDS may differ depending on the operating system you are using. Minecraft is a popular sandbox toy created by Swedish programmer Markus Persson and released by his studio Mojang AB. In this article, we will tell you how to install an indie toy on a virtual VPS/VDS server on the Linux operating system.

Installing the Minecraft server on the UPU/VDS

Check that Java is installed on your server. If Java is not already installed, install it by running the following command in the terminal:
sudo apt-get update
sudo apt-get install default-jre
Create a separate user for the Minecraft server. This will increase security and simplify server management. Run the following command to create a user:
sudo adduser minecraft
Log in as a minecraft user:
sudo su - minecraft
Create a directory for the Minecraft server:
mkdir minecraft-server
cd minecraft-server
Download the Minecraft server from the official source:
wget https://launcher.mojang.com/v1/objects/a0d0322db9e6a27f2f2ee35bf2cfc43c691d844e/server.jar
Install the Minecraft server using the following command:
java -Xmx1024M -Xms1024M -jar server.jar nogui
This command will launch a Minecraft server with 1024 MB of memory and no GUI. During the first launch, the server will create the necessary configuration files.
 
Edit the server.properties file to configure the Minecraft server. You can change the name of the server, the maximum number of players and other parameters. The file is located in the minecraft-server directory.
 
Start the Minecraft server using the following command:
java -Xmx1024M -Xms1024M -jar server.jar nogui
You can configure Minecraft server autorun using systemd. Create a minecraft.service file in the /etc/systemd/system directory with the following contents:
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=minecraft
WorkingDirectory=/home/minecraft/minecraft-server
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar server.jar nogui
Restart=on-failure
[Install]
WantedBy=multi-user.target
After creating the minecraft.service file, run the following command to restart the systemd daemon and start the service:
sudo systemctl daemon-reload
sudo systemctl enable minecraft
sudo systemctl start minecraft
Now the Minecraft server is running on your VPS/VDS Linux and is ready to use. You can connect to the server using the Minecraft client on your computer.