How to Setup a Minecraft Server on Ubuntu 16.04

Setup Minecraft Server On Ubuntu


Minecraft is a sandbox video game developed by Mojang. It ranks amongst the most streamed titles on game streaming sites such as Twitch. While players can play the game on their own, there is also a multiplayer mode which boasts quite a healthy online community.

To play Minecraft’s multiplayer mode, players need to either setup their own server, or use a hosting provider. In this tutorial, we will show you how to setup your very own Minecraft server on Ubuntu 16.04. Players using any other variant of Linux can also follow this tutorial, as the steps do not vary.

Step 1 – Installing Java and Screen

Before you begin, you need to connect to your server via SSH. To login to your server, open up the terminal (or use Putty SSH Terminal if you are on Windows) and type in the following command:

ssh username@ipaddress

Once logged in, you can formally start setting up your own Minecraft server.

Minecraft server setup requires Java to be installed on your system. To do this, follow these steps:

  1. You actually might already have Java installed on your system. To check this, execute the following command:
    java -version

    If you get a message which says Java was not found on your system, you can continue following the rest of these steps. Otherwise, you are done with this section and can move on to step 2.

  2. Run the following command in your terminal to download the latest packages of software installed on your system, including Java:
    sudo apt-get update
  3. Now you need to install Java. We are installing Java 17 for this tutorial:
    sudo apt-get install openjdk-7-jdk
  4. Just in case you want the latest version of Java, you can run the following instead of the above command:
    sudo apt-get install default-jdk
  5. Here we should also install screen, which will ensure that your server keeps running in the background even if you drop the connection. To do this, type in the following and execute:
    sudo apt-get install screen

You should now have Java and Screen installed on your system.

Step 2 – Installing Minecraft Server on Ubuntu

With the pre-requisites out of the way, we can now focus on installing the Minecraft server on Ubuntu VPS. To do this, simply repeat the following steps:

  1. It is always better to keep things clean and tidy. To avoid making a mess, create a new directory which will hold all your Minecraft files in one location. This step is optional, though for the sake of your sanity, we highly recommend it. To make a new directory, run this:
    mkdir minecraft
  2. Once created, move inside the newly created directory by typing the following:
    cd minecraft
  3. Next, you need to have wget on your system. If you don’t already have it installed, simply execute the following command:
    sudo apt-get install wget
  4. Now download and install your own Minecraft server:
    wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar

    At the time of the writing, the latest version available is 1.11.2. You should replace this number with whatever the latest version is at the time. To check, visit this link.

  5. Accept Minecraft’s end-user license agreement:
    echo "eula=true" > eula.txt
  6. Get screen up and running, so that the server can run in the background:
    screen -S "Minecraft server 1"

    We’ve named the current session ‘Minecraft server 1’, but you can use any other name instead.

And that’s it – you have successfully installed your custom Minecraft server on Ubuntu.

Step 3 – Running Minecraft Server

Now you only need to run the installed server. To achieve this, run the following in the terminal:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

As you can see, Minecraft requires you to have 1024MB or 1GB of RAM available to boot up the server. While this is the minimum requirement, we recommend having more RAM on board for better performance. To allocate more memory to the server, simply replace 1024 in the -Xmx and -Xms parameters with 2048 (2GB) and so on.

And there you have it: your very own Minecraft server setup in merely minutes. The server is running in the background, as per our use of screen. To opt out of screen, press CTRL + A, then D. You can undo this and re-open screen’s window by typing screen -r in the terminal. Finally, you can fiddle around with your server’s settings through the server properties file:

nano ~/minecraft/server.properties


In this step by step tutorial, we saw how you can setup a custom Minecraft server on Ubuntu. We also learned other useful stuff, like installing Java on Ubuntu, as well as setting up screen so that the server keeps running in a background window.

As stated in the introduction, players have the option to get themselves a hosted server. But this tutorial is for those who want their own server for maximum security and control.


Click here to post a comment

  • I ran minecraft and its working, but once i edited the properties of the server to change game mode and max players, it doesnt update. I figure i need to end the server program then run it again, but i am unsure how to end the program?

    • I get that this is old and all, but you need to set the properties then hit [CTRL] [X] then it will prompt you to hit [y] for yes or [n] for no type [y] and hit enter

  • I have to run the command as sudo otherwise it gives errors…

    sudo java -Xmx1024M -Xms1024M -jar minecraft_server.1.12.2.jar nogui

    [19:12:37] [Server thread/INFO]: Starting minecraft server version 1.12.2
    [19:12:37] [Server thread/INFO]: Loading properties
    [19:12:37] [Server thread/INFO]: Default game type: SURVIVAL
    [19:12:37] [Server thread/INFO]: Generating keypair
    [19:12:37] [Server thread/INFO]: Starting Minecraft server on *:19132
    [19:12:37] [Server thread/INFO]: Using epoll channel type
    [19:12:37] [Server thread/INFO]: Preparing level “world”
    [19:12:37] [Server thread/INFO]: Loaded 488 advancements
    [19:12:37] [Server thread/INFO]: Preparing start region for level 0
    [19:12:38] [Server thread/INFO]: Done (0.888s)! For help, type “help” or “?”

    But when I add the server to minecraft, it just shows as “Locating server” and if I select the server it says “Unable to connector to world”.

    I have tried disabling the Ubuntu firewall (ufw) and added the port forwarding on my router but it makes no difference.

    I am trying to get this working on an internal network (LAN) and have tried different ports with no luck.

Join thousands of subscribers worldwide

and get awesome deals & the newest tutorials to your email

Please wait...

Thank you for sign up!

More in VPS
How to Connect to Your Account Using Putty SSH terminal