Personal tools

Server/Getting started/FreeBSD Server

From JC2-MP Documentation

< Server
Revision as of 16:02, 17 April 2016 by Pricetx (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This is a guide to running the server software for JC2-MP under FreeBSD. Please note that due to linux compatibility requirements for the steam libraries, FreeBSD 10.3 or greater is required.

Package requirements:

  • bash (to use SteamCMD)
  • linux_base-c6
  • tmux (if you want to use my script in step 4)
  • git (to grab the up-to-date versions of the official scripts)

Step 1: Setting up the Linux compatibility layer

First, we need to load the linux kernel module, and tell it to start automatically on boot:

kldload linux
echo linux_enable=\"YES\" >> /etc/rc.conf

We also need to change the compatability layer OS release sysctl to allow us to use the newer CentOS 6 base (instead of the old Fedora 10 base)

sysctl compat.linux.osrelease=2.6.18

And also add this to /etc/sysctl.conf to remember across reboots

echo compat.linux.osrelease=2.6.18 >> /etc/sysctl.conf

Now, we need to install


To do this, run the following two commands:

cd /usr/ports/emulators/linux_base-c6
make install clean

Finally, we need to mount linprocfs. First, add the following line to /etc/fstab:

linproc /compat/linux/proc linprocfs rw,late 0 0

Then run the following commands:

mkdir -p /usr/compat/linux/proc
ln -s /usr/compat /compat
mount linproc

Step 2: Installing JC2-MP using SteamCMD

NOTE: Before beginning this section, ensure that you have Bash installed.

First, we need to set up SteamCMD. First make a directory for it somewhere, and run the following command:


Next, we need to extract it:

tar -xvf steamcmd_linux.tar.gz

SteamCMD needs a few edits to work under FreeBSD (mainly changing the path to bash, and forcing it to linux32). I have provided a working script here:

NOTE: You need to save the script as a name other than "", otherwise every time you run it, SteamCMD will overwrite it with the original.

now, run


Once it has finished loading, run

login anonymous

Now we need to set a directory for the server to install to. Personally I always lay out SteamCMD installations as follows. If my username was "server" I would have /home/server/steamcmd containing, and /home/server/jcmp containing the actual jcmp server. This means that the jcmp folder is one folder up from the steamcmd folder.

To do this, you would enter the following:

force_install_dir ../jcmp

However, you can install it wherever you like, as long as you have sufficient permissions.

Now we need to download the game itself, this is also the command used to update the game. The validate keyword performs a checksum on the downloaded files to ensure that everything is intact.

app_update 261140 validate

If you wish to update to the latest beta version, run the following instruction instead:

app_update 261140 -beta publicbeta validate

NOTE: if it gets stuck at a certain percentage during the download, simply exit (ctrl+c), and re-run, following the instructions after that point again.

Once this has finished, type the following to exit:


Step 3: Acquiring libraries

We need to get a working (up-to-date enough) copy of to be used by The easiest way is to go to the folder where you downloaded SteamCMD, and go into the "linux32" folder. There you will find the file. Run the following command to copy into the folder containing "Jcmp-Server"

cp /path/to/jcmp/

Step 4: Configuring JC2-MP

There are a couple of changes to be made to the JC2-MP server itself before running it for the first time.

- First, we need to copy the default config file to "config.lua", then edit the file to your taste:

cd /path/to/jcmp/
cp default_config.lua config.lua

- The next step is to install the latest versions of any official scripts you want. The scripts that ship with the server are outdated and usually non-functional, the best way to grab the latest versions are as follows:

cd /path/to/jcmp
git clone --recursive

Step 5: Running JC2-MP

I have written a script to easily manage the operation of the JC2-MP server, you can find the thread for it here:

If you attempt this and have any issues, please reply to this thread and I will get back to you as soon as possible.

Step 6: Updating the server

To update the server to the latest version, simply follow the instructions in step 2, or if you're using the script linked to in step 5, run:

./ update