Operating System CentOS

How to Install a Just Cause 2 Multiplayer (JC2-MP) Server on AlmaLinux 9

Set up a JC2-MP dedicated server on AlmaLinux 9 or Rocky Linux 9 with SteamCMD, a config.lua, a firewalld rule and a tmux session.

This guide sets up a Just Cause 2: Multiplayer (JC2-MP) dedicated server on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9. You install the server with SteamCMD from Valve's content servers, configure it, open the firewall and keep it running in a detachable terminal session. CentOS 7 reached end of life in June 2024, so the steps are written for its RHEL 9 family successors.

JC2-MP is a community-built multiplayer mod for Just Cause 2 that is distributed through Steam. The dedicated server is a free download that SteamCMD fetches with an anonymous login (app ID 261140); you do not need a Steam account or a copy of the game on the server. Players need Just Cause 2 and the free multiplayer mod from Steam to join.

Requirements

  • A 64-bit x86 server running AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9. The server binary is 32-bit x86 code, so ARM instances are not suitable.
  • Root access or a user with sudo rights.
  • A public IPv4 address and the ability to open a UDP port.

Step 1: Update the system and install the 32-bit libraries

SteamCMD and the JC2-MP server are 32-bit programs. On a 64-bit system they need the 32-bit C and C++ runtime libraries, which the JC2-MP documentation lists for Red Hat based distributions as glibc.i686 and libstdc++.i686. Install them together with the tools used later:

sudo dnf upgrade -y
sudo dnf install -y glibc.i686 libstdc++.i686 wget tar tmux nano

tmux is used here to keep the server console alive after you log out. The JC2-MP documentation uses screen for the same purpose; on RHEL 9 systems screen is only available from the EPEL repository, while tmux is in the base repositories.

Step 2: Create a dedicated user

Do not run a game server as root. Create an unprivileged account and switch to it:

sudo useradd -m jcmp
sudo passwd jcmp
sudo su - jcmp

All commands in steps 3 to 5 are run as the jcmp user.

Step 3: Download SteamCMD and the server files

Create a directory for SteamCMD and unpack it:

mkdir ~/steam
cd ~/steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz

Install the server into ~/steam/jcmp. SteamCMD first updates itself, then downloads the application:

./steamcmd.sh +force_install_dir ./jcmp +login anonymous +app_update 261140 validate +quit

Wait for the line Success! App '261140' fully installed. If the download stops with an error, run the same command again; SteamCMD resumes where it left off.

Step 4: Configure the server

The server ships with a template configuration instead of a live one. Copy it into place and edit the copy:

cd ~/steam/jcmp
cp default_config.lua config.lua
nano config.lua

Every option is explained by a comment inside the file. The ones to look at first are:

  • the server name and description shown in the server browser;
  • the maximum number of players. Set it to what your VPS can actually carry rather than leaving a very high default;
  • the bind port, which is UDP 7777 unless you change it;
  • the server password, if you want a private server;
  • whether the server is announced to the public server list.

Step 5: Start the server

Start the server inside a detached tmux session named jcmp:

cd ~/steam/jcmp
tmux new-session -d -s jcmp ./Jcmp-Server

Attach to the console to watch the startup:

tmux attach -t jcmp

The server is ready when it prints Server started up successfully. A message such as [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. is expected on a machine without the Steam client and can be ignored. Detach from the console without stopping the server by pressing Ctrl+B, then D.

To stop the server:

tmux kill-session -t jcmp

Type exit to return to your administrative user.

Step 6: Open the firewall

As your sudo user, allow the game port through firewalld. Use the port from config.lua if you changed it:

sudo firewall-cmd --permanent --add-port=7777/udp
sudo firewall-cmd --reload

If your provider has its own network firewall in the hosting control panel, allow the same UDP port there. Players can then find the server in the JC2-MP server browser, or connect directly to 203.0.113.10:7777.

Updating the server

When the mod is updated on Steam, clients and servers must run the same version. Stop the server, run SteamCMD again as the jcmp user, and start the server:

tmux kill-session -t jcmp
cd ~/steam
./steamcmd.sh +force_install_dir ./jcmp +login anonymous +app_update 261140 +quit
cd ~/steam/jcmp
tmux new-session -d -s jcmp ./Jcmp-Server

Your config.lua is not overwritten by an update, because the package only contains default_config.lua. Compare the two files after a larger update in case new options were added.

Troubleshooting

GLIBCXX version not found

If the server exits with an error like version `GLIBCXX_3.4.15' not found (required by ./libsteam_api.so), it is loading an unsuitable C++ library. The JC2-MP documentation's fix is to copy the library that SteamCMD ships into the server directory:

cp ~/steam/linux32/libstdc++.so.6 ~/steam/jcmp/

No such file or directory when starting steamcmd.sh or Jcmp-Server

This usually means the 32-bit loader is missing. Confirm that glibc.i686 and libstdc++.i686 from step 1 are installed with rpm -q glibc.i686 libstdc++.i686.

A bundled script does not work

The default Lua scripts delivered with the server package can be older than the ones the JC2-MP team publishes on GitHub. Replace the affected script in the scripts directory with the current version and restart the server.

Frequently asked questions

Is JC2-MP still maintained?

The mod is still distributed on Steam, and the project site at jc-mp.com posted a notice in August 2024 that its community is still active. It is a mature project that changes rarely, so do not expect frequent server updates.

Do I need to own Just Cause 2 to host a server?

No. The dedicated server is downloaded with SteamCMD's anonymous login. Only players need the game and the multiplayer mod.

How do I add game modes?

Game modes and features are Lua scripts. Each one is a folder inside the server's scripts directory, and the server loads the folders it finds there at startup. The scripting API is described in the JC2-MP documentation.

Will the server start again after a reboot?

Not by itself, because the tmux session ends when the machine shuts down. Log in as jcmp and run the start command again, or add an @reboot line with that command to the user's crontab.

Share story:

Continue reading other guides on How VPS.