Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next #9

Merged
merged 4 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.0.2-next.1](https://github.com/Johnny-Knighten/palworld-server/compare/1.0.1...1.0.2-next.1) (2024-01-22)


### Bug Fixes

* added steam query port and updated docs ([59825f2](https://github.com/Johnny-Knighten/palworld-server/commit/59825f2a1421ff0e142ff80b48e1970853bd1703))

## [1.0.1](https://github.com/Johnny-Knighten/palworld-server/compare/1.0.0...1.0.1) (2024-01-21)


Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
zip=3.0-12 && \
rm -rf /var/lib/apt/lists/*

RUN groupadd -g "$PGID" -o palworld && \

Check failure on line 51 in Dockerfile

View workflow job for this annotation

GitHub Actions / lint-and-build

SC2153 info: Possible misspelling: PUID may not be assigned. Did you mean PGID?
useradd -l -g "$PGID" -u "$PUID" -o --create-home palworld && \
usermod -a -G crontab palworld

Expand All @@ -65,6 +65,7 @@

EXPOSE 8211/udp
EXPOSE 25575/tcp
EXPOSE 27015/udp

ENTRYPOINT ["/usr/local/bin/system-bootstrap.sh"]
CMD [""]
57 changes: 40 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@
[![Docker Stars](https://img.shields.io/docker/stars/johnnyknighten/palworld-server?logo=docker)](https://hub.docker.com/r/johnnyknighten/palworld-server)
[![Docker Pulls](https://img.shields.io/docker/pulls/johnnyknighten/palworld-server?logo=docker)](https://hub.docker.com/r/johnnyknighten/palworld-server)

Docker container image for running a Palworld dedicated server.
A fully featured Docker container image for running a Palworld dedicated server. Has a robust backup system, 100% configurable via environment variables, and more.

> [!Important]
> There is a known bug with the in-game community server browser. It initially only loads 200 servers. There is a button to load another 200 servers, but I had the game crash after loading over a thousand of them. So it really is the luck of the draw if your server appears in the in-game server browser. I recommend connecting via ip:port, after connecting that way your server will be listed in the recent servers list. See the Q&A section at the [official game docs](https://tech.palworldgame.com/community-server-guide) for reference to this issue.
> The only downside to joining via ip:port is that you cannot directly provide a password. Thankfully someone found a [workaround](https://steamcommunity.com/app/1623730/discussions/0/4132683013931609911/), here are the steps:
> 1. Open the 'Community Servers' list
> 2. Click on any password protected server
> 3. Enter the password of the server you want to connect to (not the one that was clicked on)
> 4. Click 'OK', then click 'No'.
> 6. Enter the IP:PORT of the server you want to connect to in the bottom box.
> 7. Click Connect

> [!NOTE]
> Palworld does not currently support crossplay with console, and there is no cross play between Steam and Xbox Game Pass versions of the game. See details [here](https://store.steampowered.com/news/app/1623730/view/3943530908925344453).

# Table of Contents

Expand All @@ -40,8 +52,6 @@ Docker container image for running a Palworld dedicated server.
* Scheduled server restarts and updates via Cron
* Can be frozen to a specific version that is already downloaded
* Automated backups
* Linux Container


## Quickstart

Expand All @@ -57,10 +67,12 @@ $ docker run -d \
--name palworld-server \
-p 8211:8211/udp \
-p 25575:25575/tcp \
-p 27015:27015/udp \
-e SERVER_NAME="\"My Palworld Server\"" \
-e ADMIN_PASSWORD=secretpassword \
-v $HOME/palworld/server:/palworld/server \
-v $HOME/palworld/logs:/palworld/logs \
-v $HOME/palworld/backups:/palworld/backups \
johnnyknighten/palworld-server:latest
```

Expand Down Expand Up @@ -89,10 +101,12 @@ docker run -d `
--name palworld-server `
-p 8211:8211/udp `
-p 25575:25575/tcp `
-p 27015:27015/udp `
-e SERVER_NAME="My Palworld Server" `
-e ADMIN_PASSWORD=secretpassword `
-v /mnt/c/Users/USER/palworld/server:/palworld/server`
-v /mnt/c/Users/USER/palworld/logs:/palworld/logs `
-v /mnt/c/Users/USER/palworld/backups:/palworld/backups `
johnnyknighten/palworld-server:latest
```

Expand All @@ -114,9 +128,9 @@ docker stop palworld-server

### Environment Variables

Environment variables are the primary way to configure the server itself.
Environment variables are the primary way to configure the server.

The table below shows all available environment variables exposed for ease of use. Variables used to directly modify `PalWorldSettings.ini` can be found in the section below.
The table below shows all available environment variables exposed for easy configuration. Variables used to directly modify `PalWorldSettings.ini` can be found in the section below.

| Variable | Description | Default |
| --- | --- | :---: |
Expand Down Expand Up @@ -151,14 +165,14 @@ The table below shows all available environment variables exposed for ease of us

### Configuring `PalWorldSettings.ini`

The `PalWorldSettings.ini` file is the primary config file for the server. It is located in the `/palworld/server/Pal/Saved/Config/LinuxServer` directory inside the container. This file is generated automatically by the container using environment variables. If you wish to manage this file yourself, you must set `MANUAL_CONFIG=True` to prevent the container from generating/overwriting the file.
The `PalWorldSettings.ini` file is the primary config file used to configure server and game play settings. It is located in the `/palworld/server/Pal/Saved/Config/LinuxServer` directory inside the container. This file is generated automatically by the container using environment variables. If you wish to manage this file yourself, you must set `MANUAL_CONFIG=True` to prevent the container from generating/overwriting the file.

This container has two primary ways to manage `PalWorldSettings.ini`:
* Via `PALWORD_` Environment Variables
* Manually Edit The File

**Note - You should not mix and match these methods.**

> [!CAUTION]
> You should not mix and match these methods.

#### Manual Config

Expand Down Expand Up @@ -195,15 +209,17 @@ $ docker run -d \
--name palworld-server \
-p 8211:8211/udp \
-p 25575:25575/tcp \
-p 27015:27015/udp \
-e PALWORLD_ExpRate=5.0 \
-e PALWORLD_PalSpawnNumRate=2.0 \
-e PALWORLD_PalDamageRateAttack=3.0 \
-v $HOME/palworld/server:/palworld/server \
-v $HOME/palworld/logs:/palworld/logs \
-v $HOME/palworld/backups:/palworld/backups \
johnnyknighten/palworld-server:latest
```

Another special feature of using environment variables is that backup copies of `PalWorldSettings.ini` are made when configuration changes are detected. That is, if you make a configuration change a `PalWorldSettings.ini.backup#` file is made. The `#` is incremented for each backup made. The highest number reflects the newest backup. This is useful if you make a mistake and want to revert to a previous config.
Another special feature of using environment variables is that backup copies of `PalWorldSettings.ini` are made when configuration changes are detected. That is, if you make a configuration change a `PalWorldSettings.ini.backup#` file is made containing the old config. The `#` is incremented for each backup made. The highest number reflects the newest backup. This is useful if you make a mistake and want to revert to a previous config.

There are some overlap between some of the provided environment variables and the special `PALWORLD_` variables. For instance, `SERVER_NAME` is provided but `PALWORLD_ServerName` is also available. This container is setup to give non `PALWORLD_` priority over their `PALWORLD_` counterparts. For these specific variables **do not** use their `PALWORLD_` counterparts. Below shows the variables that have priority:

Expand Down Expand Up @@ -238,33 +254,40 @@ The table below shows the default ports that are exposed by the container. These
| :---: | :---: | --- |
| 8211 | UDP | Game port |
| 25575 | TCP | RCON Port |
| 27015 | UDP | Steam Query Port |

Make sure you have Port Forwarding configured otherwise the server will not be accessible from the internet.
Currently the Steam Query Port cannot be configured for the server. This can cause complications if you are hosting other servers that need that same port forwarded (you have multiple servers needing port 27015 but you can only forward traffic to one of them). For now, if you other server can have its steam query port changed, then change it to something other than 27015. If you cannot change the steam query port of your other server, then you will not be able to host both servers on the same network.

Note - Always ensure that your `-p` port mappings (if using docker run) and the `ports` section (if using docker compose) match up to the ports specified via the environment variables. If they do not match up, the server will not be accessible.
> [!TIP]
> Make sure you have Port Forwarding configured otherwise the server will not be accessible from the internet.

> [!TIP]
> Note - Always ensure that your `-p` port mappings (if using docker run) and the `ports` section (if using docker compose) match up to the ports specified via the environment variables. If they do not match up, the server will not be accessible.

### Volumes

There are the volumes used by the container:

| Volume | Description |
| --- | --- |
| /palworld/server | Contains server files |
| /palworld/logs | Contains all log files generated by the container |
| /palworld/server | Contains server files. |
| /palworld/logs | Contains all log files generated by the container. |
| /palworld/backups | Contains all backups generated by the container. |

### Backups

Backups can be performed automatically if configured. Backups are performed by making a copy of the `/palworld/server/Pal/Saved` directory to the `/palworld/backups` volume. The backups file names use the following format: `server-backup-{datetime}`. They are compressed as `tar.gz` files by default(can be set to zip via `ZIP_BACKUPS=True`). You can configure the number of backups to keep using `RETAIN_BACKUPS`, otherwise you will need to manually delete old backups.
Backups can be performed automatically if configured. Backups are performed by making a copy of the `/palworld/server/Pal/Saved` directory to the `/palworld/backups` volume. The backups file names use the following format: `server-backup-{datetime}`. They are compressed as `tar.gz` files by default (but can be set to zip via `ZIP_BACKUPS=True`). You can configure the number of backups to keep using `RETAIN_BACKUPS`, otherwise you will need to manually delete old backups.

Backup Automation Options
* `BACKUP_ON_STOP` - Backup the server when the container stops
* `BACKUP_ON_SCHEDULED_RESTART` - Backup the server before a scheduled restart
* `BACKUP_ON_SCHEDULED_RESTART` - Backup the server during a scheduled restart
* `BACKUP_BEFORE_UPDATE` - Backup the server before an update
* `SCHEDULED_BACKUP` - Backup the server on a schedule

#### Tip For Using `BACKUP_ON_STOP=True`

If you are planning on using `BACKUP_ON_STOP=True`, it is highly recommended you adjust the timeout settings of your `docker stop/compose down` command to allow the backup process enough time to complete its backup. Without doing this, it is likely your backup will be unfinished and corrupt. The longer your server has been running the bigger your backup will become which increases the time needed to backup the server. See the [Backup On Container Stop - Docker Timeout Considerations](https://github.com/Johnny-Knighten/palworld-server/wiki/Backups#backup-on-container-stop---docker-timeout-considerations) section of the wiki for more details.
> [!IMPORTANT]
> If you are planning on using `BACKUP_ON_STOP=True`, it is highly recommended you adjust the timeout settings of your `docker stop/compose down` command to allow the backup process enough time to complete its backup. Without doing this, it is possible that your backup will be unfinished and corrupted. The longer your server has been running the bigger your backup will become which increases the time needed to backup the server. See the [Backup On Container Stop - Docker Timeout Considerations](https://github.com/Johnny-Knighten/palworld-server/wiki/Backups#backup-on-container-stop---docker-timeout-considerations) section of the wiki for more details.


## Deployment

Expand Down