Run Playit in the background 24/7 on Linux

Tested on Debian 11

  1. Create the folder playit inside /opt
    mkdir /opt/playit

  2. Download the latest version of playit to /opt/playit

cd /opt/playit
wget https://playit.gg/downloads/playit-linux_64-0.4.6
  1. Rename your playit download to just playit and make it executable
mv playit-linux_64-0.4.6 playit
chmod +x playit
  1. Perform your normal first run routine and set playit up as you normally would. Once playit is configured and you’ve tested it works exit it.

  2. Create the systemd unit file
    nano /etc/systemd/system/playit.service

Paste the following:

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

[Service]
WorkingDirectory=/opt/playit
ExecStart=/opt/playit/playit
Restart=always
RestartSec=120


[Install]
WantedBy=multi-user.target

Press Ctrl + W then Enter to save and Ctrl + X to exit

  1. Run the following commands to start playit and enable it
systemctl start playit
systemctl enable playit
  1. Optional Grab your claim link if required by running the following:
systemctl status playit

You should be able to copy out the claim link for use from there.

4 Likes

I just set up a scripts directory and put a bash script in there.

mkdir scripts
nano playit.sh

then write the bash script

#!/bin/bash 
chmod +x playit-armv7-0.4.6
./playit-armv7-0.4.6

make the bash script executable

chmod +x

When I want to run the tunnel in the background I just run

screen

To exit the screen and let it run in the background…

ctrl a+d

to view your screens

screen -list

to attach to a screen

screen -r screen #
2 Likes

The benefit of systemd is this runs on boot as soon as your machine is connected to the internet, and will automatically start again if it crashes.

4 Likes

this actually helped me out so much

Hey

It doesn’t work on 2024 if you’re still on this could you update the tutorial pls?

Thanks

1 Like

Ran into this issue as well, I can’t seem to get it to connect unless the --stdout log is open and running. The “run in background 24/7” post on playit’s website doesn’t work either.