Tuesday, November 6, 2018

Updating Azure Hosted Minecraft Server

Update the Server

Introduction

Currently we maintain a Minecraft server and it needs to be updated with the latest jar file from time to time. This post will track that so I don't have to keep looking it up.  This assumes that you have set up ssh and a passphrase for a Linux VM in Azure and a File Storage resource.

Step One - Get server.jar file

First step is to get the latest jar file and here is the server address to get the jar file. Download the latest to your local drive.

Step Two - Upload server.jar file to File Storage

Using the Azure portal access the File Storage that is the resource you use to hold files. Upload the jar file from your local drive to the Azure File Storage using the portal interface.

Step Three - Move the file from File Storage to the Linux VM

Using the Azure Cloud Shell use the scp command to send the file from File Storage to the Linux VM home directory of the user. Open up the Azure Cloud Shell and move to the cloud storage directory. Use ls to see the cloud storage and cd to move to that directory. In there you should see the new jar file that was uploaded. Use the following scp

scp ./minecraft_server.1.14.3.jar username@domain.com:/home/username

Replace with your ssh username and the domain address to the Linux Virtual Machine. You will know it worked when it asks for pass phrase. If the passphrase is right, but getting denied, drop the /home

Step Four - Move the jar file to the server folder

Use ssh and the passpharse to get to the Linux VM

ssh username@domain

Once in home directory using ls you should see the jar file. Use the mv command to move the file to the ../../srv/minecraft_server folder. Use sudo.

Step Five - Update the service file

Stop the service using the following command.

sudo systemctl stop minecraft-server

That will stop the service. Go to /etc/systemd/system/ and using the ls should see the minecraft-server.service file. Open with nano using the following command

sudo nano minecraft-server.service

This will open up the service file. Update the jar file name to have the new file name. Use the commands to exit and save the file. Then run this command to reload.

sudo systemctl daemon-reload

Then run

sudo systemctl start minecraft-server

That should be all there needs to be done. If a refresh from the client doesn't work. Try restarting the Linux VM. 


No comments:

Post a Comment