VPS

How to Make a Minecraft Server

Setup Minecraft Server On Ubuntu

This tutorial will show you how to make a Minecraft server on various platforms. By the end, you’ll know how to set up a Minecraft server on Linux, Windows, and Mac operating systems.

At the very core, these are the summarized steps on how to set up a Minecraft server:

  1. Install the latest version of Java;
  2. Choose a location for your Minecraft server;
  3. Set up the server and perform network configuration;
  4. Start the Minecraft server;
  5. Check if the server is accessible and enjoy the game!

Overall, Minecraft is a sandbox video game developed by Mojang. It ranks amongst the most popular games on 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 enjoy multiplayer mode, players need to either set up their own Minecraft server or use a hosting provider. In this guide, we will focus on how to set up your very own Minecraft server on Linux, Windows, and Mac. If you have a virtual server on Hostinger, you can use these instructions and play with your friends and family!

How to Make a Minecraft Server on Linux

How to make a Minecraft server on the most popular Linux distributions such as Ubuntu, CentOS, and Debian

Let’s see how we can make a Minecraft server step-by-step on two of the most popular Linux distributions – Ubuntu and CentOS. While the process is quite similar on these operating systems, there are a few differences you’ll notice while installing the required packages.

Setting Up a Minecraft Server on Ubuntu

Firstly, we’ll create a Minecraft server using a VPS running on Ubuntu 16.04. The whole process can be broken down to three simple steps.

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. Keep in mind that Minecraft server setup requires Java to be installed on your system. 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 instructions. Otherwise, you are done with this section and can move on to step 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

Now you need to install Java. We are installing Java 17 for this tutorial:

sudo apt-get install openjdk-7-jdk

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

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

Once created, move inside the newly created directory by typing the following:

cd minecraft

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

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.

Accept Minecraft’s end-user license agreement:

echo "eula=true" > eula.txt

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. Here’s what you should see after executing the command: Running a Minecraft Server on Ubuntu VPSAnd 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

Setting Up a Minecraft Server on CentOS 7

Let’s see how to make a Minecraft server on a VPS running CentOS 7. The process is slightly different compared to Ubuntu.

Step 1 – Installing Java and Screen

Firstly, you will have to install Java as Minecraft is built purely on it. Next package will be Screen, it is required for the Minecraft server to work once the SSH session ends. Connect to your VPS server via SSH (Windows users can use Putty SSH client for this) and run this command to install both packages:

yum install java screen -y

Step 2 – Installing Minecraft Server on CentOS 7

In order to organize the installation, you should create a dedicated directory for Minecraft by running this command:

mkdir minecraft

Then just change the working directory to the one that you have just created:

cd minecraft

Download Minecraft server package:

wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.10.2/minecraft_server.1.10.2.jar

Start the Screen with adequate name:

screen -S "Minecraft server"

Accept EULA agreement by changing the value from false to true in eula.txt file. Use this command to edit the file:

nano eula.txt

Step 3 – Running Minecraft Server

Finally, you can run the server using this command:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

It should display something like: Running a Minecraft server on CentOS 7 VPSThe Minecraft server has been successfully started, you can exit the Screen using CTRL-A + D keyboard shortcut.

Settings of the server can be changed by editing the options file:

nano server.properties

How to Make a Minecraft Server on Windows

How to make a Minecraft server on Windows

You can also set up a Minecraft server on your Windows PC. Once again, we’ll try to cover everything you need to know using three steps.

Step 1 – Get the latest Java version

Since Minecraft is based on Java, we will have to install the latest version to ensure that everything runs smoothly. You may use the command prompt to check if you meet to requirements. Execute the following:

java -version

Then, make sure it matches the latest Java version in the official website. Download and install it in case your current version is older or if you do not have Java at all. Installing the latest version of Java on Windows

Step 2 – Installing Minecraft Server on Windows

Next, you should choose a location where you’ll set up the Minecraft server. To keep everything organized, we recommend creating a dedicated folder for this task. Once that’s done, download the latest Minecraft server setup software from the official site. Download the latest Minecraft server version for WindowsMove the .jar file to the directory that you created earlier and double click it. Minecraft server contentsBefore proceeding to start the Minecraft server, you will need to accept the EULA agreement. This can be done by editing eula.txt file and changing from eula=false to eula=trueAccepting the Minecraft EULA agreement

Step 3 – Running Minecraft Server

You can start the Minecraft server with the help of Windows command prompt. Use it to navigate to your dedicated Minecraft server directory. For example:

cd Desktop/MinecraftServer

Initiate Minecraft server by executing the following command:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Alternatively, you may double click the .jar file again and it will also do the trick. You might need to allow the Minecraft server through the firewall. Allowing Minecraft server in Windows firewall

If you see a similar screen, it means that your Minecraft server has been successfully started: Minecraft server running on Windows

How to Make a Minecraft Server on Mac

How to make a Minecraft server on MacOS

Last, but not least, let’s see how we can make a Minecraft server using MacOS. We will break down the process into three steps.

Step 1 – Installing Java and Screen

Java is included by default if you’re using a newer MacOS version. You can double check by entering this command in your Terminal:

java -version

If it’s not available, you may download a legacy Java version from the Apple website.

Step 2 – Installing Minecraft Server on Mac

To keep everything neat and organized, it’s best to dedicate a folder for your Minecraft server. Once created, download the Minecraft server setup from the official website. Downloading minecraft server software on MacUpload it to the created directory. Then, open TextEdit and set the format to plain text (Format › Make Plain Text). Paste the following:

#!/bin/bash
cd "$(dirname "$0")"
exec java -Xms1024M -Xmx1024M -jar minecraft_server.jar nogui

Save this file as startmc.command in the same directory where the Minecraft server setup file resides. To make it work, execute permission will be needed. We can grant them with the help of Terminal located in Applications › Utilities section. Once opened, enter your dedicated Minecraft folder. For example:

cd Desktop/MinecraftServer

You can grant the required permission with the help of this command:

chmod a+x startmc.command

Step 3 – Running Minecraft Server

If all steps were followed correctly, you’ll be able start your Minecraft server by double clicking the startmc.command file. After that, a new Terminal windows will pop up. Running a Minecraft server on MacOSYou may notice a few missing file/directory warnings when doing it for the first time. No need to worry though, as that is completely normal!

Final Word

Congratulations! By finishing this tutorial you have learned how to make a Minecraft server on various platforms and operating systems.

Do you have any ideas, tips, or tricks that you want to share? We eagerly await them in the comments below!

About the author

Gediminas B.

Gediminas is a passionate content writer and SEO geek at Hostinger. He started his journey at customer support and aims to use his gathered knowledge to create the most epic content the world has ever seen. From WordPress to server management, there's no topic he can't cover! He also likes cats.

9 Comments

Click here to post a comment

Leave a Reply to Steve G Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • 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.

      • Hey Domantas,

        I think you should have a tutorial on how to set up a Spigot Minecraft server. It’s a lot more user friendly 🙂

        • Hello, Justin! Thank you for the suggestion. We’ll make sure to keep it in mind when publishing future tutorials! 😉

      • I’m having the same problem as John. I have the server running (I can tell because I removed the “nogui” option so I can see the window of what it is doing). When I go to the iPad or Android apps and try to connect to the server I get an error that it can’t connect. I am on the same network and entering the server’s IP and the port number that the server is reporting (25565). Does server name matter? The name I gave the server is Step 2-6 is too long to fit in the name field in the app.

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

Close