Skip to content

Instantly share code, notes, and snippets.

@jamiemtdwyer
Last active August 27, 2022 16:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiemtdwyer/e504cd817b97e6d64c574531bb203f18 to your computer and use it in GitHub Desktop.
Save jamiemtdwyer/e504cd817b97e6d64c574531bb203f18 to your computer and use it in GitHub Desktop.

Project Zomboid - RCON client configuration (GNU/Linux)

  1. Download the RCON client from Github
root@vultr:~# cd ~
root@vultr:~# wget https://github.com/gorcon/rcon-cli/releases/download/v0.10.1/rcon-0.10.1-amd64_linux.tar.gz

NOTE: This URL is for example only, find the latest release for your architecture here

  1. Extract the tar archive in your home directory and rename the folder to rcon:
root@vultr:~# tar -xvf rcon-0.10.1-amd64_linux.tar.gz
root@vultr:~# mv rcon-0.10.1-amd64_linux/ rcon/
  1. Navigate to the directory containing the rcon executable
root@vultr:~# cd rcon/
  1. Use your preferred text editor to edit the configuration file
root@vultr:~/rcon# nano rcon.yaml
  1. Use the template below to edit your configuration file, substituting your RCON password. If the game server is on a remote host, change "localhost" to the IP address of the game server. The game server RCON host listens on port 27015 by default, but this can be modified in your server settings.
# rcon.yaml
default:
  address: "localhost:27015" # host:port, for example 127.0.0.1:16260
  password: "YourSuperSecretRCONPassword"
  log: "rcon-default.log"
  type: "rcon"
  1. Run commands on the RCON client by invoking the executable and pointing to the configuration file while providing a command
root@vultr:~# ~/rcon/rcon -c ~/rcon/rcon.yaml 'servermsg "ALERT: This server will be shutting down!"'

You can now execute Project Zomboid server commands directly from a shell script, crontab, etc.

You can use this script to connect to the RCON client directly and run commands. This script waits for the RCON server to start listening on the port specified by RCON_PORT (default: 27015), since it may take some amount of time for your server to intiialize, download workshop items, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment