Introduction
This tutorial explains how to host a Palworld multiplayer game on a server with Ubuntu or Debian. It also shows how to keep the game running after the connection to the server was closed and how to change the port.
Playing Palworld:
Palworld is played with the desktop release on the local device. When you open the Palworld launcher, you can join a multiplayer game either via an invite code (in-game Palworld server) or via a public IP address (dedicated Palworld server). This tutorial explains how to setup a dedicated Palworld server.
In-game Palworld servers | Dedicated Palworld servers |
---|---|
|
|
Prerequisites
- One local device » to connect to the game
- One server with Ubuntu or Debian » to host the game
- You need access to the root user or a user with sudo permissions.
- Before you start a game on the server, you should make at least some basic configuration, including a firewall. For more information, see:
Initial Server Setup with Ubuntu
You might also want to check out: Protect game servers from DDoS attacks (optional) - You need to have
steamcmd
installed (see "Installation of SteamCMD") - Enough RAM (8 GB at the very least). The more mods or players, the higher RAM you'll need.
Example terminology
203.0.113.1
» Example public IP of the remote serverpalserver
» Example user on the remote server
Step 1 - Getting the server ready
-
Add a new user
Run this command to create a new user called "palserver":
adduser palserver
You will be asked to enter a password. Make sure to choose a secure one! You can press enter to skip name, number and phone.
You can now add the new user to the sudo group:
usermod -aG sudo palserver
It is recommended to add an SSH key and disable password login.
Run this command to switch to the user "palserver":
su - palserver
-
Enable access to the game port
If you have a firewall on your server, make sure it allows the game port TCP and UDP so that your local device can connect to the game hosted on your server.
The default port for Palworld servers is
8211
. To mitigate DDoS attacks, it is recommended to use a different port. This tutorial explains how to change the port from the default port to8212
. If you plan to use the default port, replace the port in the commands below accordingly.Description Port Default Palworld game port 8211 Palworld game port used in this tutorial 8212 There are several different firewall tools. This tutorial covers:
UFW » Default firewall configuration tool for Ubuntu
-
View current firewall settings
To check if theufw
firewall is active and if you already have any rules, you can use:sudo ufw status
View example output
palserver@ubuntu-server:~# ufw status Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6)
-
Allow port 8212 TCP and UDP
If the firewall is active, run these commands to allow incoming traffic to port 8212 TCP and UDP:sudo ufw allow proto tcp to any port 8212 sudo ufw allow proto udp to any port 8212
If you plan to use the default port, replace 8212 with 8211.
-
View new firewall settings
The new rules should now be added. To check, use:sudo ufw status
View example output
palserver@ubuntu-server:~# sudo ufw status Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere 8212/tcp ALLOW Anywhere 8212/udp ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6) 8212/tcp (v6) ALLOW Anywhere (v6) 8212/udp (v6) ALLOW Anywhere (v6)
Hetzner Cloud Firewall
This is only relevant if your remote server is a Hetzner Cloud server and you have a Hetzner Cloud Firewall applied to it. To edit your Firewall rules, open Cloud Console and select your Firewall. In the Firewall menu "Rules", add the following "inbound" rules:
If you plan to use the default port, replace 8212 with 8211.
IPs Protocol Port Port range Any IPv4 Any IPv6 TCP 8212 Any IPv4 Any IPv6 UDP 8212
Note: If you're using a different firewall, make sure it allows incoming traffic to port 8212 TCP and UDP. If you plan to use the default port, you need to allow port 8211 TCP and UDP instead.
-
Step 2 - Installing Palworld
Now that the server is ready, you can install Palworld with steamcmd. For this, make sure steamcmd is installed as mentioned in the prerequisites.
Name | Steam ID | Anonymous Login |
---|---|---|
Palworld Dedicated Server | 2394010 | Yes |
To install Palworld, do the following:
- Create a new directory for the Palworld files, change the permissions, and change into the new directory
mkdir PalworldServer && chown palserver:palserver PalworldServer && cd PalworldServer
- Download the Palworld server files
In
steamcmd +login anonymous +force_install_dir ~/PalworldServer +app_update 2394010 validate +quit
~/PalworldServer
, usels -al
to check if the files are now available on your server.
- Add a
steamclient.so
file for 64 architecture.
When you install Palworld, it downloads asteamclient.so
file for 32 bit. Before you start Palworld, you need to provide asteamclient.so
file for 64 bit in the.steam/sdk64
directory.mkdir -p ~/.steam/sdk64 cp ~/PalworldServer/linux64/steamclient.so ~/.steam/sdk64
Step 3 - Adding custom settings and custom port
By default, the Palworld game is always started on port 8211. You can find an overview with all default game options in ~/PalworldServer/DefaultPalWorldSettings.ini
. If you want to use other values than the default values, you need to add the respective options in this file:
~/PalworldServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
If you want to change all default settings, you can copy the entire content of DefaultPalWorldSettings.ini
into PalWorldSettings.ini
and edit the values as needed. In the following example, we will only change the default name and port, and add a password. At the time of writing, the dedicated Palworld server has memory leak issues. To minimize those issues, it can help to disable raids and login penalties, so we will do this too.
-
Edit the settings file
mkdir -p ~/PalworldServer/Pal/Saved/Config/LinuxServer nano ~/PalworldServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
-
Add a password, the new port and name, and disable raids and login penalties
[/Script/Pal.PalGameWorldSettings] OptionSettings=(ServerName="Test Palworld Server",ServerPassword="YourPassword",PublicPort=8212,bEnableInvaderEnemy=False,bEnableNonLoginPenalty=False)
Replace
YourPassword
with an actual password.Use
ctrl
+X
to save the file,Y
to confirm andENTER
to close the file.
For more information, check out the documentation about the different options.
Step 4 - Starting your Palworld server
Now that everything is ready, you can start the game. If you start the Palworld server in a normal terminal session, the game will end as soon as you end the connection to your remote server. One way to keep the game running is to use the screen
tool. Screen allows you to start separate virtual terminal sessions in one remote terminal session.
When you end your remote terminal session, the virtual terminal session (screen session) will stay open. When you start a new remote terminal session, you will see that the screen session is still there.
Install screen
If you don't have screen installed yet, you can install it now with:
sudo apt update && sudo apt install screen -y
To start a Palworld game in a screen session, do the following:
-
Start the session
screen -S palworld-screen
You can replace
palworld-screen
with any other name for your screen. -
Go to the Palworld directory
Open the directory in which you saved the server files of Palworld. If you used the example path from this tutorial, you can open it with:cd ~/PalworldServer
-
Start Palworld
./PalServer.sh
Step 5 - Managing the screen session
You can use the key combination ctrl
+A
followed by D
to exit the screen session. This will not end the screen session and the game will continue to run.
To go back to the Palworld screen session or to make any other changes, you can use these commands:
-
List all screens
screen -list
The screen you just created should also be listed here.
-
Go back to your running screen session
screen -dr palworld-screen
If you used a different name, replace
palworld-screen
with your screen name. -
Delete the screen session
screen -X -S palworld-screen quit
Note: This will end the Palworld game and the screen session will no longer be available.
Step 6 - Auto-restarting your Palworld server
You can create a script to auto-restart the server if it crashes.
If you left the Palworld screen session, use screen -dr palworld-screen
to go back. You can use ctrl
+c
to stop the Palworld game.
-
Create the shell script:
Enter the command below to save a new shell script in the same path as your Palworld server files, in this example the
~/PalworldServer
directory.cat <<'EOF' >> ~/PalworldServer/run.sh #!/bin/bash while true; do ./PalServer.sh for i in 3 2 1; do echo "The server will restart in $i second(s), CTRL-C to cancel." sleep 1 done done EOF
-
Make the script executable:
chmod +x ~/PalworldServer/run.sh
-
Start the Palworld server:
./run.sh
If the Palworld server crashes, it will automatically restart.
Step 7 - Joining your Palworld server
Open the Palworld launcher on your local device.
-
Select
Join Multiplayer Game
-
Enter your server's IP address at the bottom. You should add the port at the end of the IP address separated by a colon:
<server-ip>:<port>
, e.g.203.0.113.1:8211
If you are hosting the Palworld server locally, you can use:
127.0.0.1:<port>
-
After you entered the server IP and port, select "Connect".
It should now build a connection to your game.
Conclusion
In this tutorial, you learned how to set up a server to host a Palworld game. Next, you can share the IP address of your server with friends, so that you can start playing together. To set up more custom settings, you can edit the PalWorldSettings.ini
file as mentioned above. At the time of writing, there is a memory leak issue with the dedicated Palworld server as mentioned in Step 3. Because of this, it is recommended to regularly restart the server, e.g. every 8 hours (see this reddit post for example).