Skip to content

Instantly share code, notes, and snippets.

@troyfontaine
Last active February 14, 2024 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troyfontaine/1f55fb13db2dc8de7f52c02c86874a2b to your computer and use it in GitHub Desktop.
Save troyfontaine/1f55fb13db2dc8de7f52c02c86874a2b to your computer and use it in GitHub Desktop.
Set up a Palworld Dedicated Server On Ubuntu 22.04

How to Set up a Palworld Dedicated Server On an Ubuntu 22.04 Host (VM or baremetal)

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.

Overview

This took too much effort to get sorted out, so I'm documenting everything figured out so far here.

Acknowledgements

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.

Multiple Dedicated Server Warning

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
  • 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

Firewall Ports

This was painful, so I'm putting this first.

Port Protocol Purpose Notes
8211 UDP Game Server REQUIRED The game only runs on UDP 8211. 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.

Set up script

Part 1: Initial Set up

#!/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

Part 2: Secure things

You will need to set the password for the steam user next.

sudo passwd steam

Now, if you're security concious, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment