Abstract

This article will introduce how to build an online multiplayer server for the "Factorio". "How to build a game server" series of articles will introduce in detail how to build a multiplayer game server under Linux. The article will be divided into the following main parts:
  1. Dependent installation.
  2. Server installation.
  3. Operation and maintenance methods.

Thanks

Thanks Thanks to “Linux Game Server Managers” for providing the build script.

Server

For consistant uptime it is recomended you host a server in a data center.

Ubuntu 16.04 LTS

Debian 9

CentOS (Incompatible)

Since I am accustomed to using the Centos environment, I will correct and improve the official incompatibility issues.
Since centos 8 has officially stopped maintenance, centos 7 is come to an end too, it is recommended to use Rocky Linux as a replacement system.

3.1. Other Distros

Although not tested, any distro with tmux => 1.6 and glibc => 2.18 should also be compatible with Factorio servers.

Dependencies

Before installing, you must ensure you have all the dependencies required to run fctrserver.

Please select the corresponding code for installation according to your operating system.

4.1. Centos / Rocky Linux

EPEL is required to install some dependencies needed for using LinuxGSM on CentOS / Rocky Linux.
1
yum install epel-release
1
yum install curl wget tar bzip2 gzip unzip python3 binutils bc jq tmux glibc.i686 libstdc++ libstdc++.i686 xz

4.2. Ubuntu

Ubuntu
1
sudo dpkg --add-architecture i386; sudo apt update; sudo apt install curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc1 lib32stdc++6 xz-utils

4.3. Debian

Debian Debian =< 10
1
sudo dpkg --add-architecture i386; sudo apt update; sudo apt install curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc1 lib32stdc++6 xz-utils
Debian => 11
1
sudo dpkg --add-architecture i386; sudo apt update; sudo apt install curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc-s1 lib32stdc++6 xz-utils

Install

From the command-line do the following. Ensuring you have also installed the required dependencies.

5.1. Create a user and login

Create a user
1
adduser fctrserver
Set password

EN: Entering a password under Linux will not display the input on the screen.

1
passwd fctrserver
Switch to fctrserver user
1
su fctrserver

5.2. Download linuxgsm.sh

Switch to user directory
1
cd ~
Download the script and grant permissions
1
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh fctrserver

5.3. Run the installer following the on-screen instructions.

Run script
1
./fctrserver install

Dependencies will be checked during the installation process. If any dependencies fail the check-in the Checking Dependencies step, please select n when prompted: Was the install successfully? [Y/n]

After this, please run "yum install -y " to install the missing dependencies. For example, If the nmap-ncat dependency is missing, please run the following code to install it:

(Centos / Rocky Linux)

1
yum install -y nmap-ncat
When you see the following code, it means that the server has been installed~
1
2
3
4
5
=================================
Install Complete!

To start server type:
./fctrserver start
Finally, enter <./fctrserver start> on the screen to start the server
1
./fctrserver start

Basic Usage

All commands

A complete list of commands can be found by typing. Below are the most common commands available.
1
./fctrserver

Running

start
1
./fctrserver start
stop
1
./fctrserver stop
restart
1
./fctrserver restart
console

Console allows you to view the live console of a server as it is running and allow you to enter commands; if supported.

1
./fctrserver console

Update

Update checks for any server updates and applies them. The server will update and restart only if required.

1
./fctrserver update

Debugging

Details

You can get all important and useful details about the server such as passwords, ports, config files etc.

1
./fctrserver details
Debug

Use debug mode to help you if you are having issues with the server. Debug allows you to see the output of the server directly to your terminal allowing you to diagnose any problems the server might be having.

1
./fctrserver debug
Logs

Server logs are available to monitor and diagnose your server. Script, console and game server (if available) logs are created for the server.

1
/home/fctrserver/logs
Backup

Backup will allow you to create a complete tar bzip2 archive of the whole server.

1
2
./fctrserver backup

Monitor

LinuxGSM can monitor the game server by checking that the proccess is running and querying it. Should the server go offline LinuxGSM can restart the server and send you an alert. You can use cronjobs to setup monitoring.

1
./fctrserver monitor

Mods

The directory path of the server is:
1
~/serverfiles/
The following files and folders are included in this path:
1
2
3
4
5
6
7
8
9
10
11
achievements.dat
bin
config
config-path.cfg
data
factorio-current.log
factorio-previous.log
mods
player-data.json
save1.zip
temp
The file is the default configuration file. The mod file can be placed in the mods folder. Please restart the server after making any changes.
1
./fctrserver restart

Enjoy the game ~