10. Running a Server

This section describes how to run your own online Knights server.


For Windows, the Knights server program is available as a separate download from the Knights web site. The file should be unzipped to a directory of your choice, and then you can run the server from the command line by cd-ing into that directory and typing "knights_server".

For Linux, the server is built and installed automatically as part of the normal build process. To run the server type "knights_server" on the command line.

The configuration file

The server needs to read a configuration file before it can run. The default is to look for a file named "knights_config.txt" in the current directory. If you want to use a different config file you can specify it using the -c option, for example:

knights_server -c path/to/my_config.txt

The file itself is a plain text file consisting of "Setting = Value" pairs, for example, "MaxPlayers = 50". There is one setting per line. Comment lines may also be included by starting them with a # symbol. An example knights_config.txt file is included in the distribution and you are encouraged to use this as a basis for creating your own config file.

Please note that changes to the config file will not take effect until the server is restarted.

The full list of settings is as follows:

Note that players connecting to the server must be running the same version of Knights that the server is using. If the versions do not match then the connection will be refused.

Experimental features

The following options allow games played on the server to be recorded, and then replayed at a later date. Note that the playback feature is highly experimental, and may not work very well. At the moment it is mostly only useful for debugging (i.e. if a player reports a bug, then we can go back and analyse the recording to try to work out what happened). It may be expanded to be more generally useful in the future.


Here are some suggested ways of using the server.

Keeping the server running

The distribution contains a Unix shell script,, which checks whether the server is running, and if not, starts a new copy of the server. This allows the server to be automatically re-started in the event that it crashes. For instructions read the comments within the file.

Game OptionsBuilding/Installing from Source