Deploying Minecraft Server on Azure

Update 4/14/2018: Happy to report the recent problems with the Minecraft Server solution template on the Azure Marketplace are now fixed. There was a problem with the way it was picking up the latest Minecraft version, which was compounded by a Marketplace/Developer account publishing problem. All now resolved.

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.

For a Spanish guide to deploying a Minecraft server in Azure, go here: Cómo crear un servidor Minecraft en Azure (thanks @platter5_).

What you need to get started

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.

Click Create.

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.

Click OK.

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:

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.

Click OK.

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:

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.

Click OK


Next you’ll see a summary of the options you picked…


Click OK.


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:

Minecraft 1.11.2 2_11_2017 2_55_43 PM

The full list of operator commands can be found on the Minecraft wiki:

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 -l mcuser

  1. 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:

4. Upgrading Minecraft to the latest server version
Use this script:

Next Steps

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: – please take a look and log issues or submit a PR. 

This entry was posted in Cloud, Computers and Internet, Games, Ubuntu and tagged , , , . Bookmark the permalink.

56 Responses to Deploying Minecraft Server on Azure

  1. Pingback: Creating and Operating a Minecraft Server in Microsoft Azure | MSFT Stack

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

  3. xulture says:

    Thanks!! I just got one going 🙂

    Is there a way to use server console? (via ssh?)

    • sendmarsh says:

      @xulture, yes. If you ssh to the VM and start the server manually. E.g. you can run:
      cd /srv/minecraft_server/
      sudo systemctl stop minecraft-server
      sudo java -Xms1g -Xmx2g -jar ./minecraft_server.1.11.2.jar

      Then your ssh session will show the server console.
      Remember to run sudo systemctl start minecraft-server before you log out if you want the server to keep running.

  4. snugam says:

    We’re a group of friends playing; we’ve moved our server from Realms due to serious lag issues when players are flying with Elytra. Before I’ve setup my own Ubuntu server to host it, but this time I am using this one from the market place.

    Can you tell me what Xmx and Xms values you used for the default config, or tell me where to check/changes these for systemctl minecraft_server

    thank you very much for going t the trouble to build it – was incredibly easy to setup.

  5. theDurpachu says:

    hi i’m having a little problem when i try to put in a password for the VM it says invalid password any reason why?

    • sendmarsh says:

      If you successfully logged on to the VM before, then I can’t think of a reason it would stop working. If you’ve never been able to log in then it’s possible there was some issue typing in your password at deployment time. Either way, you can fix this by viewing the VM in the Azure portal, and selecting the Reset Password option under Support and Troubleshooting.

    • sendmarsh says:

      I realized you’re saying it doesn’t like the password when you’re typing it in in the portal. 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. In fact try 12.

  6. Luis says:

    Thanks for this.

    I deployed two servers however I have two issues:
    – I can’t break any block, I can hit the animals but not blocks of any kind.
    – Punching a tree or any block keeping the mouse pressed won’t continue to hit as it normally does.

    Any ideas?

    • sendmarsh says:

      Does it work if you switch to creative mode by typing: /gamemode 1
      If it does, then you have a good Minecraft server install, so the issue might be with your client. If that doesn’t work, then it implies you are not an operator, so something may have gone wrong when you entered your Minecraft user name during VM deployment.

      • Luis says:

        I have deleted both, re-deploying a new instance, but I could run /time set day and it worked so I am an op. Also I had followed your other guide from github and have had that server running for a while and the same computer works fine with that server.

      • Luis says:

        Additional not, I am running 1.11.2 client and the current working server.

      • Luis says:

        Switching to /gamemode 1 and then back to /gamemode 0 fixed it!


  7. Graham says:

    would you be able to allow us to customize the generation settings for the worlds, like Dungeon count, ore levels etc?

    • sendmarsh says:

      You mean add these settings as Azure template parameters? Do you know if there are configuration files for these settings? If there are, then it should be possible to create a customized template for it.

  8. derek gusoff says:

    Hi, I’m unable to connect to the server. I’m getting a “Connection Refused. No Further Information”. It seems port 25565 is not open. I can see in the NSG there is an inbound rule allowing the port along with the SSH port 22.. I can see the ufw firewall in Ubuntu is disabled. But running a scan via only shows port 22 as open. I also tried restarting the server as noted in the troubleshooting steps. Any idea what I might have done wrong here?

    • sendmarsh says:

      Hi, my best guess is that the port isn’t open because the Minecraft server isn’t running. Can you check if the VM extension which installs Minecraft ran correctly? One way to do this is to look at the VM instance view. E.g. you could go to, find your subscription->resource group->virtual machine, click the plus sign by the virtual machine the virtual machine and click on the instance view. This should include the output from the extension near the bottom of the scrreen. Another option would be to ssh to the machine and look in /srv/minecraft_server to see if anything was created. If something went wrong with the extension, cleanest fix would be to delete your resource group (assuming you’re not using if for anything else) – which removes everything – and try deploying Minecraft again. If it fails again, we have a problem and I’d like to see the extension output.

      • derek gusoff says:

        Hi, thanks for the detailed troubleshooting steps. I tried a new resource group and new Minecraft server VM, but seem to have the same issues as the first with connecting via the Minecraft client. I can see that /srv/minecraft_server has the server jar, the properties file, and the other files and directories I would expect there. I’ve uploaded the instance view file to Let me know if you’d like to see more.

        I appreciate your help here. I feel like I’m really close.

      • sendmarsh says:

        I tried deploying a new Minecraft server and it has started failing for me. I ssh’d into the VM and looked at /srv/minecraft_server/logs – the server is getting an exception when it starts: [04:19:40] [Server thread/ERROR]: Encountered an unexpected exception End of input at line 1 column 1 path $
        I looked at the crash file, and it said exception in server tick loop.
        It looks like the new 1.12 server is having trouble reading one of the JSON files.
        I deleted banned-ips.json, banned-players.json, whitelist.json and then ran sudo systemctl restart minecraft-server
        The server then came up correctly.
        I think I know what the problem is. I was creating empty files for those json files if the user doesn’t set anything. It looks like the server crashes if an empty json file exists, but it is ok if there is no file, or if the file contains “[]”. I will fix up script and re-stage it. In the meantime you should be able to get your server working by deleting the same json files and restarting the service as above.
        Sorry you ran into this, I assume everyone is running into it now. Thanks a lot for raising the problem. I’ll let you know when a fixed version is in the marketplace. [ Update: put a temp fix in the Azure quickstart templates version: ]
        [ Update 6/18: problem now fixed in Marketplace ]

    • sendmarsh says:

      Update 6/18: A new template has been pushed to production. Just tested and confirmed it works. The problem was Minecraft Server 1.12 crashes trying to read empty JSON files when starting up. The solution was to not create empty JSON files and let the server create its own as needed.
      @derek_gusoff thanks a lot for reporting this. Please give it another try when you get a chance, the Minecraft server in the Marketplace should be working correctly now.

  9. derek gusoff says:

    Hi sendmarsh, deleting those files did the trick, and my server is now up and running! I also learned a few things, which was the whole point fo this exercise.

    Thanks so much for jumping on this and helping me to a resolution. I’ll also try the template again and see if everything is working OK. I’ll report back if I find issues.

  10. Pingback: Cómo crear un servidor Minecraft en Azure – Francisco Martinez

  11. do you have any pointers for adding mods on a server set up with this template (really nice setup, thanks!)

    • sendmarsh says:

      Good question. I don’t have much in the way of pointers for mods. I’d love suggestions on handling mods well for Minecraft deployments on Azure.

  12. Evert says:

    Hi, great job!
    My problem is that when the server is stopped and later restarted, it won’t allow client to connect. Connecting refused error on client side.
    Firewall open in Azure.
    Do you have any clue?

    • sendmarsh says:

      @Evert how are you stopping the server, and are you checking it’s stopped? I’m not sure sudo systemctl stop minecraft-server actually stops the process, a kill might be better.
      If you’re sure no process is running, does sudo systemctl start minecraft-server then work?

      • Evert says:

        By “server”I mean the virtual machine, not the Minecraft server( sorry about the confusion). So my problem is; when the VM is first deployed and started I can connect fine and everything works perfectly, but once the Vm has been restarted, connection is refused. The azure firewall settings are not changed.
        Thanks Evert

      • sendmarsh says:

        When did you first deploy the VM? There was a bug earlier, fixed a few months ago caused by the service not being executable. You can fix it on an existing VM with “sudo chmod +x /etc/systemd/system/minecraft-server.service”

      • Evert says:

        Thanks, by manually starting the Minecraft service after restart it works. I wrote a powershell script for that.
        Best regards

  13. rui says:

    Hi, Thank you for your clear instructions! I have a doubt though. I have signed up for a pay as you go at Azure and I was wondering if just stopping the minecraft server through putty is enough to prevent from incurring in costs, or should the actual VM be stopped in the Azure dashboard?

  14. DaveF says:

    Hi, although I could stop the minecraft system I don’t appear ot be able to start it again:-

    $ sudo systemctl start minecraft-server
    Failed to start minecraft-server.service: Unit minecraft-server.service is not loaded properly: Invalid argument.
    See system logs and ‘systemctl status minecraft-server.service’ for details.

    Not sure what “system logs” it’s suggesting… I can’t see anything wrong in minecraft-server.service

    It does run if I use sudo java -Xms1g -Xmx2g -jar ./minecraft_server.1.12.2.jar
    any ideas?!

  15. DaveF says:

    Thanks for the reply – No same error:
    Failed to start minecraft-server.service: Unit minecraft-server.service is not loaded properly: Invalid argument.
    See system logs and ‘systemctl status minecraft-server.service’ for details.

  16. Pingback: Deploying Minecraft Server on Azure – Mr Stephen

  17. Suneth says:

    I get the same error as Dave F.
    Failed to start minecraft-server.service: Unit minecraft-server.service not loaded.

  18. Adam says:

    Hi, I’m affected by the above issue also – have you been able to apply fix yet? Thanks

    • sendmarsh says:

      The underlying account problems have now been resolved, and there is a fixed version of the Minecraft solution template in Azure Marketplace staging, awaiting approval to publish, so it should just be a few days now.

    • sendmarsh says:

      The fix is now published. Sorry about the time it took.

      • Adam says:

        That’s great, many thanks. Will i need to do a new deployment or is there a way to get my old one working / migrate the world to a fresh deployment?

    • sendmarsh says:

      re: > Will i need to do a new deployment or is there a way to get my old one working / migrate the world to a fresh deployment?
      If you have a working Minecraft deployment on the machine, but the service won’t restart, you could try running an upgrade script to the latest version. E.g.
      sudo bash
      cd /srv/minecraft_server
      chmod +x ./
      ./ 1.12.2

      If you still get the same startup error, then I’m not sure what’s wrong and yes, you could do a new deployment and copy your world there.

      • Adam says:

        Unfortunately I get these errors when i run the above

        curl: (6) Could not resolve host: chmod
        curl: (6) Could not resolve host: +x
        curl: (6) Could not resolve host:
        curl: (6) Could not resolve host:
        curl: (7) Failed to connect to 1.12.2 port 80: Connection timed out

    • sendmarsh says:

      @Adam It’s hard to see where each line ends in my example below, but the chmod command is on a separate line to the curl command. I.e. run the curl command and press Enter, then the chmod command and press Enter, then run the upgrade script and press Enter.

      • Adam says:

        So i ran the commands separately as you suggested (note i think you missed out a command after the curl command to save the file to the server). Anyway, i added this in and was able to run the upgrade however still got the same errors re. systemctl start not being recognised.

        However i have been able to spin up a new version of the template and move my old world across to the new server – so all is good now and i’ve learned a bit of Linux along the way. Happy days! Thanks for your help, and for keeping the template going.

      • sendmarsh says:

        Hey Adam, glad you have a working solution.

  19. Bil Simser says:

    Is this fixed or not as of 4/8/2018? Tried setting this up and the deploy just hangs. VM is running and I can ssh into it but nothing is deployed (there’s a minecraft_server folder but it’s empty). Can I just manually run the file at to get this thing setup? Also on the install there is no “systemctl” command but you can use “service”. Thanks!

    • sendmarsh says:

      Still broken. Jumping through Azure Marketplace hoops in the background. Long version: The ID the template was published using can no longer republish because it was registered as an individual rather than a company – and the updated Developer Marketplace rules are that only companies can publish in the Marketplace. Had to create a new company, go through the company registration and employment verification process, which is now complete, and now waiting on the Marketplace folks to do whatever needs to be done to transfer ownership of the solution template to the new ID. All this for a free template, sigh.
      To answer your question, yes you can run that install script as superuser, though it’s quite a few command line parameters to get right if you’re running it interactively.

      • Bil Simser says:

        Ugh, yeah what a mess. I have to deal with Azure for both my own use and work and totally know what you’re going through. Thanks for the script! Got the server up and running and just ran things manually for now. Will make the kidlet happy so we can play together. Of course now she wants all kinds of mods so off to get a copy of bukkit and get that going now.

      • sendmarsh says:

        Glad you have a working server. Once the Marketplace issues are resolved I’d like to experiment with a template with mods, currently evaluating Hexxit…

    • sendmarsh says:

      Fixed as of 4/13/2018. Finally got a new developer account assigned to the Minecraft solution template and was able to republish.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s