Deploy a Just Cause 2 Multiplayer Server on Ubuntu 14.04

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

Just Cause 2 is a single-player game published by Square Enix. Because it has no multiplayer mode, the modding community has created a multiplayer mod for the game that is quite popular. This guide will explain how to prepare your Linode, install SteamCMD and then install and configure Just Cause 2’s multiplayer mod.

Before You Begin

  1. You will need a Steam account, a copy of Just Cause 2 and the Just Cause 2 Multiplayer Mod.

  2. Complete our guide: Install SteamCMD for a Steam Game Server. This will get SteamCMD installed and running on your Linode and this guide will pick up where the SteamCMD page leaves off.

Note
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with sudo. If you’re not familiar with the sudo command, you can check our Users and Groups guide.

Prerequisites for Just Cause 2

From the SteamCMD guide, two additional steps are needed specifically for JC2.

  1. Add two iptables firewall rules. These commands assume that you have only the iptables rules in place from the SteamCMD guide. These insert a rules after the pre-existing iptables rules for SteamCMD.

    sudo iptables -I INPUT 7 -p udp -m udp --sport 10999 --dport 1025:65355 -j ACCEPT
    sudo iptables -I INPUT 8 -p udp -m udp --dport 7777 -j ACCEPT
    sudo iptables -I INPUT 9 -p udp -m udp --dport 7778 -j ACCEPT
    
  2. After entering the above rules, run iptables-persistent again. You’ll be asked if you want to save the current IPv4 and IPv6 rules. Answer yes for IPv4 and no for IPv6.

    sudo dpkg-reconfigure iptables-persistent
    

Install Just Cause 2

  1. Be sure you are in the directory ~/Steam, then access the Steam> prompt.

    cd ~/Steam && ./steamcmd.sh
    
  2. From the SteamCMD prompt, login anonymously:

    login anonymous
    

    Or log in with your Steam username:

    login example_user
    
  3. Install JC2 to the Steam user’s home directory:

    force_install_dir ./jc2mp-server
    app_update 261140 validate
    

    This can take some time. If the download looks as if it has frozen, be patient. Once the download is complete, you should see this output:

    Success! App '261140' fully installed.
    
    Steam>
    
  4. Quit SteamCMD:

    quit
    
    Note
    To update JC2, run the above 4 commands again.

Configure Just Cause 2 - Multiplayer (JC2-MP)

  1. Before you configure JC2-MP, make a copy of the default configuration file:

    cd ~/Steam/jc2mp-server
    cp default_config.lua config.lua
    
  2. Open config.lua with your preferred text editor. Every possible server option is explained in the configuration file. Simply follow the instructions and when finished, be sure to save your changes. At minimum, you’ll want to set a server name and access password.

  3. Before starting up the server for the first time, it is good to symlink a library file to avoid a possible error:

    ln -s ~/Steam/linux32/libstdc++.so.6 libstdc++.so.6
    
  4. Create a startup script for JC2 with the following contents:

    File: ~/startjc2.sh
    1
    2
    3
    4
    
    #!/bin/sh
    
    cd ./Steam/jc2mp-server
    screen -S "Just Cause 2 Muliplayer Server" ./Jcmp-Server

    When run, the script will change directories to ~/Steam/jc2mp-server and execute JC2 in a Screen session.

  5. Make the script executable:

    chmod +x ~/startjc2.sh
    

Start the Server

  1. Now that your server is installed and configured, it can be launched by running the startjc2.sh script from your steam user’s home directory.

    cd ~/ && ./startjc2.sh
    
    Important
    From this point, do not press the Control+C keys while in the console unless you want to stop JC2.
  2. To detach from the screen session running the server console, press these two key combinations in succession:

    Control+A
    Control+D

  3. To bring the console back, type the following command:

    screen -r
    
  4. To stop the server, bring back the JC2 console and press CONTROL + C.

Enter The Server

Now that you have installed and configured Just Cause 2 - Multiplayer, you have your very own Just Cause 2 server for you and your friends to play on. Your users can access the server by opening the server list, finding your server’s name, clicking Connect, and then entering a password - if you choose to set one.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.