Creating a Mindustry server tunnel

I decided to host a private Mindustry server for my friends using playit, and I saw there was no tunnel for Mindustry, so this guide will be simply about setting up a custom tunnel to host a Mindustry server through playit. Apologies if I’m bad at explaining

Step 1 - Getting the server jar

Some notes that you can safely skip

Mindustry is actually written in Java, infact when you execute the Windows executable, it just runs a Java VM that comes with it and runs the desktop jar file. For servers however they only provide a server.jar file and a bunch of run scripts in bash and Windows Batch Executable.

Simply go to the GitHub Releases or go through the itch page and press the Download button (note that you do not have to pay to purchase, that’s only the Steam version) and download the server variant of the game (server-release.jar on GitHub and [Server]Mindustry.zip on itch), if it’s inside a zip then extract the zip.

Step 2 - Running the server to get the port

If the thing you’re using runs Java and has a internet, then it can also run the server jar. I will be using Windows Subsystem for Linux 2 on Windows 11. Open a command line and type something similar to below:
image
(notice how after -jar I put the jar file’s name with the extension)

Or alternatively just run the provided batch executable/bash script file provided with it if you download from itch.

Step 3 - Getting the server’s port

The server by default runs on 127.0.0.1, so all you need is the port, to check (and configure) the port, you can type config, it will show up a bunch of stuff so scroll up until the port section. (in my case the port was 6567)
image

To change the port, simply type config port <insert port number> and press enter.

Step 4 - Setting up the custom tunnel

Open up your account page, open the tunnels tab, and on Add new tunnel select custom.

Then after that, type the port you got from the server into the Local port textbox


Then click set and that’s all for configuring the tunnel!

Step 5 - Hosting a round and connecting to the server

First, let’s start a round session, on the server console, type in host [optional map name] [optional mode arg] to start a round session. (to get available maps, type maps), if you do not specify any arguments, the map will be random and the mode will be survival by default.

Download the game (aka desktop) variant, ensure it’s the same version as the server. Then launch the game, wait for it to load then click on Play, then Join Game

Now type in your username, and select a team color if you want to be in a different team (the color box next to username textbox), then click add server. Type/paste the tunnel url with the port, click ok, and then try joining it, if it works then you should see something like this:


(I hosted the fortress map under sandbox mode in the picture above)

And that’s all you need for creating a tunnel for Mindustry in playit!