How to make a Minecraft server on Windows and Mac using Linux

Altcoins today
Tech Theory
Published in
5 min readJul 29, 2019

Minecraft is a very popular video game that has received renewed attention as of lately.

But Minecraft is more than just a videogame. It teaches children how to start coding; it has an open platform expanded by mod developers; and it’s the heart of a global internet community of creators.

If you’re new to Minecraft, the best way to start is by purchasing the game and jumping straight in. You can even use Minecraft Realms after purchase to create your own world — it’s a lightweight alternative to running your very own private Minecraft server.

But if you’re interested in the classical Minecraft experience, you can step it up a notch by launching your own private Minecraft server. With a private server, you’re free to create a Minecraft world of your very own and have the ability to share your server with the entire world 24/7.

We’ll look at how to make a Minecraft server on a Windows PC, on a Mac, by using a Linux VPS.

Hostinger offers affordable and high-grade servers for hosting your server and I personally highly recommend them.

To get the best discount available — click here to go to Hostinger.

To run our demanding video game server I recommend the 8-core VPS which currently costs a mere 30 EUR/mo and will make sure our game runs smoothly at all times, for all players.

How to make your Minecraft server on Windows, Mac, or Linux

At a very high resolution, making a Minecraft server follows the following steps:

  • Installing the latest version of Java
  • Installing the latest version of the Minecraft server
  • Configuring your server & network settings
  • Starting the server
  • Checking that your server is accessible by joining the world

Before you start

Setting up a server takes some effort and basic technical knowledge. Nonetheless, I will walk you through this process.

A basic understanding of computers and networking might help you through setting up your server.

In this tutorial we will:

  • Use the linux command line through an SSH session
  • Configure networking (IP, portforwarding, firewall)
  • Minecraft server configuration
  • Minecraft network configuration
  • Portforwarding configuration

Hosting a Virtual Private Server

Hosting your Minecraft server from home means that you’ll be exposing your home network to the world and that your Minecraft server is likely not to be online 24/7. This will deter new players from joining at all.

If you’d rather not take that risk and would like for players to be able to join 24/7 and have the benefits that a standalone VPS has to offer, this is for you. You do need to pay a monthly or annual fee, however, you don’t need to purchase hardware equipment and maintain the machine, this is all taken care for for you.

A Hostinger Virtual Private Server is a good fit if you’re just getting started. The server shown above is a dedicated one, meaning that you are not sharing resources with other users and have the full-fledged capabilities of the service at your disposal.

Making a Minecraft server on Windows or Mac

Configuring your VPS is possible from any operating system. The section below will explain in detail how you will leverage your current computer to set up your Minecraft server.

Making a Minecraft server on a VPS

As mentioned before, a Linux VPS hosting plan from Hostinger is a dedicated and secure option, even if you’re just experimenting or are not expecting a lot of players to join your server. If, however, a lot of players are interested in joining your server, this VPS will have no problem keeping up with the demand.

After ordering your VPS, we are going to connect through SSH with our VPS.
You can do so by opening CMD on windows or the terminal on Mac.
On Windows simply search for ‘CMD’ and hit enter.
On Mac perform the following shortcut: ‘Control + Option + Shift + T’

A new window pops up akin to this one, this window accepts user input commands. We will use this to connect to our VPS. Hostinger has provided you with:

  • the IP address
  • username
  • password

Perform the following command replacing the info with what you received:

ssh username@ipaddress

Next, confirm by typing ‘yes’ if required and enter the password.
Now we are connected to our VPS! :)

1. Install Java

While SSH’d into your host enter the following command:

apt-cache search openjdk

This lists the available OpenJDK packages that can install Java on the machine.
For example, we’ll select openjdk-7-jdk, which is the OpenJDK 7 Development Kit.

Next, update the list of available packages:

apt-get update

Install the selected software:

apt-get install openjdk-7-jdk

Press “Y” when prompted to confirm the installation. Once done, verify that Java has been successfully installed:

java -version

You should see the version of Java that has just been installed onto your machine.

2. Creating a location for your Minecraft server files.

Create a directory where the Minecraft server files should be saved.
We will call this directory ‘minecraft’ and enter that folder by performing the ‘cd’ aka change directory command.

mkdir minecraft
cd minecraft

3. Downloading the Minecraft server files.

Within this directory, run the wget command to download the Minecraft server files:

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

(Tip: Go to the Minecraft download page for the latest version.)

Next, we will open tmux to ensure that our server keeps running after we close the CMD/SSH session.

tmux

4. Start your Minecraft server!

java -Xmx4G -Xms4G -jar minecraft_server.1.12.2.jar nogui

(Tip: You can change the -Xmx and -Xms settings to adjust allocated memory for the Minecraft server. For example, you could enter -Xmx8G -Xmx8G to allocate 8GB of RAM instead of 4.)

When executing was a success, stop your server — we have some configurations to set.

stop

Edit the ‘server.properties’ file with nano

nano server.properties

and change enable-query=false to:

enable-query=true

Save the “server.properties” file with CTRL+O and CTRL+X and restart your server using the same command above. (java -xmx4G…) From there, enter your server IP address into the Minecraft Server Status Checker to see if it’s publicly accessible for anyone to play.

Next up, go to Minecraft — enter the IP address of your server and start building!

If you have any questions, please leave them below and I will be happy to answer them.

--

--