Full headless server setup guide

Find multiplayer games.
Tools/scripts to run a dedicated server.
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Full headless server setup guide

Post by Liemander »

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.
noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: Full headless server setup guide

Post by noliVe »

its insane to teach how to set up a ubuntu server for new players way to much Info. ;D still a worth praise for this work. congrats!

I read through and learnd some new commands i can use. Thank you!
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Full headless server setup guide

Post by impetus maximus »

would anything need to be changed to do this in Debian?
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Re: Full headless server setup guide

Post by Liemander »

impetus maximus wrote:would anything need to be changed to do this in Debian?
Ubuntu is based on Debian, I have not personally used Debian so I can only guess but you may need to install the software these commands use before you can use them. you may also be able to accomplish the same things with a different command.
noliVe wrote:its insane to teach how to set up a ubuntu server for new players way to much Info. ;D still a worth praise for this work. congrats!

I read through and learnd some new commands i can use. Thank you!
I was thinking the same thing when I finished up the guide but hadn't thought much about how to make it better, what do you think about breaking it up into multiple guides, one for just how to set up the Factorio server with a link back to how to set up Ubuntu if they don't have it set up yet?

I think the Ubuntu information isn't too hard since it does most of the work for you, mostly just next next next.
noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: Full headless server setup guide

Post by noliVe »

one for just how to set up the Factorio server with a link back to how to set up Ubuntu if they don't have it set up yet?
I want you to write for my projekt .. get my first forum page cleaner and in better grammar. please?
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Full headless server setup guide

Post by Bisa »

If you are still around to update this - look into using the "latest" link instead of having the user figure out which version to use, it's probably the latest any way? https://www.factorio.com/get-download/l ... ss/linux64 (also, a shameless self promote - the factorio init script I'm maintaining has a pretty straight forward install option if you want to simplify the process for your readers even more)
Hosting a factorio server? Take a look at this || init script ||.
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Re: Full headless server setup guide

Post by Liemander »

I plan to split out the ubuntu setup from the factorio setup and update the document to 0.15 when it comes out.
I can make this part of the update.
hyspeed
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sun Jun 05, 2016 10:18 pm
Contact:

Re: Full headless server setup guide

Post by hyspeed »

Hi,

Have you made any progress on your update?

I plan to install a server over the upcoming holiday weekend (US).

thanks,
jon
gromit83
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Jul 09, 2017 7:37 am
Contact:

Re: Full headless server setup guide

Post by gromit83 »

This guide works well.

Only 2 things I needed to change for latest 0.15

the settings file needed to be in the root folder (/opt/factorio, not /opt/factorio/data)

and point 7 at page 24 needed the exclude the pointer for the settings file. so the startup command looks like this

Code: Select all

/opt/factorio/bin/x64/factorio --start-server-load-latest –Port 34197
Also the systemctl daemon crashes on every startup. Don't know why. Still looking into that.

EDIT:

Found it out. It is because the server tries to start factorio before the server has an IP adress and is available to communicate with the factorio Auth server. If it failes to recieve a token from auth.factorio.com the server fails.

The systemctl script on page 25-26 needs to add 2 more lines under [Unit]. These lines tell the systemctl daemon to wait for a working IP connection before it starts the headless server. Look below

Code: Select all


[Unit]
Description=Factorio Headless Server
Wants=network-online.target
After=network.target network-online.target

[Service]
Restart=always
Type=simple
User=factorio
Group=factorio

ExecStart=/opt/factorio/bin/x64/factorio --port 34197 --start-server-load-latest

[Install]
WantedBy=multi-user.target
skinner927
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Dec 15, 2017 3:07 pm
Contact:

Re: Full headless server setup guide

Post by skinner927 »

The document is gone! It was a great guide from what I remember. I should have made a local copy. :(

Edit: It seems there's some pretty good guides stickied to the top of the forum, I should have looked there first. Sorry for necroing this. :oops:
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 hate to necro this post but, im having problems, im at the part where you install factorio on the server, i used the direct command "wget -O /tmp/factorio.tar.gz https://www.factorio.com/get-download/0 ... ess/linux6". but when i run the next command "sudo tar -xzf /tmp/factorio.tar.gz -C /opt" it does not seem to work. here is a screen shot of my terminal
c91367acc03672c4feb2f190c8c681e2.png
c91367acc03672c4feb2f190c8c681e2.png (42.05 KiB) Viewed 37932 times
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Re: Full headless server setup guide

Post by Liemander »

it looks like the type of compressed file changed.
try sudo tar -xvf /tmp/factorio.tar.gz -C /opt
you may have to rename the file to .xz first but that may not be required.

I just verified this works and I updated the document.
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 »

Liemander wrote:it looks like the type of compressed file changed.
try sudo tar -xvf /tmp/factorio.tar.gz -C /opt
you may have to rename the file to .xz first but that may not be required.

I just verified this works and I updated the document.
i am still getting the error, i have tried changing factorio.tar.gz to factorio.xz and it did not work, i then changed it to factorio.tar.xz and it still did not work
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
hyspeed
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sun Jun 05, 2016 10:18 pm
Contact:

Re: Full headless server setup guide

Post by hyspeed »

I recall having a similar problem.

I _think_ I re-zipped the file one a Windows PC to a .zip file so that it would be recognized by the unzip command.

jon
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 »

Alright, i got it working, here is what i had to do, i had to do

Code: Select all

wget https://factorio.com/get-download/0.16.51/headless/linux64
it downloaded as linux64 i then ran

Code: Select all

sudo tar -xvf /tmp/linux64 -C /opt
after that it unpacked everything just fine
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< 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 »

8bdf22e872f20e8714be1f3bb9736b5d.png
8bdf22e872f20e8714be1f3bb9736b5d.png (11.1 KiB) Viewed 37905 times
I GOT A NEW ERROR, idk what happened, im a n00b with linux, but i know some things but just files and simple debuging other then that idk what to do next, thats the error, idfk what it means at this point
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Re: Full headless server setup guide

Post by Liemander »

It sounds like it doesn't recognize the json file.
Its easy to break the json file, make sure your not missing a quote or comma.

when adding admins make sure its looks like this
"admins": ["name1","name2","name3"]

the file should start with a { and end with a }
The rest of the file Every line should end with a comma except the last one.
all text should be wrapped in quotes except true/false "text"
true/false should be all lowercase
numbers do not need quotes
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 »

Well, i checked, and still to no prevail did it work here is my server settings, idk what is going on, i keep getting the same errors
Last edited by EngineerFox on Wed Jul 11, 2018 5:42 am, edited 1 time in total.
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
>(//)< >(//)< I LOVE CANDY>(//)< >(//)<
>(//)< >(//)< >(//)< >(//)< >(//)< >(//)<
Dergonic
Inserter
Inserter
Posts: 44
Joined: Mon Jun 06, 2016 8:56 am
Contact:

Re: Full headless server setup guide

Post by Dergonic »

Did you try to remove last "," ? (After ""admins": ["EngineerFox"],")
This one is useless and might be the issue
Liemander
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 10, 2016 1:58 pm
Contact:

Re: Full headless server setup guide

Post by Liemander »

I reccomend using a site like https://jsonlint.com/
it will help you find the syntax issues.

Visibility has an extra , after "lan":true
Visibility is missing the , after the }

Admins has an extra , after it.

every {} indicates a group of name-value pairs. every pair should be separated with a , and the last pair shouldn't have a ,

Visibility is a name-value pair where the value is a group of name-value pairs so it needs a , after the }
Post Reply

Return to “Multiplayer / Dedicated Server”