Beta Minecraft Server Setup

How I set up a Minecraft server to run multiplayer beta versions. This guide assumes you are running Linux on your local machine.

minecraftbeta

Prerequisite

Download a server.jar file and create a folder for it

Get a server

SSH setup

On your local machine, set up SSH to connect to the server and log in from your local machine.

Create a SSH key (put in your email):

ssh-keygen -t ed25519 -C "youremail@email.com"

Copy the key to your new server (put in the IP address). This is the step where you’ll need that root password you wrote down before.

ssh-copy-id -i ~/.ssh/id_ed25519.pub root@40.50.600.70

Connect to the server

Login is easy from your local machine now that ssh is set up (put in IP address):

ssh root@40.50.600.70

Install Java, Rsync and open ports

These commands are run on the server through the terminal window that you connected above.

Install openjdk 8 Java:

sudo apt install openjdk-8-jre-headless

Install Rsync:

sudo apt install rsync

Set up ports:

sudo ufw allow 43
sudo ufw allow 80
sudo ufw allow from any to any port 25565 proto tcp
sudo ufw enable

Set up a directory for Minecraft:

cd ../var/
mkdir mcserver

Use Rsync to move server.jar to server

Now, back on your local machine, move the server file that you downloaded to the server itself.

rsync -avz --delete mcserver/ root@40.50.600.70:/var/mcserver

This deletes everything in the server’s /var/mcserver directory that is not inside of your local mcserver folder.

Initiate the Minecraft server

Back on the server, execute the Java command below to start the server (note that if your server file is not named server.jar, you need to update that):

cd ../var/mcserver
java -Xmx1024M -Xms1024M -jar server.jar nogui

Once it initiates, shut it down (I just use CTRL-C) so we can update some of the newly created files.

vi server.properties

Run the Minecraft server

Run the following commands from your local machine in a new terminal to fire up the Minecraft server (again note the IP address and the name of the .jar file). These commands can be used anytime to start the server when ready.

ssh root@40.50.600.70
cd ../var/mcserver
java -Xmx1024M -Xms1024M -jar server.jar nogui

You can set the 1024M parts as 2048M to allocate more RAM, if desired. Remember that we set our server deployment as 1024 though.

It is also possible to log into root on your VPS provider’s website interface and run the Java command to keep the server running indefinitely. Right now, the logs are printed in the terminal window and if I shut it down the server will go offline.

Connect to the server in the Minecraft window

Backups

I run this command:

rsync -av root@40.50.600.70:/var/mcserver/ mcbackup/

periodically to back up the gamefiles on the server to my local machine. This has been glitchy before so please check my code.

Enjoy

Old Minecraft is the best Minecraft! Share your server’s IP address with your friends and go play.

Daniel