Minecraft Over zrok

Clint DovholukClint Dovholuk
4 min read

In 2022, we showed you how to run a Minecraft server privately and securely using OpenZiti.

Since then, we have released zrok, a really cool service that's built on top of OpenZiti as a ziti-native application. We also made it a free service for the world to use. If this is your first time hearing about zrok, it has some really exciting features. Read more about zrok over at the main site https://zrok.io or by checking out previous blog posts in the zrok series.

We're back with a new blog showing you how you can share your Minecraft server safely and securely using zrok. If you want, you can watch a video covering the process here.

Overview

You want to play some Minecraft with our friends but our friends over the intenet, but you don't want to expose your Minecraft server to the world because that's just not a good idea! You can run the server in your house or, as shown below, on some other server you have, and you want our friends to be able to connect and play in the same world! That looks like this:

To make this happen, you'll need to follow the docs and install zrok, then invite yourself to the platform, and finally, for every environment you want to share, you'll need to enable that environment. I'm not going to cover all that here, but you need to do those things first before moving on.

Sharing the Minecraft Server

Ok, after enabling zrok on your computer, on your friend's computer, and on the machine that runs the Minecraft Server, the next step is to share the Minecraft server. If you watch the video, you'll see I started with a default share from zrok that creates an ephemeral share. This type of share is different every time you share it. If that's what you want, great, but in this blog, I'm going to show you how to reserve a share instead. A reserved share is not ephemeral, it's the same every time you access it. This makes it easy to remember how to access the share over and over since it will be the same.

Once the Minecraft server is running, log onto that machine and establish a zrok reserved share. Obviously, you'll need to change the unique-name shown below (mymcserverjan06). A couple of notes, these commands assume you are using bash and to make it easy to read, the commands are shown using the line-continuation character, \. If the command doesn't work for you, it's probably easiest to just put the commands on one line. ALSO note that zrok won't let you use _ characters nor - characters at this time, so you'll have to make do without those characters for now:

zrok reserve private 127.0.0.1:25565 \
  --backend-mode tcpTunnel \
  --unique-name mymcserverjan06

With the reserved share created, you can now start sharing the Minecraft server using:

zrok share reserved mymcserverjan06

zrok will show you something that looks like this. Notice that you're running a "tcpTunnel" and the share is "private". Only people enabled on your zrok network will be able to access this server and they'll need to run zrok and access the share using the share token. VERY COOL!

Accessing Your Minecraft Server

You've successfully shared your Minecraft server, but it's useless without being able to acces it! To access the server, you just need to run the zrok command and access the share just like it shows:

zrok access private mymcserverjan06 --bind 127.0.0.1:25565

When running it on your local computer, zrok will show you something like this:

Once you see that, you're ready to connect in Minecraft! Open up Minecraft, click on Multiplayer, choose "Direct Connection" and you're connected! (if you're wondering, the gif is limited to 10fps for size). You can also choose to edit/save the server, if you prefer to do that.

Summary - Share the Project

That's all there is to it! Now you can run your Minecraft server wherever you like and have your friends join your game!

If you find this interesting, please consider giving the project a star on GitHub. It really does help to support the project! And if you haven't seen it yet, check out https://openziti.io. OpenZiti is also free and open source, and it's what powers zrok security. It's a zero trust overlay network and platform for building other secure-by-default applications. Consider giving that project a star too!

Tell us how you're using zrok and OpenZiti on X twitter, reddit, or over at our Discourse. Or you can check out our content on YouTube if that's more your speed. Regardless of how, we'd love to hear from you.

1
Subscribe to my newsletter

Read articles from Clint Dovholuk directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Clint Dovholuk
Clint Dovholuk