# How to set up a private Minecraft server with Meshnet

## Introduction <a href="#introduction" id="introduction"></a>

Minecraft is one of the most popular multiplayer online games. To [enjoy the full gaming experience of Minecraft](https://nordvpn.com/gaming/minecraft/), you can create your own server and invite friends to join your world.

However, running a public Minecraft server may present a security threat to your home network. The risks you might encounter range from DDoS attacks to unfamiliar devices accessing your network.

With [Meshnet](https://nordvpn.com/meshnet/), you can set up your private Minecraft server and connect to it from anywhere in the world safely. Instead of having to open ports and expose your IP address to strangers online, you and your friends can connect your devices to Meshnet, which in essence, acts as a local area network but with an encrypted VPN tunnel. Also, you won't have to pay for third-party hosting with Meshnet.

To start working on your Minecraft server, check out our video:

{% embed url="<https://www.youtube.com/watch?v=hNWHsPDtw6M>" %}

Alternatively, you can follow the detailed written instructions presented in this article.

## Get started: What’s your Minecraft edition? <a href="#get-started-whats-your-minecraft-edition" id="get-started-whats-your-minecraft-edition"></a>

Currently, there are two separate versions of Minecraft: Bedrock Edition and Java Edition. While both editions support online multiplayer mode, they are compatible with different servers. This means that you will use different server software depending on the game edition you are playing.

This guide walks you through the process of creating a Minecraft server with Meshnet for both editions on the following platforms:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Bedrock Edition</strong></td><td><ul><li>Windows</li><li>Linux</li></ul></td><td><a href="#create-a-minecraft-bedrock-server">#create-a-minecraft-bedrock-server</a></td></tr><tr><td><strong>Java Edition</strong></td><td><ul><li>macOS</li></ul></td><td><a href="#create-a-minecraft-java-server-on-macos">#create-a-minecraft-java-server-on-macos</a></td></tr></tbody></table>

## Create a Minecraft Bedrock server on Windows and Linux <a href="#create-a-minecraft-bedrock-server" id="create-a-minecraft-bedrock-server"></a>

The official Minecraft Bedrock server software supports Windows and Linux.

{% tabs %}
{% tab title="Windows" %}

### Before you begin <a href="#prerequisites" id="prerequisites"></a>

Ensure that the machine that will host the server meets these minimum requirements:

* Intel or AMD processor with at least two cores
* 4 GB of RAM or more
* Meshnet is enabled on your server machine. To learn more, see our guide on [Using Meshnet on Windows](https://meshnet.nordvpn.com/getting-started/how-to-start-using-meshnet/using-meshnet-on-windows).&#x20;

Other players will be able to connect to your Bedrock server if these conditions are met:

* A player's game is Minecraft: Bedrock Edition.
* The game version matches the version of your server.

{% hint style="info" %}
**Note**

All the client devices you would like to invite to join your server need to be connected to your Meshnet.
{% endhint %}

### Download server software <a href="#step-1-download-server-software" id="step-1-download-server-software"></a>

Go to Minecraft's official website and download [Minecraft Dedicated Server Software for Windows](https://www.minecraft.net/en-us/download/server/bedrock).

### &#x20;Run your Bedrock server

1. Extract the downloaded archive to a convenient location.
2. Open the **bedrock\_server.exe** file.

   <figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FI53ETajQwcJYMEEtd3Cn%2Fmc_bedrock_server_dark.png?alt=media&#x26;token=fb75df34-1fcb-4087-bcf0-843a310f3386" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F0Y7TmgCb8T8D4LdcDP6I%2Fmc_bedrock_server.png?alt=media&#x26;token=fd77642f-f927-42f2-9bd3-17f13bc483f6" alt="&#x22;bedrock_server&#x22; executable selected in File explorer."></picture><figcaption></figcaption></figure>

   &#x20;
3. If the **Windows security alert** box appears, select both the *private* and *public* networks options, and then click the **Allow access** button to allow incoming connections through the firewall.&#x20;

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FCwZ4QqjaD0XLSEYUCBW9%2Fmc_firewall_prompt.png?alt=media&#x26;token=13ccde7a-1fbb-411d-8af2-e5375cde7aa4" alt="Windows Defender firewall message" width="563"><figcaption></figcaption></figure></div>

{% hint style="success" %}
**Tip**

If you want to check your firewall settings for the Bedrock server, click the **Start**<img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FGTHMj8B4fgledLDhPDUm%2Ficon_win_start_11_blue.svg?alt=media&#x26;token=045c5a29-141c-44c1-9dfa-08d59d6bf047" alt="" data-size="line"> button on the taskbar, type **Allow an app through Windows Firewall**, and find *bedrock\_server.exe* in the list of results.
{% endhint %}

Your Bedrock server should now be up and running.&#x20;

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FT1Kv1GRbrGYE8FZYo2Ro%2Fmac_bedrock_cli.png?alt=media&#x26;token=18489e0a-8789-45f9-8dd9-7d487f36fe19" alt="Bedrock Minecraft server started"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note**

If you encounter connection issues, you may need to exempt the Minecraft client from UWP loopback restrictions. To do this, open **Windows PowerShell** or **Command Prompt** as an administrator and enter the following:

{% code overflow="wrap" %}

```bash
CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe"
```

{% endcode %}

Alternatively, you can enter the command provided in the *bedrock\_server\_how\_to* file:

{% code overflow="wrap" %}

```bash
CheckNetIsolation LoopbackExempt -a -p=S-1-15-2-1958404141-86561845-1752920682-3514627264-368642714-62675701-733520436
```

{% endcode %}
{% endhint %}
{% endtab %}

{% tab title="Linux" %}

### Before you begin <a href="#prerequisites" id="prerequisites"></a>

Ensure that the machine that will host the server meets these minimum requirements:

* Ubuntu 20.04 or later
* 64-bit Intel or AMD processor with at least two cores
* 4 GB of RAM or more
* Meshnet is enabled on your server machine. To learn more, see our guide on [Using Meshnet on Linux](https://meshnet.nordvpn.com/getting-started/how-to-start-using-meshnet/using-meshnet-on-linux).

Other players will be able to connect to your Bedrock server if these conditions are met:

* A player's game is Minecraft: Bedrock Edition.
* The game version matches the version of your server.

{% hint style="info" %}
**Note**

All the client devices you would like to invite to join your server need to be connected to your Meshnet.
{% endhint %}

### Download server software <a href="#step-1-download-server-software" id="step-1-download-server-software"></a>

1. Open **Terminal**.
2. Navigate to the directory where you want to install your server using the `cd` command followed by the path to your directory.\
   &#x20;\
   **Example**

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">cd ~/Desktop
   </code></pre>

   &#x20;
3. Create a new folder for storing your server files using the `mkdir` command and navigate to it using `cd`.\
   &#x20;\
   **Example**

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">mkdir server &#x26;&#x26; cd server
   </code></pre>

   &#x20;
4. Go to [Minecraft's official website](https://www.minecraft.net/en-us/download/server/bedrock), find the "Minecraft Dedicated Server Software for Ubuntu (Linux)" section, right-click the **Download** button, and copy the link address.
5. In the terminal, enter the `wget` command and paste the copied link to download the server archive.\
   &#x20;\
   **Example**

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">wget https://minecraft.azureedge.net/bin-linux/bedrock-server-1.21.1.03.zip
   </code></pre>

### Run your Bedrock server <a href="#step-2-run-your-bedrock-server" id="step-2-run-your-bedrock-server"></a>

1. Extract server files from the downloaded archive by entering the `unzip` command, as shown:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">unzip bedrock-server*
   </code></pre>

   \
   If the `unzip` command does not work, you may need to install the unzip package by entering `sudo apt install unzip`.<br>
2. Enter the following to start the server:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">./bedrock_server
   </code></pre>

   &#x20;\
   Use this command each time you want to start the server.

Your Bedrock server should now be up and running.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FJFBlUXWoxmdPP12uBZEM%2Fmc_bedrock_linux.png?alt=media&#x26;token=8a2bef32-3e39-4ea6-8a55-5c226f6ef9a7" alt="The server is starting in the terminal"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Tip**

To configure the server to your liking, find the `server.properties` file in the extracted server folder and edit the file with any text editor. The changes will take effect after you restart the server.

To stop the server, you can enter the `stop` command.
{% endhint %}

### Connect to your Bedrock server <a href="#howtomakeaprivateminecraftserverwithmeshnet-step3winstep3-connecttoyourbedrockserver" id="howtomakeaprivateminecraftserverwithmeshnet-step3winstep3-connecttoyourbedrockserver"></a>

1. Make sure that the device on which you play the game has the NordVPN app running and the Meshnet feature is enabled in the app.
2. Open **Minecraft.**
3. Select **Play** and choose the **Servers** tab.
4. Scroll to the bottom of the servers list and select the **Add server** button.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FIQBGxigW93SQms4BFFjt%2Fmc_bedrock_add_server.png?alt=media&#x26;token=0ca5c5cc-2124-4f07-a23c-6dfd41735874" alt="" width="563"><figcaption></figcaption></figure></div>

   &#x20;
5. In the **Add external server** dialog, fill in the following details:
   * In the **Server name** field, enter a custom name to identify your server in the client.
   * In the **Server address** field, type in the Meshnet IP address of the server device.\
     &#x20;\
     **Example**

     <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F9fhqm5aonr5EaT42uKOo%2Fmc_bedrock_server_details.png?alt=media&#x26;token=352e122a-fdac-440b-bf50-adc2b6988935" alt="" width="563"><figcaption></figcaption></figure></div>

     &#x20;
6. Click **Save**.

Your server will appear under **Additional servers**. To connect, select it and click **Join server.**

### Invite friends <a href="#howtomakeaprivateminecraftserverwithmeshnet-step4-invitefriends" id="howtomakeaprivateminecraftserverwithmeshnet-step4-invitefriends"></a>

Now that you've created your Minecraft server, you can invite other players to join your game.

1. To connect to your server, your friends need to know the Meshnet IP address of your server machine and have Meshnet enabled on their devices.
2. Once the other players repeat the steps described in the [Connect to your Bedrock server](#howtomakeaprivateminecraftserverwithmeshnet-step3winstep3-connecttoyourbedrockserver) section above, they will gain access to your server.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FtcIH4MR1TUQhiI4VxFbD%2Fmc_bedrock_join.png?alt=media&#x26;token=7c3457a7-8e01-4057-ba6a-b4c2ce36e466" alt="The created server visible under Additional servers" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note**

Minecraft regularly releases Bedrock server software updates. If you get a message stating that your server is outdated, you’ll need to upgrade the server to the latest version. Otherwise, you will not be able to connect to your server.

Because the server files will be replaced after your upgrade is complete, you may wish to have a backup copy of the `server.properties` file if it contains extensive custom changes.
{% endhint %}

## Create a Minecraft Java server on macOS

The official Minecraft Java server software supports various platforms, including macOS, Windows, and Linux. This guide covers setting up a Java server on macOS.

### Before you begin <a href="#howtomakeaprivateminecraftserverwithmeshnet-requirements" id="howtomakeaprivateminecraftserverwithmeshnet-requirements"></a>

Ensure that the machine that will host the server meets these minimum requirements:

* Java 17 or later is installed. On [Oracle's website](https://www.oracle.com/java/technologies/downloads/#jdk19-mac), select **Arm 64 DMG installer** if your Mac is ARM-based or **x64 DMG installer** if your Mac uses an Intel processor.\
  To check if Java is installed on your machine, open the **Terminal** app and type `java -version`.
* 64-bit Intel or Apple silicon processor with at least two cores
* 2 GB of RAM or more
* Meshnet is enabled on your server machine. To learn more, see our guide on [Using Meshnet on macOS](https://meshnet.nordvpn.com/getting-started/how-to-start-using-meshnet/using-meshnet-on-macos).

{% hint style="info" %}
**Note**

All the client devices you would like to invite to join your server need to be connected to your Meshnet.
{% endhint %}

Other players on your Meshnet will be able to connect to your Java server if these conditions are met:

* A player's game is Minecraft: Java Edition.
* The game version matches the version of your server.

### Download server software

1. Download the `server.jar` file from [Minecraft’s official website](https://www.minecraft.net/en-us/download/server).
2. Create a new folder on your Desktop or in any location you can easily find and name your folder as you wish (for example, *server*). You will use this name to run commands for the server.
3. Move the downloaded JAR file to your new folder. This folder will store your server files.

### Run your Minecraft Java server

1. Open **Terminal**, and type `cd` followed by the path to the folder containing your server JAR file, like this:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">cd Desktop/server
   </code></pre>

   &#x20;\
   If requested, allow the Terminal app to access the folder.
2. Then type:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">java -jar server.jar
   </code></pre>

   &#x20; \
   Your server will generate several files in the server folder.
3. Navigate to your server folder, open the *eula.txt* file, and change `eula=false` to `eula=true`.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F1bdlSUqOXOTPJaFGyZOG%2Fmc_java_eula_dark.png?alt=media&#x26;token=01f29374-b669-45d1-ad55-35c662bdbde0" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FlFjb5hQzTaODSLX4pb1C%2Fmc_java_eula.png?alt=media&#x26;token=d4d08f3c-4e5f-4786-8e0a-4ed5f76f2238" alt="&#x22;eula=true&#x22; highlighted in a text editor."></picture><figcaption></figcaption></figure></div>

   &#x20;\
   Save the file. This way, you confirm the acceptance of license terms for the Minecraft server software.
4. Now you can run the server. Open **Terminal**, type `java -jar server.jar` again, and press **Return**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FPormVFBN6KShxPDWfOdx%2Fmc_java_server.png?alt=media&#x26;token=dd77ce72-8159-4295-b724-5fb706b4ef3c" alt="Minecraft server GUI showing the server log"><figcaption></figcaption></figure></div>

   &#x20;\
   If you want to start the server without its graphical user interface, add a space and `--nogui` to the command.

{% hint style="success" %}
**Tip**

Use the `java -jar server.jar` command each time you want to start the server.

To stop the server, enter the `stop` command at the Minecraft server command prompt.
{% endhint %}

### Connect to your Minecraft Java server  <a href="#step-3-join-your-bedrock-server" id="step-3-join-your-bedrock-server"></a>

1. Make sure that the device on which you play the game has the NordVPN app running and the Meshnet feature is enabled in the app.&#x20;
2. Open **Minecraft** and click the **Multiplayer** button.
3. In the lower-right corner, select **Add server**.

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FFmFjjklaSXHBV4rjQfZB%2Fmc_java_add_server.png?alt=media&#x26;token=7d59914e-b718-4f13-94d1-a186bc3b00fd" alt="&#x22;Add server&#x22; button highlighted."><figcaption></figcaption></figure>

   &#x20;
4. In the **Server name** field, enter a custom name to identify your server in the client.
5. Fill in the **Server address** field:
   * If you're connecting from the same device that is running the server, type in `127.0.0.1`.
   * If you're connecting from another device, enter the Meshnet IP address of the server device.\
     &#x20;\
     **Example**

     <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FKZyHRBSXXZHJCcAXTmdI%2Fmc_java_server_details.png?alt=media&#x26;token=dbbdae32-8b48-4818-be2c-a92c540cf2e2" alt="&#x22;Server name&#x22; and &#x22;Server address&#x22; fields filled in with the server&#x27;s information."><figcaption></figcaption></figure>

     &#x20;
6. Click **Done**.

The server will now be available under "Play multiplayer". To connect to your Meshnet server, select it and click **Join Server**.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FvM8fqK0tLcNh6lC6Rbm8%2Fmc_java_join.png?alt=media&#x26;token=58a22236-ca98-4cb7-bed8-c693d6f856dd" alt="&#x22;Meshnet server&#x22; selected and the &#x22;Join server&#x22; button highlighted."><figcaption></figcaption></figure>

### Invite friends <a href="#step-4-invite-friends" id="step-4-invite-friends"></a>

Now that you’ve created your Minecraft server, you can invite other players to join your game.

1. To connect to your server, your friends need the Meshnet IP address of your server machine and Meshnet enabled on their devices.&#x20;
2. Once other players on your Meshnet repeat the steps described in the [Connect to your Minecraft Java server](#step-3-join-your-bedrock-server) section above, they will gain access to your server.&#x20;
