The Web

Installing and Running a Minecraft Server on A VPS Server

It’s actually much easier than I thought.

Simply spin up a VPS from a hosting provider of your choice, and follow the following steps. Note that I use Ubuntu as the version of Linux because that’s what I am more familiar with. If you are familiar with others, the steps should be the same.

Prepare the system

First, add the Java repository to the system.

sudo add-apt-repository ppa:linuxuprising/java

Then update your system.

sudo apt update
sudo apt upgrade

Now let’s install the latest Java.

sudo apt install openjdk-17-jre

And that’s pretty much it to get your system ready to run Minecraft.

Minecraft time

To make things clean, you can create a subfolder just for Minecraft and download

mkdir minecraft
cd minecraft

Now head over Minecraft Server download page to find the URL for the latest version, and copy it to the clipboard for the wget command to download it.

wget https://launcher.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar

Note that this is to download version 1.17.1. The URL may differ if the version is different.

Rename the package to match the version so you don’t get confused later on.

mv server.jar minecraft_server_1.17.1.jar

Time to rock.

java -Xmx1024M -Xms1024M -jar minecraft_server.1.17.1.jar nogui

Ooops…if this is the first time you run it, you will most likely get an error saying that you have to agree on the end-user agreement. Let’s bypass it.

nano eula.txt

And replace the False word with the word “True”. Save it, get it out, and run it again.

You should be in.

Now let’s connect your Minecraft game to the new server.

Open the Port for remote access

Lastly, you will need to open the TCP port 25565 on server to allow remote connection to come in.

A few notes

First, the launch line defaults to use 1GB of RAM for the game. That’s good enough for 3 to 4 people enjoying the game. Any more, you will need to increase that number.

If your VPS only has 2GB of RAM, the server will likely crash when the number of people online reaches 5 or 6. Time to upgrade to the next tier. Then, adjust the -Xmx parameter to allow the game to use more RAM. For example,

java -Xmx4GB -Xms1024M -jar minecraft_server.1.17.1.jar nogui

Then, if you need to shut down the server for now, you may think about backing up your game data for the future. All data are stored in a folder called World, or the level name you have set up in the server.properties file. Back up that folder and restore it to another server later on when you are ready to resume the game.

Since it needs to be run continuously, it’s recommended to run it under a screen session that doesn’t close.

Simply type screen to open a new session. And then launch the Minecraft server in it.

To get out of the session, press Ctrl + A + D.

To list all available sessions, run

screen -list

To re-enter a running session,

screen -r #session

To completely close a session, type exit.

edge

Share
Published by
edge

Recent Posts

Disable Copilot on Windows 11 via Group Policy GPO

If using Copilot right from the Taskbar isn't your thing, you should disable it. Even…

8 months ago

Setting Default Fonts in Word, Excel, Outlook, and PowerPoint via Group Policy

In an environment where standardizing things does matter, setting default fonts in Microsoft Office apps…

8 months ago

Wake-On-LAN (WOL) with Windows and PowerShell

Wake-On-LAN is a networking standard that lets you wake up a computer from either a…

8 months ago

How To Remove Restrictions Set in A Password-Protected PDF File

First of all, this is not to bypass a PDF file that requires a password…

9 months ago

How To Move My Outlook Navigation Bar Back From Left Back To the Bottom

Microsoft has been lurking about the idea of placing the Outlook navigation bar to the…

2 years ago

Headset with Microphone Echoing My Own Voice on Windows, What To Do?

One colleague came up to me the other day asking me to take look at…

2 years ago