SkillAgentSearch skills...

MinecraftWireGuardGuide

How to create a Minecraft server using WireGuard & PiVPN!

Install / Use

/learn @ShiroTohu/MinecraftWireGuardGuide
About this skill

Quality Score

0/100

Supported Platforms

GitHub Copilot

README

How To Setup A Private Minecraft Server Using PiVPN and WireGuard

[!WARNING] This guide is incomplete

<h2>Disclaimer <img alt=":meow_bounce:" src="https://emojis.slackmojis.com/emojis/images/1643515239/12570/meow_bounce.gif?1643515239" width="40"> </h2>

This guide is intended to provide information and guidance on how to setup a private Minecraft server using WireGuard. Every effort has been made to ensure that the information presented in this guide is as accurate as possible. Despite this, it is possible that some information in this guide may be inaccurate. I encourage people reading this guide to consult relevant online sources to enhance the guides accuracy and maybe learn more along the way. I have linked the sources used in this guide in the footnotes section and suggest going there for further reading. <3

Table of Contents

Introduction

In this guide, I will cover how to create a private Minecraft server using PiVPN & WireGuard. This guide is meant for private Minecraft servers, using WireGuard to host a public Minecraft server is not recommended as there are better methods of doing that. If you are looking to host a public Minecraft server, consider hosting with a VPS or Paid Provider. This guide will cover everything from WireGuard basics, configuring the the operating system, deploying the minecraft server and more.

I have also uploaded a video on my YouTube channel in case you want to follow along in video format. Keep in mind that throughout the video you will have to refer back to specific parts of the guide so that you will have the most up to date information. The video also uses the recommended items and topology. For cases not covered in the video don't worry as they shouldn't differ too much from the video.

<!-- This is here, so that I can get a general understanding of what a youtube video looks like in the document -->

Temporary Youtube Link

Purpose & Motivation ~

I utilized PiVPN and WireGuard when I was developing StorageSolution. StorageSolution is a full-stack application I developed that allowed the computers from CC: Tweaked to display all the items in my storage system in a nice and presentable manner using Python Textualize. I created a backend API to distribute the contents of my storage system to the frontend where the end-user could then see the items in table format. Examples online showed backend solutions using ngrok that exposed the backend to the internet. This isn't something that I really wanted since anyone could establish a websocket connection with the server, therefore to limit the server's exposure I setup a WireGuard VPN in a configuration where both the Minecraft and backend server was located within the VPN (Virtual Private Network).

Ever since then, WireGuard has been my preferred way to host my private Minecraft servers with peers. I also wanted to document the process since there are limited resources out there to help since I've been setting up these servers for a while.

Target Audience ~

I wrote this guide with beginners in mind as I suspect that most people reading this guide might be new to networking or just want a way to play with friends. This guide is the equivalent on the -vv argument flag as this guide contains much information I could possibly cram.

Overview of Steps

There is a lot of filler mixed into this guide, therefore make sure to lookout for headers that have a tailing ~ symbol.

  • What is WireGuard?
    • Here I explain what WireGuard is, how it works, and whether it is suitable for the task of hosting a Minecraft server. I will then try and address any concerns you might have alongside listing alternative methods you can use instead.
  • Choosing Server Topology
  • Setting Up The Operating System
  • SSHing into your server
  • Setting Up WireGuard
  • Creating Key Pairs
  • Distributing Key Pairs
  • Creating the Minecraft Server
  • DNS Configuration
  • Changes

Any Prerequisites or Requirements?

Below I have listed the prerequisite items needed in order to complete this guide. Though, the items stated is just a recommendation. There are many different ways you can configure the WireGuard server to suit your needs. Feel free to look at the Choosing Server Topology section of the guide where I go more in depth in different ways you can configure the WireGuard Server.

  • Recommended
    • Micro SD Card / USB Drive
    • Internet Connection
    • Debian Based Computer (PiVPN)
    • Computer (Minecraft Server)
    • Computer (To play on)
  • Minimum
    • Internet Connection
    • Computer (PiVPN, Minecraft Server, To play on)

Encouragement & Direction ~

I know some of you might want to get straight in and skip sections in order to get this setup straight away, that's great! but, I do recommend reading the Why WireGuard? section if you are thinking of doing that as you might find that WireGuard might not be for you. If you are determined to get started good luck on your journey! :)

What is WireGuard?

Before explaining what WireGuard is I think it is important to understand what a VPN generally is and the basic operations of it.

A virtual private network (VPN) is a mechanism for creating a secure connection between a computing device and a computer network, or between two networks, using an insecure communication medium such as the public Internet.^1

A WAN (Wide Area Network) is a network that extends over multiple geographical regions^2. An institution could deploy a WAN completely separate from the public internet, so that data sent from the hosts and servers are sent in a secure and confidential manner, this would be referred to as a private network[^3]. Private Networks can be quite costly in where the institution would have to purchase, install and maintain their own physical network infrastructure[^3]. Therefore, nowadays, institutions deploy VPN's to solve the same problem. VPN use the existing public internet rather than an separate independent network. To provide the confidentiality that the separate network provided, the traffic is encrypted before it is sent over the public internet[^3] .

[^3]: Kurose, J. F., & Ross, K. W., (2017) Computer Networking: A Top-Down Approach (pp. 666). Pearson Education Limited. ^4: https://www.fortinet.com/resources/cyberglossary/cia-triad

WireGuard is a relatively new open source VPN solution that uses state-of-the-art cryptography. It aims to be faster and more simpler to learn than other alternatives. On the WireGuard website it states the following 5 principles^4:

  • Simple & Easy-to-use
  • Cryptographically Sound
  • Minimal Attack Surface
  • High Performance
  • Well Defined & Thoroughly Considered

It was specifically created for the Linux Kernel by Jason A. Donenfeld in 2015 though has spread to other platforms as well such as IOS, Android, Mac and Windows.

WireGuard Performance (See https://www.ckn.io/blog/2017/11/14/wireguard-vpn-typical-setup/ this image was also taken from the Unofficial WireGuard Documentation)

WireGuard is quite performant compared to other VPN solutions as seen above. The results are similar to the findings on the WireGuard official website. Though both of these benchmarks seem to be outdated. Though in a recent finding (2023) found here WireGuard still outperforms OpenVPN. This speed is what we want when runn

Related Skills

View on GitHub
GitHub Stars14
CategoryDevelopment
Updated2mo ago
Forks0

Security Score

95/100

Audited on Jan 26, 2026

No findings