My Factorio Info: Difference between revisions
initial page creation |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Factorio Headless Setup == | == Factorio Headless Setup == | ||
Updated 2025/07/17 | |||
'''These steps were done with Ubuntu 22.04.5 LTS''' | |||
Resources: | Resources: | ||
Line 5: | Line 9: | ||
* Stable [https://factorio.com/get-download/stable/headless/linux64 Factorio headless] server | * Stable [https://factorio.com/get-download/stable/headless/linux64 Factorio headless] server | ||
Check that your version of glibc is >= 2.18 | Check that your version of glibc is >= 2.18 using <code>ldd --version</code> | ||
<pre> | <pre>$ ldd --version | ||
ldd (Ubuntu GLIBC 2. | ldd (Ubuntu GLIBC 2.35-0ubuntu3.7) 2.35 | ||
Copyright (C) | Copyright (C) 2022 Free Software Foundation, Inc. | ||
This is free software; see the source for copying conditions. There is NO | This is free software; see the source for copying conditions. There is NO | ||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
Written by Roland McGrath and Ulrich Drepper.</pre> | Written by Roland McGrath and Ulrich Drepper.</pre> | ||
Output of ldd command confirms glibc version 2. | Output of ldd command confirms glibc version >2.18. | ||
Switch to <code>$ cd /opt</code> directory and download latest Factorio stable headless version (2.0.60 as of this writing) | |||
<pre>$ sudo wget https://factorio.com/get-download/stable/headless/linux64</pre> | |||
Rename file to match version ( | Rename file to match version (2.0.60 in this example) | ||
<pre> | <pre>$ sudo mv linux64 factorio-headless_linux_2.0.60.tar.xz</pre> | ||
Extract archived and zipped file | Extract archived and zipped file | ||
<pre> | <pre>$ sudo tar -xJf factorio-headless_linux_2.0.60.tar.xz | ||
anon@ox:/opt$ ls -l | |||
total | total 55376 | ||
drwxr-xr-x 8 | drwxr-xr-x 8 factorio factorio 4096 Jul 18 05:05 factorio | ||
-rw-r--r-- 1 root | -rw-r--r-- 1 root root 56693436 Jul 10 10:05 factorio-headless_linux_2.0.60.tar.xz</pre> | ||
Remove file (save space, you can always download again if needed) | Remove file (save space, you can always download the file again, if needed) using <code>sudo rm <filename.tar.xz></code> | ||
< | |||
Add a new user to run factorio and assign ownership of <code>/opt/factorio</code> directory to same user | Add a new user to run factorio and assign ownership of <code>/opt/factorio</code> directory to same user | ||
<pre> | <pre>$ sudo useradd factorio | ||
$ sudo chown -R factorio:factorio /opt/factorio/</pre> | |||
Verify permissions show factorio for both user and group | Verify permissions show factorio for both user and group with <code>ls -ld /opt/factorio</code> | ||
<pre> | <pre>$ ls -ld /opt/factorio/ | ||
drwxr-xr-x 4 factorio factorio 4096 May 4 17:07 /opt/factorio/</pre> | |||
drwxr-xr-x 4 factorio factorio 4096 May | |||
Line 56: | Line 50: | ||
No directory, logging in with HOME=/ | No directory, logging in with HOME=/ | ||
$</pre> | $</pre> | ||
As factorio user create <code>/opt/factorio/</code> saves directory. I used saves directory. | |||
<pre>$ mkdir /opt/factorio/saves</pre> | |||
Start server and look for something like "File /savename does not exist." | Start server and look for something like "File /savename does not exist." | ||
<pre>$ /opt/factorio/bin/x64/factorio --start-server savename | <pre>$ /opt/factorio/bin/x64/factorio --start-server savename.zip</pre> | ||
At this point you can load up saved games or create some games. I find it easier to create new game in Factorio client, save it, then SFTP the saved file to my headless server save directory. | |||
=== Update for 2.0.60 === | |||
With a base client and headless server (i.e., no mods) installation, I encountered a mod mismatch error when attempting to connect with the client. To fix this, I had to edit the default "true" values to "false" in /opt/factorio/mods/mod-list.json file for "elevated-rails", "quality", and "space-age". | |||
Here is my mod-list.json modified file: | |||
<pre>$ cat factorio/mods/mod-list.json | |||
<pre> | |||
{ | |||
"mods": | |||
[ | |||
{ | |||
"name": "base", | |||
"enabled": true | |||
}, | |||
{ | |||
"name": "elevated-rails", | |||
"enabled": false | |||
}, | |||
{ | |||
"name": "quality", | |||
"enabled": false | |||
}, | |||
{ | |||
"name": "space-age", | |||
"enabled": false | |||
} | |||
] | |||
}</pre> | |||
== Publish game on Factorio matching server == | |||
Copy /opt/factorio/data/server-settings.example.json to /opt/factorio/data/server-settings.json. | |||
<pre>$ sudo cp /opt/factorio/data/server-settings.example.json /opt/factorio/data/server-settings.json</pre> | |||
Edit appropriate server-settings.json values. | |||
I used _comment_token versus password value. The appropriate value is located in %appdata%\Factorio\player-data.json under the key name "service-token". The service-token is populated after you've browsed the multiplayer servers via your Factorio game client. | |||
My player-data.json for user "anon" on Windows was located at C:\Users\anon\AppData\Roaming\Factorio. | |||
Make any changes to config ini | Make any changes to config ini | ||
<pre>robot01@apu01:/opt/factorio$ sudo vi /opt/factorio/config/config.ini</pre> | <pre>robot01@apu01:/opt/factorio$ sudo vi /opt/factorio/config/config.ini</pre> | ||
== | == Updating Factorio headless server == | ||
# Download the latest copy of the headless server using the steps above. | |||
# Move and rename the headless server following the steps above. | |||
# Assign ownership of <code>/opt/factorio</code> directory to factorio user used above. | |||
[[Gaming]] | [[Gaming]] |
Latest revision as of 00:24, 18 July 2025
Factorio Headless Setup
Updated 2025/07/17
These steps were done with Ubuntu 22.04.5 LTS
Resources:
- Multiplayer Factorio wiki
- Stable Factorio headless server
Check that your version of glibc is >= 2.18 using ldd --version
$ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3.7) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.
Output of ldd command confirms glibc version >2.18.
Switch to $ cd /opt
directory and download latest Factorio stable headless version (2.0.60 as of this writing)
$ sudo wget https://factorio.com/get-download/stable/headless/linux64
Rename file to match version (2.0.60 in this example)
$ sudo mv linux64 factorio-headless_linux_2.0.60.tar.xz
Extract archived and zipped file
$ sudo tar -xJf factorio-headless_linux_2.0.60.tar.xz anon@ox:/opt$ ls -l total 55376 drwxr-xr-x 8 factorio factorio 4096 Jul 18 05:05 factorio -rw-r--r-- 1 root root 56693436 Jul 10 10:05 factorio-headless_linux_2.0.60.tar.xz
Remove file (save space, you can always download the file again, if needed) using sudo rm <filename.tar.xz>
Add a new user to run factorio and assign ownership of /opt/factorio
directory to same user
$ sudo useradd factorio $ sudo chown -R factorio:factorio /opt/factorio/
Verify permissions show factorio for both user and group with ls -ld /opt/factorio
$ ls -ld /opt/factorio/ drwxr-xr-x 4 factorio factorio 4096 May 4 17:07 /opt/factorio/
Test Factorio binary by switching to factorio user then start server
robot01@apu01:/opt$ sudo su - factorio No directory, logging in with HOME=/ $
As factorio user create /opt/factorio/
saves directory. I used saves directory.
$ mkdir /opt/factorio/saves
Start server and look for something like "File /savename does not exist."
$ /opt/factorio/bin/x64/factorio --start-server savename.zip
At this point you can load up saved games or create some games. I find it easier to create new game in Factorio client, save it, then SFTP the saved file to my headless server save directory.
Update for 2.0.60
With a base client and headless server (i.e., no mods) installation, I encountered a mod mismatch error when attempting to connect with the client. To fix this, I had to edit the default "true" values to "false" in /opt/factorio/mods/mod-list.json file for "elevated-rails", "quality", and "space-age".
Here is my mod-list.json modified file:
$ cat factorio/mods/mod-list.json { "mods": [ { "name": "base", "enabled": true }, { "name": "elevated-rails", "enabled": false }, { "name": "quality", "enabled": false }, { "name": "space-age", "enabled": false } ] }
Publish game on Factorio matching server
Copy /opt/factorio/data/server-settings.example.json to /opt/factorio/data/server-settings.json.
$ sudo cp /opt/factorio/data/server-settings.example.json /opt/factorio/data/server-settings.json
Edit appropriate server-settings.json values.
I used _comment_token versus password value. The appropriate value is located in %appdata%\Factorio\player-data.json under the key name "service-token". The service-token is populated after you've browsed the multiplayer servers via your Factorio game client.
My player-data.json for user "anon" on Windows was located at C:\Users\anon\AppData\Roaming\Factorio.
Make any changes to config ini
robot01@apu01:/opt/factorio$ sudo vi /opt/factorio/config/config.ini
Updating Factorio headless server
- Download the latest copy of the headless server using the steps above.
- Move and rename the headless server following the steps above.
- Assign ownership of
/opt/factorio
directory to factorio user used above.