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

## 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](https://playit.gg) to create an account

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742262887770/96026908-b0a6-485c-b681-cabcaa61ca8a.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742262994679/5e636f3a-0e7e-4771-9590-d482a647234c.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263093320/692c5c17-af7c-44ac-bcb6-3f51d0bf0ed5.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263232500/844ec4dd-116b-45ab-b363-4ba77780a832.png align="center")

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

```bash
nano /etc/systemd/system/playit.service
```

Inside this file we are going to write the following

```bash
[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`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263594569/a35d7616-b067-40ce-bec6-37d0deb27ce2.png align="center")

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](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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263795428/8bd3e3ad-6de3-4584-b6f2-9e6d9be645d9.png align="center")

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

Go into `tunnels`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263829084/d9106a12-e27f-4bd7-b5d2-decdaebc736f.png align="center")

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](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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263940622/02881944-5c93-4811-b2df-0be0e5e7f8be.png align="center")

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)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742263996067/8087be83-6800-4bfe-92ce-a4317f508e5c.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742264092598/5b84f608-8418-43c2-8679-4bf6be7a8f84.png align="center")

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!

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742264193874/aea1dd1e-f3b2-4c28-8330-41fca1c3ee55.png align="center")

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 :)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1742264279789/0d6b6e76-11ee-4174-9954-e511a3ac03e7.png align="center")

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.
