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 |
1985 | TCP | Server List | (OPTIONAL) This is used if you're also setting EpicApp=PalServer to make it a community server (to show up in the server list |
27015 | UDP | Query Port | (OPTIONAL) This is stated to be only used the first time when you connect to a dedicated server and will conflict if you try to host multiple copies on a single host. I can confirm that the game works without forwarding this port through a router. |
#!/usr/bin/env bash
# Run this script as either root or using sudo
echo "Setting up steamcmd"
# Add the Steam User
useradd -m steam
# Add the dependency repo and configuration
add-apt-repository multiverse
dpkg --add-architecture i386
# Prepare to install
apt-get update
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 "Setting up Palworld Dedicated Server"
sudo -u steam bash -c "steamcmd +login anonymous +app_update 2394010 validate +quit"
echo "Download the Palworld maintenance shell script"
wget https://raw.githubusercontent.com/A1RM4X/HowTo-Palworld/main/palworld-maintenance.sh -O /home/steam/palworld-maintenance.sh
chown steam:steam /home/steam/palworld-maintenance.sh
chmod 555 /home/steam/palworld-maintenance.sh
wget https://raw.githubusercontent.com/A1RM4X/HowTo-Palworld/main/palworld.service -O /etc/systemd/system/palworld.service
chmod 644 /etc/systemd/system/palworld.service
#!/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 update && apt install \
software-properties-common \
lsb-release \
wget \
-y
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 "Setting up Enshrouded Dedicated Server"
sudo -i -u steam bash -c "cd ~/ && /usr/games/steamcmd +login anonymous +app_update ${steam_software_id} validate +quit"
echo "Download the Palworld maintenance shell script"
wget https://raw.githubusercontent.com/A1RM4X/HowTo-Palworld/main/palworld-update.sh -O /home/steam/palworld-update.sh
chown steam:steam /home/steam/palworld-maintenance.sh
chmod 555 /home/steam/palworld-maintenance.sh
wget https://raw.githubusercontent.com/A1RM4X/HowTo-Palworld/main/palworld.service -O /etc/systemd/system/palworld.service
chmod 644 /etc/systemd/system/palworld.service
You will need to set the password for the steam user next.
sudo passwd steam
Now, if you're security conscious, you will want to lock things down by enabling the firewall. Note: these commands assume that you're running your dedicated server on a home internet connection behind a router to provide general protection and that you can safely use SSH
sudo apt-get install -y ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 8211/udp
sudo ufw enable
You 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
-port
argument) - Modify the startup script to use a different query port (the
-QueryPort
argument) - Update the Server configuration located under
../PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
- Update the
DedicatedServerName
located in../PalServer/Pal/Saved/Config/LinuxServer/GameUserSettings.ini
by replacing the existing 32 Character string with another you can generate from a site like this one (ensure you use Numeric Digits and Uppercase letters only) - Update the UFW settings
- Forward the ports on your public facing firewall to the new VM