Skip to content

Setup Painkiller Black Edition Linux Multiplayer Dedicated Server

Warning

This setup was tested on Ubuntu 22.04 and Debian 12. Some 32-bit packages were removed from Ubuntu 24.04 repositories so you'll need to download and install them manually but it's not within the scope of this guide.

A short remark for a beginner. A server is a computer (host) that provides information to other computers called clients. So when you create a game, your PC is a "server" and those who join it are the "clients".

This guide implies that you are familiar with Linux OS.

The People Can Fly videogame company provided an official Linux server for Painkiller. It's more stable than the Windows server and it's much cheaper to host, that's why all the dedicated servers are mostly on Linux. However, this binary is 32-bit and has its own drawbacks which we'll discuss below.

The official packages for the Linux server are Painkiller Linux Server 1.62 and its patch Painkiller Linux Server 1.64 Update provided as separate TAR archives. The pkserver binary was integrated with the outdated GameSpy server discovery network.

It's not convenient to work with those official packages so I made a combined pack based on the official ones.

Prerequisites

Your Linux OS should support 32-bit applications.

  1. Log in to your server.

  2. Prepare Ubuntu 22.04 server to accept 32-bit architecture since pkserver was compiled for 32-bit systems. You may need to run this command as a root with sudo:

    dpkg --add-architecture i386
    
  3. Install additional 32-bit packages. You may need to run the commands as a root with sudo:

    apt-get update
    apt-get install -y zlib1g:i386 libncurses5:i386 libstdc++5:i386
    

Installation

  1. Download the Painkiller Linux server package here. This pack already has a modified pkserver binary by XDavidXtreme with the following features:

    • gamespy.com was replaced with openspy.net.
    • Fixed the "%s" symbols vulnerability that could crash the server.
    • "+map" (sets the initial map) and "+port" options now correcly override config.ini parameters.
    • Added "-cfg" option like in the "Painkiller.exe" Windows binary to indicate a custom config.ini file.
    • Added "-lscripts" option like in the "Painkiller.exe" Windows binary to indicate a custom LScripts.pak.
    • Cfg.ServerMaps now update properly during the server initiation (Cfg:Load and Tweak:Load were removed from the binary). You no longer need to indicate a maplist in both Cfg.ServerMaps{Gamemode} (for example, Cfg.ServerMapsCTF) and Cfg.ServerMaps. Only indicating maplist in Cfg.ServerMaps{Gamemode} will be enough.

    Note

    The binary accepts the "+" plus and the "-" minus options. The order of options is important.

    The "+" plus options can be in any order but before the "-" minus options.

    The "-" minus options depend on the order which Linux server reads them and they have to be in specific order.

    "-lscripts" is the first one read, so it is always at the end.

    Example:

    pkserver +interface 192.168.0.106 +private +port 3456 +map DM_Sacred -cfg conf12.ini -lscripts PKPlus12.pak
    

    Note

    If you want to use clean official packages (not recommended), they can be downloaded here. In this case, you'll need an extra step of replacing all the GameSpy instances in a binary or modifying an /etc/hosts file which is described in the GameSpy to OpenSpy guide.

  2. Connect to your server and upload the archive with an FTP program like Total Commander or scp to a Linux directory, for example, /opt.

  3. Go to your /opt directory:

    [login@shell ~]$ cd /opt
    
  4. Unpack the files:

    [login@shell opt]$ tar -zxfv pkserver_linux_1.64_openspy.tar.gz
    
  5. You'll get the pkserver directory. Remove the archive:

    [login@shell opt]$ ls
    pkserver_linux_1.64_openspy.tar.gz pkserver
    
    [login@shell opt]$ rm pkserver_linux_1.64_openspy.tar.gz
    
  6. Examine the pkserver directory. Pay attention that Linux is case-sensitive, unlike Windows. bin is linked to Bin and data is linked to Data. It was done this way so you can easily navigate and feel it like in Windows:

    [login@shell opt]$ cd pkserver
    [login@shell pkserver]$ ls -al
    
    total 20
    drwxr-xr-x 5 painkiller     painkiller     4096 Jun 12 06:38 .
    drwxrwxr-x 4 painkiller     painkiller     4096 Jun 12 06:50 ..
    lrwxrwxrwx 1 painkiller     painkiller        3 Feb  4  2005 bin -> Bin
    drwxr-xr-x 2 painkiller     painkiller     4096 Jun 11 14:05 Bin
    lrwxrwxrwx 1 painkiller     painkiller        4 Mar 25  2005 data -> Data
    drwxr-xr-x 7 painkiller     painkiller     4096 Jun 11 14:05 Data
    drwxr-xr-x 2 100999 100999 4096 Jun 12 06:38 pkserver
    
  7. Enter the Bin directory with cd:

    [login@shell pkserver]$ cd Bin
    
  8. Run ls to see two files: config.ini – the server settings, pkserver – executable file.

    [login@shell Bin]$ ls
    config.ini  pkserver
    
  9. Find out which network interface in your server has access to the Internet:

    $ ip --brief address show
    lo               UNKNOWN        127.0.0.1/8 ::1/128
    enp0s3           UP             192.168.0.106/24 fe80::91ee:4f1b:1582:d667/64
    

    Note

    If your server is behind NAT, like in this example, forward the necessary port (the default port in Painkiller is 3455) like it's described in this guide.

  10. Make sure you don't have any firewall rules preventing a client from connecting to your server and so that the game port is not occupied:

    netstat -tuplen
    iptables -L -vn
    

    Also, make sure that your provider is not blocking certain IP ranges.

  11. Start pkserver with the +interface parameter (the corresponding parameter in the config.ini file is Cfg.NetworkInterface). Enter the IP address of the network interface that has access to the Internet:

    [login@shell Bin]$ ./pkserver +interface 192.168.0.106
    Free For All
    >
    

    Note

    It is possible to run pkserver without the +interface parameter; however, in this case, you'll need to replace all your localhosts in your /etc/hosts file with your interface 192.168.0.106. This is not recommended. Example:

    $ cat /etc/hosts
    # 127.0.0.1     localhost
    # 127.0.1.1     VirtualBox
    192.168.0.106   painkiller
    

    Note

    You can debug which interface the game runs on in a new terminal with the netstat command:

    $ netstat -ano | grep 3455
    udp        0      0 192.168.0.106:3455      0.0.0.0:*                           off (0.00/0/0)
    

  12. Connect to your server either via the local IP (if there is a NAT configuration) or the public IP. The port can be omitted if it is default 3455:

    /connect 192.168.0.106:3455
    

    Note

    The connect port:ip console command does not accept port in the original Painkiller v1.64. It's a bug and was fixed in PK Extra Plus. If you use the original Painkiller and you run on a custom port, join your server via Multiplayer -> Join Game -> Enter IP.

  13. To stop the server enter the command /exit:

    >
    /exit
    [login@shell Bin]$
    
  14. To change the port your server runs on, go to config.ini and modify the Cfg.ServerPort line.

Install PK++ (Painkiller competition mod)

  1. Download the latest PK++.

  2. You can run pkserver binary using the -lscripts parameter or you can replace LScripts.pak with the renamed PKPlus.pak from PK Extra Plus.

    pkserver +interface 192.168.0.106 +private +port 3456 +map DM_Sacred -cfg conf12.ini -lscripts PKPlus12.pak
    
    Since `pkserver` binary does not accept the `-lscripts` parameter, 
    you have to replace `LScripts.pak` with the renamed `PKPlus.pak` from PK++. 
    Hacking `pkserver` binary is also possible but it's out of the scope of this guide.
    Download the PK++ `PKPlus.pak`, 
    rename it and replace the original `LScripts.pak` with it in the `pkserver/Data` directory. 
    It can be done with one command in Linux:
    `mv PKPlus.pak /opt/pkserver/Data/LScripts.pak`
    
  3. Start the server and you'll see bots:

    [login@shell Bin]$ ./pkserver +interface 192.168.0.106
    Free For All
    Grrr has entered the arena.
    Grrr is ready.
    Rumbraugh has entered the arena.
    Rumbraugh is ready.
    Rumbraugh is now in team: Red.
    Grrr is now in team: Blue.
    Match Started.
    >
    

Configure RCON

RCON (remote console) is a remote administration tool and a protocol to manage a game server.

Note

It is a feature of PK++. This command does not work with the original Painkiller. It'll only work if both the server and the client have the PK++ mod installed.

With this tool, you can run all server commands as admin, with no voting required. All the commands can be either issued in the server console or directly in the client console.

In the configuration file config.ini that's on the server and in config.ini that's on your PC, configure the same password in Cfg.RconPass to have admin privileges. Type in /rcon in the console to use it, examples:

Notes

You can also set the rcon client password directly in the game console with:

/rconpass [password]

It'll add a password to Cfg.RconPass in your local config.ini. The password should match the one set on the server.

/rcon [command] [parameters]

change a map

/rcon map DM_Lockout

restart a map

/rcon restartmap

kick a player

/rcon kick [playername]