The Azure Marketplace now has a Minecraft Server offering which deploys a customizable Minecraft Server to an Azure virtual machine. This replaces an older Azure Gallery Minecraft item which was often out of date, sometimes broken, and eventually removed.
The new solution template creates an Azure virtual machine running Ubuntu 16.04 and installs Minecraft Server running on it. It also creates the other cloud infrastructure components you need, including: a resource group, virtual network, public IP address, DNS name, network security group (NSG). Additionally it lets you set several Minecraft server configuration parameters at deployment time. What follows is a brief user guide covering how to deploy and operate your Minecraft Server running in Azure.
What you need to get started
- A Minecraft account. You’ll need your Minecraft username so the server can configure itself with you as the operator.
- An Azure subscription. Required to deploy Azure cloud resources.
Finding the Minecraft Server
You can deploy the Minecraft Server Marketplace solution to a new VM directly from the Azure Marketplace or by searching for it from the Azure portal.
From the Marketplace
Go to the Minecraft server Marketplace product page and click GET IT NOW.
From there click Continue and you’ll be taken to the Azure portal..
From the Portal
You can also deploy the Minecraft Server directly from the Azure Portal. Click the ‘+’ sign and type “minecraft” in the search.
Deploying the Minecraft Server
Once you’ve selected the Minecraft Server product in the portal you’ll see a description and a Create button.
From here the portal takes you through a set of forms known as portal blades to configure the deployment. Let’s go through them one by one:
VM username – A Linux user name you’ll use if you need to log on to the virtual machine.
Password – The password you’ll use if you need to log on to the virtual machine. Don’t forget this.
Subscription – If you have access to more than one Azure subscription, choose the one you want to use for this deployment.
Resource group – A logical container for your resources. It’s a good idea to create a new one here, that way if you want to remove everything you created at some point you can simply delete the resource group and it won’t affect any other deployments.
Location – Pick the region where the resources will be created. Picking somewhere local to you is usually a good idea to minimize network round-trip time.
Virtual Machine Settings
Public IP address resource name – Leave the default setting.
Domain name label – Pick a unique domain name for your server. No punctuation, spaces etc., just letters and/or numbers. Later when you connect to this server the full domain name will be like: <yourdomainname>.<yourlocation>.cloudapp.azure.com.
Size – The size of the virtual machine. You can accept the default or choose a larger machine with more CPU/memory, but it is not recommended to choose a smaller machine like A0 or D0. If you do pick a smaller VM size the server might get a bit laggy.
Minecraft Server Settings
Minecraft username – This is your Minecraft username – get it right or you won’t be an operator of the Minecraft server that gets created. Don’t put an email address or anything else, except a valid Minecraft username.
Minecraft server version – This should default to the latest version of the Minecraft server and hence not need changing. The field is editable just in case a new server version comes out and the Azure Marketplace product hasn’t been updated yet. If there is a new server version available you can put it here.
difficulty – The default Difficulty of 1 means peaceful mode. Check here for what values you can use for this and the next few parameters: http://minecraft.gamepedia.com/Server.properties
level-name – Whatever you want your new Minecraft world to be called or leave the default value. Don’t use any special characters which could interfere with a bash script. E.g. no spaces, single quotes, explanation marks, backslashes (unless you’re deliberately escaping a character).
game-mode – The default value is 0 – Survival mode. 1 is creative.
white-list – Set this to true to make this invite-only. Initially only you would have access, and for people to join you’ll have to use operator commands to add them to the white-list.
enable-command-block – If this is true you can create command blocks in the server, which empowers you to build a near limitless array of quasi-magical operations.
spawn-monsters – Controls whether monsters show up at night or not.
generate-structures – Controls whether your world will have temples and villages.
level-seed – Leave this blank to use a random seed. The seed controls which of the 18,446,744,073,709,551,616 possible worlds are generated. As with level-name, avoid using characters which could interfere with the bash script which installs Minecraft. No spaces or punctuation like quotes, explanation marks, backslashes.
Next you’ll see a summary of the options you picked…
At the purchase blade you confirm that you’re deploying the Azure resources. Note there are no extra charges on top of the Azure resources, just the basic compute and storage charges.
Once you click the Purchase button your Minecraft server will start deploying and you’ll see a progress icon on the dashboard. Allow several minute for this to deploy.
Connecting to the Minecraft Server
Once deployment is complete you’ll see the resources that were created in the portal..
Click on the Public IP address and you’ll see the DNS name you’ll use to connect to from your Minecraft launcher:
Start your Minecraft desktop client. Use the regular desktop app, not a pocket edition which won’t connect to regular multiplayer servers like the one you just created. Click Play->Multiplayer and then select Direct Connect or Add Server like this:
Once connected you (and only you) should be an operator. You should be able to type commands like /gamemode 1 to switch to Creative mode:
The full list of operator commands can be found on the Minecraft wiki: http://minecraft.gamepedia.com/Commands#Summary_of_commands
Troubleshooting and managing
Troubleshooting may involve logging on to the VM directly. For this you need to SSH to the DNS address. If you’re connecting from Windows you’ll need to get an SSH client like putty (see this article for more examples), or better still SSH directly from the Windows subsystem for Linux which is available in Windows 10 Anniversary edition and later. In the example above the SSH command would be:
ssh mcserver211.southcentralus.cloudapp.azure.com -l mcuser
- Manually stopping/starting the Minecraft server on the VM
ssh to the VM
sudo systemctl stop minecraft-server
sudo systemctl start minecraft-server
2. If you need to edit any of the Minecraft server files, they are in /srv/minecraft_server
3. Cannot SSH to the VM
Go here: https://github.com/Azure/azure-linux-extensions/tree/master/VMAccess
4. Upgrading Minecraft to the latest server version
Use this script: https://msftstack.wordpress.com/2016/06/25/upgrading-minecraft-on-an-azure-vm/.
There is another Minecraft server in the Azure Marketplace called Multicraft. I’ve not tried it myself yet but Bitnami have good solutions. It’s an advanced hosting platform for Minecraft so worth trying.
If you have any ideas to improve the Azure Marketplace Minecraft Server template, the source files are here: https://github.com/gbowerman/azure-minecraft/tree/master/azure-marketplace/minecraft-server-ubuntu – please take a look and log issues or submit a PR.