Creating and Operating a Minecraft Server in Microsoft Azure

Update: 6/27/2020: I am sorry to report that the free Minecraft Server offering in the Azure Marketplace has been removed as of today.

A few weeks ago I was notified by the Azure Marketplace team that it needed some changes, including “company name” – “MSFT Stack” was deemed too similar to an official Microsoft name. I was unable to change to another company name because new Marketplace regulations require various forms of proof that you’re a legal company. This precludes non-profit ad hoc open source projects. I will switch to maintaining a non-marketplace Azure deployment template in my github repo as an alternative.

I’ll leave the blog post below for historical purposes, but it will no longer work. Will update and write a new post when I’ve blown the cobwebs off my github repo and have an up to date ARM template to deploy.

Update: 2/11/2017

The new Minecraft Server solution in the Azure Marketplace is here: https://azuremarketplace.microsoft.com/en-us/marketplace/apps/msftstack.minecraft-server?tab=Overview. The new template is easier to use and allows for more customization than the old one.

The new instructions for creating an operating a Minecraft Server in Azure can be found here: https://msftstack.wordpress.com/2017/02/11/deploying-minecraft-server-on-azure/.

Some of the reasons you might want to run a Minecraft server in Azure instead of running on your own machine are:

  • You can choose a preconfigured Minecraft server virtual machine to launch from the Azure Marketplace – no installation required.
  • Choose from a range of a VM sizes to meet your performance and cost requirements.
  • Running a server on your own physical machine means choosing between limiting access to your home network, or dealing with the security risk of exposing your home network to the internet.
  • Avoid hardware costs – pay for a VM when you need it and shut it down when you don’t.
  • Whitelist trusted players to connect from anywhere without wrestling with firewalls and port forwarding.
  • Freedom from worry about losing data to hardware failure with disks backed by Azure Storage Service.
  • If you mess up the whole machine no big deal, delete it and deploy another. If you back up your world from time to time you can restart from where you left off.
This entry was posted in Cloud, Games and tagged , . Bookmark the permalink.

33 Responses to Creating and Operating a Minecraft Server in Microsoft Azure

  1. Pingback: Creating a Minecraft server using an Azure Resource Manager template | MSFT Stack

  2. Jeff Stucker says:

    How can I install a 1.7.10 server?

  3. Jeff Stucker says:

    How do I create a 1.7.10 server?

  4. sendmarsh says:

    Hi Jeff, see this example for a 1.7 server (in this case, Scriptcraft): https://github.com/gbowerman/azure-minecraft/tree/master/scriptcraft-on-ubuntu

  5. Vivian says:

    Can I shut down the VM when I’m done playing? Is my data going to be saved?

    • sendmarsh says:

      Hi Vivian, yes you can shutdown the VM, and the data will be saved. I would add just one note of paranoia though.. if the world data is important to you, take backups as well. I.e. regularly shutdown the minecraft_server service, save the world folder, gzip it and scp it to a local machine or onedrive/dropbox etc.. This way you are protected from both user errors, and Minecraft bugs that corrupt the world. The nice thing about the cloud environment is that if you’ve saved the world it’s very easy to deploy a VM and reconstruct it.

      • Michael says:

        How do I back-up my Minecraft server world? Is there a step by step tutorial on how to do it?

      • sendmarsh says:

        TI don’t know of step by step tutorial for this unfortunately. My comments about outline one possible set of steps: – shutdown the minecraft_server service
        – save the world folder
        – gzip it
        – scp it to a local machine or onedrive/dropbox etc..
        It would also be quite simple to script a sequence like that and then set up a cron job which executes it daily.

  6. Tom says:

    Where can I adjust the amount of RAM allocated to the server? Have it on a 12gb box and want to allocate most of that.

    Thanks!

    • sendmarsh says:

      Hi Tim, SSH to the virtual machine and edit this file: /etc/systemd/system/minecraft-server.service. e.g.
      sudo vi /etc/systemd/system/minecraft-server.service

      You’ll see a line like:
      ExecStart=/usr/bin/java -Xms1024m -Xmx1024m -jar /srv/minecraft_server/minecraft_server.1.8.jar nogui
      Increase the -Xms and -Xmx values.Then restart the minecraft-server service:
      sudo systemctl restart minecraft-server

  7. Uwe Falkenberg says:

    How can I update to Server 1.9 ?

    • sendmarsh says:

      Follow these instructions to deploy a 1.9 Minecraft server: https://msftstack.wordpress.com/2015/09/05/creating-a-minecraft-server-using-an-azure-resource-manager-template/
      – updating an existing server from 1.8 to 1.9 would be more complicated. Not sure if Minecraft support that, but the way I’d do it would be to shut down the server, copy over the 1.9 Minecraft server jar file, update the Ubuntu minecraft-server service to point to the new jar file, restart the service, hope the world files are compatible..

      • EJ says:

        I was just forced to update to 1.9.2 :). I just did what you said: download the 1.9.2 jar file, changed the server conf, restarted the server (it prompted me to reload the daemon, but that might have been because I did not stop it first). And off I went. Thanks for all your great support sendmarsh!

  8. Al says:

    Ho to upgrade to server 1.9?

  9. sendmarsh says:

    Follow these instructions to deploy a 1.9 Minecraft server: https://msftstack.wordpress.com/2015/09/05/creating-a-minecraft-server-using-an-azure-resource-manager-template/ – see my reply to Uwe for more details.

  10. Cat says:

    For the SSH thing, my public and private port are the same, and it’s not a randomly high number. Is this a problem? Did I follow the instructions correctly? Can I change my public port to any number? Can I continue with the public and private port being the same number?

    • sendmarsh says:

      That’s not a problem. It’s possible the default portal behavior has changed and it no longer assigns a high random port. You can change it if you want, or leave it the same.

  11. Michael says:

    Hi,
    Thanks for your help. I have stopped my VM and when I tried to start it again my Minecraft could not connect to it and it said: ‘ Can’t connect to server’ on the server list. My friends also could not connect to the Minecraft server. I than saw that the VM said it was running and we think the Umbuntu server is running but the Minecraft server on top is not. I am quite new to Umbuntu and server management and any thoughts would be appreciated.
    I have also installed PUTTY but how do I find the port? We do not have a VM Classic and we only have a VM. ‘Endpoints’ don’t seem to be coming up in the all settings of my VM. Help would be appreciated- thanks.

    • sendmarsh says:

      Hi, if you followed these instructions, but don’t have “classic” VMs listed, maybe you’re using the old portal (manage.windowsazure.com). Can you confirm you’re using the new portal (portal.azure.com)?

  12. Andrew says:

    How much does this cost, i.e. the minimum you need to spend for 1 hour of game time? How does it compare to realms? Would anyone like to share their costs?

  13. Pingback: Host Game Server On Azure | Information

  14. AndrewS says:

    Was this silently killed? Looks like most links and documentation on Azure.com has vanished, and of course the minecraft images themselves…
    It’s a shame there’s no notes as to what or why it’s all gone.

  15. pkphlexx says:

    Love it! Thanks for all the instructions, I was able to build a multiworld forge/sponge server. The only issue that I really had was trying to send minecraft commands to the console. I had to use screen then start up the service. Keep up the good work.

  16. Mikerbiker says:

    I am having the same problem. When first creating the Minecraft server and setting the username and password, I should be able to enter whatever values I want for a brand new user/pswd combination, but it always gives the error of an invalid password. What password would it want?

    • sendmarsh says:

      Yes you should be able to enter any valid Linux username and password for the VM configuration. Some things to keep in mind:
      – Don’t use characters in the password that are bash shell special characters, i.e. avoid using “‘`$\#[]!|;{}()~
      – Make the user name at least 6 characters
      – Have a password length of at least 10 chars

      • sendmarsh says:

        If you’re into regex, this is how the password is validated: “regex”: “^(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\\d\\W])|(?=.*\\W)(?=.*\\d))|(?=.*\\W)(?=.*[A-Z])(?=.*\\d)).{12,72}$”,

  17. Does this work with 1.12.2 Spigot?

    • sendmarsh says:

      It deploys a basic Minecraft server running the latest version. If Spigot works with that then yes, however it doesn’t do anything special for Spigot. You could clone this and create your own Azure Resource Manager template that does.

Leave a reply to Michael Cancel reply