WORK IN PROGRESS
Because the documentation scattered around the internet is pretty inconsistent, I'm putting everything I've found that seems to work together here.
This took too much effort to get sorted out, so I'm documenting everything figured out so far here.
This gist owes a great big thank you to A1RM4X and their repo HowTo-Palworld for the maintenance script and the systemd unit file provided.
It looks like the dedicated server currently has several limitations:
- No way to bind to a specific Network Adapter
No way to specify a different port for the "Query Port" so hosting multiple dedicated servers likely requires running the server in a containerized form so that individual game servers don't fight to bind to the query port- is now managed via the flag-QueryPort=- The PalServer.sh script doesn't seem to have any options to specify a different configuration folder for reading the GameUserSettings.ini file so that you could run multiple instances more easily
This was painful, so I'm putting this first.
| Port | Protocol | Purpose | Notes |
|---|---|---|---|
| 8211 | UDP | Game Server | REQUIRED You connect to the server on UDP 8211, this can be modified. To validate that the port is open on the firewall between you and the game server, you can run nc -ulW 1 <your-dedicated-server-ip> 8211 |
- Navigate to "Settings"
- Click on "Policy Table"
- Click on "Create New Policy"
- Set the Policy type to "Port Forwarding"
- Name the rule
- Set the WAN Interface to WAN1 (or different if you're using a more advanced configuration)
- Set the WAN Port to 8211
- Set From to "Any"
- Set the Forward IP Address to the internal IP of your Palworld server
- Set the Forward Port to 8211
- Set the Protocol to UDP
- Click "Add"
#!/usr/bin/env bash
# Run this script as either root or using sudo
steam_software_id="2394010"
DEBIAN_FRONTEND=noninteractive
echo "Running updates and installing"
apt-get update && apt-get install \
software-properties-common \
ufw \
lsb-release \
wget \
-y
echo "Setting up UFW"
apt-get install -y ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
# Uncomment if you use mosh in addition to SSH
# ufw allow mosh
ufw allow 8211/udp
ufw enable
echo "Setting up steamcmd"
# Add the Steam User
useradd -m steam
# Add the dependency repo and configuration
add-apt-repository multiverse -y
dpkg --add-architecture i386
# Prepare to install
apt-get update
echo steam steam/question select "I AGREE" | sudo debconf-set-selections
echo steam steam/license note '' | sudo debconf-set-selections
apt-get install -y steamcmd
# Make the steam install directories
mkdir -p /home/steam/.steam/{root,steam}
# Fix the permissions
chown steam:steam /home/steam/.steam -R
chmod 755 /home/steam/.steam -R
echo "Running commands as Steam user to complete setup"
sudo -u steam bash <<'EOF'
mkdir -p /home/steam/Palworld_backups
echo "Setting up Palworld Dedicated Server"
cd ~/ && /usr/games/steamcmd +login anonymous +app_update ${steam_software_id} validate +quit
echo "Download the Palworld maintenance shell script"
wget https://gist.githubusercontent.com/troyfontaine/1f55fb13db2dc8de7f52c02c86874a2b/raw/342e9463c7ec0783b5ff4b2f5d1abec202f3f1ab/palworld-maintenance.sh -O /home/steam/palworld-maintenance.sh
chmod 500 /home/steam/palworld-maintenance.sh
EOF
# Download the systemd service file
echo "Downloading Systemd Unit File"
wget https://gist.githubusercontent.com/troyfontaine/1f55fb13db2dc8de7f52c02c86874a2b/raw/e54ff75dfce9ecc129dfaf066925988da80b62a1/palworld.service -O /etc/systemd/system/palworld.service
chmod 644 /etc/systemd/system/palworld.service
# Enable the Systemd Service
echo "Configuring the systemd service"
systemctl enable /etc/systemd/system/palworld.service
systemctl start palworld &
journalctl -u palworld -f &You will need to set the password for the steam user next.
sudo passwd steamYou can clone a VM running Palworld and set up a new VM running on a different internal IP AND on different ports that could be forwarded to externally.
You can do this by doing the following:
- Modify the startup script to use a different game server port (the
-portargument) - Modify the startup script to use a different query port (the
-QueryPortargument) - Update the Server configuration located under
../PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini - Update the
DedicatedServerNamelocated in../PalServer/Pal/Saved/Config/LinuxServer/GameUserSettings.iniby replacing the existing 32 Character string with another (you can generate a folder name using a site like this one - ensure you use Numeric Digits and Uppercase letters only)- This property is also crucial when restoring a backed up server-this tells the Palworld dedicated server which save folder to use
- Update the UFW settings
- Forward the ports on your public facing firewall to the new VM
Your server configuration is stored at /home/steam/.steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini.
An example configuration is:
This customized configuration reduces the difficulty in some ways (disabling base attacks, disabling death penalty, disabling the time required to hatch an egg, etc.)
[/Script/Pal.PalGameWorldSettings]
OptionSettings=(Difficulty=None,DayTimeSpeedRate=0.600000,NightTimeSpeedRate=2.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=None,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=False,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNumInGuild=20,BaseCampMaxNum=128,BaseCampWorkerMaxNum=30,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=0,WorkSpeedRate=1.000000,bIsMultiplay=True,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=False,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=12,ServerPlayerMaxNum=32,ServerName="My Palworld Server",ServerDescription="",bAllowGlobalPalboxExport=true,bAllowGlobalPalboxImport=true,AdminPassword="MySuperSecretAdminPassword",ServerPassword="MySuperSecretGamePassword",PublicPort=8211,PublicIP="",RCONEnabled=False,Region="NA",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt")After upgrading to PalWorld 1.0, I ran into issues with the maintenance script. I had to add in some additional commands which seemed to clear up the problem with the game failing to start.
#!/bin/bash
# Update PalWorld automatically
/usr/games/steamcmd +login anonymous +app_update 2394010 validate +quit
# Ensure Steam is fully exited
killall -9 steam
# Erase the Steam cache
rm -rf ~/.steam/steam/appcache/httpcache
# Make a backup file for the current date and time of the contents of the PalWorld Saved directory
tar -czvf /home/steam/Palworld_backups/"Palworld_$(date '+%Y-%m-%d_%H-%M-%S').tar.gz" /home/steam/.steam/steam/steamapps/common/PalServer/Pal/Saved
# Find any game backups that are older than 20 days and delete them to save on disk space
find /home/steam/Palworld_backups/ -mtime +20 -type f -delete