Skip to main content

Linux setup

Setting up with 22.04 Ubuntu


https://linuxgsm.com/servers/pwserver/ 

https://tech.palworldgame.com/

 Create a user and login.

sudo adduser pwserver
usermod -aG sudo pwserver
su pwserver

 Download linuxgsm.sh.

wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh pwserver

Run the installer following the on-screen instructions.

./pwserver install

start/stop/restart

./pwserver start
./pwserver stop
./pwserver restart

Auto Start 

https://docs.linuxgsm.com/configuration/running-on-boot

You need to create a service file in /etc/systemd/system/
Example pwserver.service

sudo nano /etc/systemd/system/pwserver.service
[Unit]
Description=LinuxGSM Palworld Server
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
User=ts3server
WorkingDirectory=/home/ts3server
#Assume that the service is running after main process exits with code 0
RemainAfterExit=yes
ExecStart=/home/ts3server/ts3server start
ExecStop=/home/ts3server/ts3server stop
Restart=no

[Install]
WantedBy=multi-user.target
You need to reload the systemd-daemon once to make it aware of the new service file by systemctl daemon-reload
Now you can do
systemctl start pwserver # Start the server
systemctl stop pwserver # Stop the server
systemctl enable pwserver # Enable start on boot
systemctl disable pwserver # Disable start on boot

Auto updates

  • Monitor your server every 5 minutes.
  • Check for an update every 30 minutes, update and restart only if an update is detected.
  • Update check and update LinuxGSM every Sunday at 1am.
  • Restart at midnight, 6am, noon and 6pm.
crontab -e
add these to bottom
*/5 * * * * /home/pwserver/pwserver monitor > /dev/null 2>&1
*/30 * * * * /home/pwserver/pwserver update > /dev/null 2>&1
0 1 * * 0 /home/pwserver/pwserver update-lgsm > /dev/null 2>&1
0 0,6,12,18 * * *  /home/pwserver/pwserver restart > /dev/null 2>&1
to change restart times use site below.
https://crontab.guru/#0_0,6,12,18_*__

Auto Backups

  • Will backup savefiles every 10 mintues with time stamp.
make this file in home dir
nano backup.sh
#!/bin/bash
rsync -avh "/home/pwserver/serverfiles/Pal/Saved/SaveGames/0/" "/home/pwserver/backup/$(date)/"

mkdir backup

chmod 777 backup

Add this line to crontab 

*/10 * * * * /home/pwserver/backup.sh > /dev/null 2>&1

*/5 * * * * /home/pwserver/pwserver monitor > /dev/null 2>&1
*/30 * * * * /home/pwserver/pwserver update > /dev/null 2>&1
0 1 * * 0 /home/pwserver/pwserver update-lgsm > /dev/null 2>&1
0 0,6,12,18 * * *  /home/pwserver/pwserver restart > /dev/null 2>&1
*/10 * * * * /home/pwserver/backup.sh > /dev/null 2>&1