[GUIDE] - [LINUX] Host your gameservers with Playit.gg

jdjd
4 min read

About

Hihi! Coming with a blog quite different that what we are used to.

In this case we are going to do a mini-guide on how to host gameservers for a community or your group of friends.

NOTE: The example is going to be focused with veloren, but works with minecraft, terraria and quite a lot of games too!

Requirements

  • A computer (Could be a VPS, Raspberry, Laptop, ETC)

  • The game you want to host should have a decidated/cli way of hosting

  • A Playit.gg account

Follow up

Let’s start by going to https://playit.gg to create an account

The login button contains the section to create your account just in case.

Once your account is created you are going to be in the dashboard

Here we can see the add new agent thing which is what we need, click into Download program

It’s going to throw you to the download page where you can choose the platform and way of download, in my case I’m running Linux and I’m going to use their binary

Press your secondary click and copy link because we are going to download this file inside the machine that is going to be the playit host (you can use the same machine for playit and your gameserver)

In my case I’m running a LXC in which I use wget to download the binary

Your gonna need to chmod +x <binary> to have execution rights in the file itself, after that you could run it normally but that will attach our terminal and once we close it we lost our agent connection.

Instead we are going to create a systemd service

nano /etc/systemd/system/playit.service

Inside this file we are going to write the following

[Unit]
Description=Playit Agent
After=network.target

[Service]
Type=simple
User=<user>
WorkingDirectory=/home/<user>/agent
ExecStart=playit-linux-amd64
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

You can do it as root, but I’ll suggest using a different user. Once we created that file we need to reload the systemctl daemon with systemctl daemon-reload and after that systemctl start playit.service after that we can check that everything is running fine by doing systemctl status playit.service

The first time we should see something like “Starting playit agent…”.

NOTE: If you want the systemd service to start each time the computer turns on, do systemctl enable playit.service

In case you want to read more on how services work with systemd, you can read that from https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-managing_services_with_systemd

Add a tunnel

Now if we go back to the dashboard we should see our agent running there

The important part is that says connected with this we now we can create tunnels.

Go into tunnels

While adding a tunnel we should know which kind of protocols the game requires to communicate, In my case I’m hosting a veloren server which I read the requirements from https://book.veloren.net/players/server-hosting/on-your-pc.html.

It says that I need TCP/UDP and forward port 14004, so I’ll do that here

Once the tunnel is created you could configurate the address (if your playit agent is not in the same machine as your gameserver or if your port is not the default)

In my case the playit agent is running on a different machine so I have to specify 192.168.88.251 which is a private IP from another LXC where my veloren server is running.

Port 14004 is from the docs that I’ve mentioned earlier.

After pressing update we should see at the top the connection instructions about our tunnel

It says from my local machine it goes to their datacenter and creates a public address, that public address is the one you can share with your community or friends!

Here I’m logging in with my credentials on the server I’m running at home but via the link provided from playit.gg since is the one other people are going to use :)

Success! Once I’m in the character selection this means that the server is working.

Hope this can be of help for someone, consider buying premium or a custom domain at playit.gg to support them! Their service is nice.

0
Subscribe to my newsletter

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

Written by

jd
jd