How to Host a Jedi Knight II Server on Linux (Ubuntu)

This tutorial will show you how to host a dedicated Jedi Knight 2 server on Linux.

Install the necessary packages.

sudo apt-get update
sudo apt-get install lib32stdc++6 screen

Install the game on Windows and copy the GameData folder over to your Linux server.  In this guide, I’m just installing everything in the home directory.

~/jk2/GameData

Go into the GameData directory and download the jk2linuxded104b package.

cd ~/jk2/GameData
wget http://www.korbinbrown.com/downloads/jk2linuxded104b.tar.gz
tar xvf jk2linuxded104b.tar.gz

Per the instructions that come with the jk2linuxded104b package, change the permissions on libcxa.so.1 (so you can run a JK2 server without root) and move it to your systems shared library directory.

chmod a+x libcxa.so.1
sudo mv libcxa.so.1 /usr/lib

Create a server.cfg in your base directory and you are ready to host a JK2 server. It’s recommended to use screen so you can continue to run the server but be disconnected from SSH or the GUI terminal you’re using.

sudo apt-get install screen
screen -S jk2
~/jk2/GameData/jk2ded +exec server.cfg

Ctrl+A, D to disconnect from screen, and bring it back with screen -r jk2

Adding CJK-Mod

I basically play nothing but CJK Instagib, so these are the rest of my notes regarding that. If you are installing a different mod, the instructions should be similar.

cd ~/jk2/GameData
wget http://tr1x.com/jk2/wp-content/uploads/2013/01/CJK-Mod_0.6.0.zip
unzip CJK-Mod_0.6.0.zip
cp CJK-Mod/CJK-Mod\(0.6.0\).pk3 base

Make changes to server.cfg and place a copy in base.

vi CJK-Mod/server.cfg
cp CJK-Mod/server.cfg base

Start the server:

~/jk2/GameData/jk2ded +set dedicated 2 +set fs_game cjk-mod +exec server.cfg

Remember to forward port 28070 on your router before trying to find your server in the server list or telling people outside your LAN to connect.

To do:

Auto-restart script