Full headless server setup guide

Find multiplayer games.
Tools/scripts to run a dedicated server.
User avatar
EngineerFox
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jul 09, 2018 1:48 am
Contact:

Re: Full headless server setup guide

Post by EngineerFox »

i fixed the json and validated it, its all good to go, i tired to run the server and to still no prevail does it run
624e9cd668ceeeec14149a4d363fcf53.png
624e9cd668ceeeec14149a4d363fcf53.png (12.94 KiB) Viewed 1867 times
thats the error
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
User avatar
EngineerFox
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jul 09, 2018 1:48 am
Contact:

Re: Full headless server setup guide

Post by EngineerFox »

i fixed the json and validated it, its all good to go, i tired to run the server and to still no prevail does it run
624e9cd668ceeeec14149a4d363fcf53.png
624e9cd668ceeeec14149a4d363fcf53.png (12.94 KiB) Viewed 2609 times
thats the error
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
InvoluntaryDiaspora
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Sep 28, 2024 12:51 pm
Contact:

Re: Full headless server setup guide

Post by InvoluntaryDiaspora »

Hi,

I am experiencing a problem with running the server as the factorio user. This is my terminal output:

Code: Select all

user@FactorioServer:/$ sudo runuser -l factorio -c "/opt/factorio/bin/x64/factorio --server-settings /opt/factorio/data/server-settings.json --start-server /opt/factorio/saves/server_template_vanilla.zip --port 34197"
runuser: warning: cannot change directory to /home/factorio: No such file or directory
This account is currently not available.
I feel like it is something really stupid or trivial that I am missing. I am guessing this is an issue because I created the user with --no-create-home, but the manual did the same thing, so that leads me to think I am doing something else wrong.

Thanks in advance!
User avatar
AndrzejL.eu
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Nov 07, 2024 2:50 pm
Contact:

Re: Full headless server setup guide

Post by AndrzejL.eu »

Liemander wrote: Tue Jan 03, 2017 4:04 am I created a guide on how I set up my server for Factorio.
It is a full guide from beginning to end including installing Ubuntu.

It includes the information you will need to set up multiple Factorio servers running on one Ubuntu server.
I have verified it works with 0.14.21
https://1drv.ms/w/s!Am6ec-B57UlIhCKUYiGeTWu_R-DO

Let me know if there is anything I missed or should Add.
Hey Bud, good job with the how-to, I "roughly" followed it today and it worked HOWEVER. I ran into some issues.

1) Your how-to has this:

/opt/factorio/bin/x64/factorio -c /opt/factorio/data/server-settings.json --start-server-load-latest –Port 34197

as a testing command. It won't work. It will throw errors about broken server-settings.json because (and you fixed it later in how-to) you need to use --server-settings insted of -c when testing the command.

Later in the document You are using:

sudo runuser -l factorio -c "/opt/factorio/bin/x64/factorio --server-settings /opt/factorio/data/server-settings.json --start-server-load-latest --port 34197"

So obviously You know about this - but in the "testing" portion of how-to you're using -c.

2) In the step of downloading / extracting there is a minor boo-boo. Since the files are now in tar.xz format the j option will cause a problem:

sudo tar -xvfj /tmp/factorio.tar.xz -C /opt so leave it out maybe?

3) My own issue. Upacking of the downloaded archive - do not use Midnight Commander. There is a problem where mc is shortening the file names and causes issue:

11-07-2024, 15-01-51.png
11-07-2024, 15-01-51.png (530.4 KiB) Viewed 181 times
After ddging this term "Failed to load mod elevated-rails" I found this answer in here viewtopic.php?p=622497#p622497 that explained the problem. I actually unzipped the server using my Windows 11 machine and used mc to shell connect to my LAN VM and copied the files this way to my /home/user/ folder and then just moved the folder factorio to /opt/.

Everything else went smooth.

Edit: This morning I failed to connect to the server due to the update of the game from 2.0.14 to 2.0.15 and after a short research I wrote a script that will make it easier to update:

Code: Select all

systemctl stop factorio &&
wget -O /tmp/factorio.tar.xz https://www.factorio.com/get-download/latest/headless/linux64 &&
sudo tar -xvf /tmp/factorio.tar.xz -C /opt &&
chown -Rf factorio:factorio /opt/factorio/ &&
rm /tmp/factorio.tar.xz &&
systemctl start factorio
Cheers.

Andrzej
Post Reply

Return to “Multiplayer / Dedicated Server”