Factorio

Factorio

Not enough ratings
Windows Headless Server
By Lane
I just setup a windows headless server in about 30 minutes and knew almost nothing about doing so when I started. This should get you there.
   
Award
Favorite
Favorited
Unfavorite
Get the DRM free installer
  • Go to the Factorio[www.Factorio.com] website.
  • In the upper right, click Login.
  • Setup your account.
  • When finished, click your profile name in the upper right.
  • Scroll all the way down and click the Link To Steam Account button.
  • This makes Steam ask you if it can connect to a 3rd party thing and let them query your account. (to confirm you own the game). Once linked/confirmed, you can download various versions of the game.

Now that you are linked up on the website...

  • Click the big huge Download button on the main website page.
  • The default page shown next is for older builds. If you want the latest which is 0.13.5 when I wrote this then you have to click the "experimental release" button near the top.
  • Download the appropriate version that you want.
  • Install it like you normally install things.
Back end setup
You need a .bat file to run Factorio with arguments.

If you installed to the default directory like a normal human being,
  • Go to C:\Program Files\Factorio\bin\x64 .. You should see Factorio.exe in this folder, just look around if that isnt the exactly location on your end.
  • In the same folder as Factorio.exe create a new .bat file and name it something like Start.bat (if you don't know how, you can just create a .txt file and change the extension to .bat... Bat files are little executable files)
  • Edit the file with Notepad or Notepad++ and write this in it.

Factorio.exe --start-server C:\Users\Owner\AppData\Roaming\Factorio\saves\_autosave1.zip --autosave-slots 1 --server-settings "server-settings.json"

It has to be one single line, paste it exactly as it is. Whats happening here is we're telling the server to start, load the autosave at that location on your HDD, put a max on the number of autosave slots, then use the following server settings found in the file "server-settings.json". Basically it loads the autosave, then autosaves over it. This way you're always loading the latest data on reboots.

You do need to provide a starter save file in that save location. These are located in that same folder, but you could download one and just name it _autosave1.zip and be good to go.

So the remaining things to do is assign the server settings.

  • You can find a template server settings file in \Factorio\data\, it is named "server-settings.example.json".
  • Copy that file into the same folder as your Factorio.exe file, where your Start.bat file also is. (you don't have to put it there, you could just write the whole directory in there like the save location is. I just preferred to put it there to get things going)
  • Edit the file with Notepad or Notepad++.

Change the lines that look like these, to these values:

  • "max_players": "15",
  • "visibility": "hidden",
  • "verify_user_identity": false

Now, as long as that file is in the same folder as Start.bat and Factorio.exe then things will work fine. Create a shortcut to Start.bat and paste it onto your desktop and run it.

You have to setup Port Forwarding, but I'm not going to explain how to do that here since it varies based on your router. Just forward port 34197 to your local IP.
Stuff that could be broke
Port Forwarding isn't setup properly.
If people cannot connect to the server while it is running then your port forwarding may not be working. Setup port 34197 on UDP to forward to your local network IP.

After running Start.bat it flashes and disappears
Something is misspelled or something. Click Start>Run and type in "cmd" for Command Prompt. On windows 10 just click the search button (magnifying glass) and type in cmd for Command Prompt - then navigate to Start.bat and run it, command prompt will stay open so you can read the errors and correct them.

It's still not working
I don't know what you broke, then.

Running a server requires these things:
  • Properly configured Port Forwarding
  • Properly configured Server Settings Json file
  • Properly configured .bat file to tell Factorio.exe to run as a server and where to look for files.

Those things are basically outlined here, so skim back over the guide and compared to what you have on your end. Remember the json and bat files can be anywhere, just configure them to look in the proper folder locations for the files they need. It's pretty straightforward to edit them.
7 Comments
BrokenGabe Mar 1, 2021 @ 12:01pm 
DO it on any flavor of linux!
Lane  [author] Feb 7, 2021 @ 6:43am 
This is a very old article, fyi
Bill Feb 6, 2021 @ 4:33pm 
you can start it with one console command https://hub.docker.com/r/factoriotools/factorio
ActivistLime02 Jul 10, 2017 @ 4:21am 
Okay.
impetus_maximus Jul 9, 2017 @ 5:22am 
ActivistLime02
post the code in the tech help section of the forums. link [forums.factorio.com]
i'm sure someone will be able to help you. i had that same problem when i set mine up.
ActivistLime02 Jul 9, 2017 @ 1:39am 
For me it says "Unexpected charecter at server-settings.json" any suggestions.
impetus_maximus Sep 7, 2016 @ 12:53am 
thanks for the guide. havn't set one up yet.
BTW forwarding should be UDP not TCP [wiki.factorio.com].