How to Install WireGuard and Set Up a Minecraft Server on Orange Pi for Multiplayer Game with Friends
Minecraft is one of the most popular sandbox video games, allowing players to build and explore virtual worlds made up of block-like structures. If you want to play Minecraft with friends, you can set up a Minecraft server on your Orange Pi and use WireGuard, a simple, fast, and modern VPN, to allow your friends to connect to your server located behind a NAT. Here we provide a detailed guide on how to install WireGuard and set up a Minecraft server on Orange Pi.
Prerequisites
Before you start, you need to prepare the following:
- An Orange Pi device running Armv7 or Armv8.
- A Minecraft account.
- SUDO privileges on your Orange Pi.
- An external drive (optional) to store your Minecraft world for larger maps.
Step 1: Install WireGuard on Orange Pi
WireGuard is a simple, fast, and modern VPN that utilizes state-of-the-art cryptography. Before setting up the Minecraft server, we need to install WireGuard on Orange Pi first:
sudo apt update
sudo apt install wireguardStep 2: Set Up WireGuard for NAT Traversal
A NAT (Network Address Translation) is used to remap one IP address space into another. When your Minecraft server is located behind a NAT, your friends might encounter problems connecting to the server. WireGuard provides an easy solution for this, by setting up a WireGuard interface for both the server and clients.
First, create a WireGuard interface for your Orange Pi Minecraft server:
sudo nano /etc/wireguard/wg0.conf
Add the following lines into the file:
[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey =
Replace with your actual private key for the server.
Next, create a WireGuard interface for your clients:
sudo nano /etc/wireguard/wg-client.conf
Add the following lines into the file:
[Interface]
Address = 10.0.0.2/24
PrivateKey =
[Peer]
PublicKey =
Endpoint = :51820
AllowedIPs = 0.0.0.0/0
Replace with your actual private key for the client, and with your actual public key for the server, and with your actual server public IP.
After setting up the WireGuard interface for both the server and client, run the following commands to bring up the interfaces:
sudo wg-quick up wg0
sudo wg-quick up wg-client
Step 3: Install Minecraft Server on Orange Pi
To install Minecraft server on your Orange Pi, download the Minecraft server JAR file:
wget https://launcher.mojang.com/v1/objects//server.jar
Replace with the actual Minecraft server version you want to use.
Before running the server, you might want to allocate more memory and swap space. You can edit the /etc/dphys-swapfile to increase the swap size.
After editing the swap file, run the following command to start the Minecraft server:
java -Xmx1024M -Xms1024M -jar server.jar nogui
This command sets the maximum and minimum memory to 1GB. You can adjust the value based on your available memory.
Step 4: Port Forwarding
To allow your friends to connect to your Minecraft server, you need to forward the WireGuard port (51820) on your router. The process varies depending on your router brand and model, and you can refer to your router documentation for the exact steps.
Step 5: Connect Your Friends to Your Minecraft Server
After port forwarding, share the wg-client.conf file with your friends and instruct them to download the WireGuard app for their devices. Your friends need to import the wg-client.conf on their devices and run the WireGuard interface. They can join your Minecraft server using your server IP address and port.
In this article, we provided a detailed guide on how to install WireGuard and set up a Minecraft server on Orange Pi for multiplayer game with friends. We covered the installation of WireGuard on Orange Pi, set up WireGuard for NAT traversal, download and set up the Minecraft server on Orange Pi, port forwarding, and connecting your friends to your Minecraft server.