A watcher for your Palworld server (thijsvanloef/palworld-server-docker).
What it does:
- It listens to the game port and starts the server if a player tries to connect (RCON required)
- It checks for players and gracefully stops the server if none are connected (RCON required)
- It allows you to start/stop the server through Discord
See the example docker-compose.yml file for an example configuration.
Name | Description | Default |
---|---|---|
CONTAINER_NAME |
The name of the server container. | palworld-server |
GAME_PORT |
The same value as PORT in the server container. |
8211 |
QUERY_PORT |
The same value as QUERY_PORT in the server container. |
27015 |
LOOP_SLEEP_SECONDS |
How often to check the server status. | 30 |
CONNECT_GRACE_SECONDS |
After starting the server, how long to wait before continuing the loop. | 60 |
SHUTDOWN_DELAY_SECONDS |
How long to wait before shutting down the server after the last player leaves. The shutdown will be cancelled when a player joins. | 0 (immediately) |
DISCORD_TOKEN |
The token of your Discord bot. | |
DISCORD_CLIENT_ID |
The client ID of your Discord bot. | |
DISCORD_GUILD_ID |
The ID of your Discord server. | |
DEBUG |
If debug mode should be enabled. | false |
You need to set the network_mode
attribute in the configuration of the server:
network_mode: service:<watcher-service-name>
So if you follow the example it would be:
network_mode: service:watcher
You need to move the ports
configuration to the watcher, as traffic will route via the watcher to the server.
You can enable the Discord integration in order to start/stop your server, or retrieve its status, straight from Discord.
To enable this, you will need to do the following:
- Go to https://discord.com/developers/applications and create a Discord application
- Under
Bot
, enableMESSAGE CONTENT INTENT
- Under
OAuth2
>OAuth2 URL Generator
, check at leastbot
,applications.commands
andSend Messages
, and copy the generated URL - Paste the URL in a new tab and add the bot to your server
- Set the following variables in the configuration of the watcher:
DISCORD_TOKEN
-> You can retrieve this by clickingReset Token
underBot
DISCORD_CLIENT_ID
-> You can find this underOAuth2
>Client information
DISCORD_GUILD_ID
-> You can retrieve this by right clicking on your Discord server and clickingCopy Server ID
(make sureDeveloper Mode
is active)
If everything is set up correctly, you should see the following message in the logs when you launch the watcher container again: Discord handler ready!
This is for advanced users, normally you should not need this.
If you want to delete all of the bot's commands from your server, simply execute the following while the container is running:
docker exec -it <container_name> delete_all_discord_commands
The scripts and documentation in this project are released under the MIT License.