Dedicated Server Guide on Windows

Find multiplayer games.
Tools/scripts to run a dedicated server.
sasaa_86
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Apr 11, 2016 3:28 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by sasaa_86 »

found this (maybe helpfull to put on the wiki)

General options:
-h [ --help ] display help
--version show version information
-c [ --config ] PATH config file to use

Running options:
-s [ --map2scenario ] arg map to scenario conversion
--apply-update arg immediately apply update package
--create SAVE create a new map
--start-server SAVE start a multiplayer server

Server options:
--latency N multiplayer server latency, in ticks
--latency-ms N multiplayer server latency, in milliseconds
--autosave-interval N (=2) server autosave interval, in minutes
--autosave-slots N (=3) server autosave slots
--disallow-commands disallow use of the command console
--peer-to-peer use peer-to-peer communication
--no-auto-pause don't automatically pause when no players are
connected
--port N network port to use

I just taken it from the linux version of facorio headless server but i guess it would work on any server instance
checked its the same on windows.

I use (linux)

Code: Select all

sudo ./factorio --autosave-interval 5 --latency 12 --disallow-commands --start-server server.zip
for windows you should use a *.bat file or *.cmd and put this in

Code: Select all

@echo off
:start
START /WAIT /HIGH factorio.exe --autosave-interval 5 --latency 12 --disallow-commands --start-server server.zip
Echo.
Echo Crashed @ %time% - %date%
echo Restarting in 10 seconds...
timeout /t 10
goto start
I'm currently setting up a MP server will let you know when its done.
Just one question about shutting the server down and restarting it. what zip file should i use to startup?


I'm dutch btw greets

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Bisa »

sasaa_86 wrote: Just one question about shutting the server down and restarting it. what zip file should i use to startup?[/b]

I'm dutch btw greets
There's a bug in 0.12.30 preventing the server from saving on clean exit - until then ensure you have autosaves enabled, as for starting a factorio server on linux: Try this ;)
Hosting a factorio server? Take a look at this || init script ||.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by binbinhfr »

Under Windows 7, with a steam install, is it possible to run a server AND a client on the same machine ? I cannot manage how to do it, there is always an error "the process can not access..." .
Even if I try to duplicate and rename factorio.exe, to have 2 separate programs running (factorio2.exe for the server)
My mods on the Factorio Mod Portal :geek:

Cr4zy
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Apr 17, 2016 4:49 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Cr4zy »

Yes it's possible I run both my client and server from the steam install. Could be you haven't set configs up for the server? Servers require different write data paths which can only be provided though another config.

script in my sig might help you out if you can't solve it.
Factorio Server Tool - Setup wizard and managing script for running a Factorio server on Windows

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by binbinhfr »

Wow that's a BATCH file !!! ;)
I'll have a look at it to understand this config file and path thing.
For the moment, I have a headless server on a contiguous machine.
My mods on the Factorio Mod Portal :geek:

cassie112
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon May 02, 2016 10:06 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by cassie112 »

Hi,

i've tried to use this server.bat file, but everytime i execute it, it opens the commandprompt but not factorio itself, but when i try to open factorio it says "it is already in use by something else".
i wont upload what is on the commandprompt, because i dont know if there is any private info on it.
thanks,

C.
Attachments
the line i have
the line i have
serverFile.PNG (5.09 KiB) Viewed 14279 times

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Bisa »

cassie112 wrote:Hi,

i've tried to use this server.bat file, but everytime i execute it, it opens the commandprompt but not factorio itself, but when i try to open factorio it says "it is already in use by something else".
i wont upload what is on the commandprompt, because i dont know if there is any private info on it.
thanks,

C.
I'm afraid without the command prompt output its a bit tricky to guess what is happening - perhaps try this: viewtopic.php?f=133&t=23838
Hosting a factorio server? Take a look at this || init script ||.

Brewcmas
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Dec 29, 2017 6:38 pm

Null

Post by Brewcmas »

Deleted Post
Last edited by Brewcmas on Mon Dec 23, 2019 12:40 am, edited 1 time in total.

Null8fuenf10
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Aug 20, 2018 11:36 am
Contact:

Re: Dedicated Server Guide on Windows

Post by Null8fuenf10 »

Brewcmas wrote:I have the server up and running with no issue, but it seems to crash every time the server is inactive for a period of time (no one logged on, just running in paused state).

Any ideas how to fix this?

You can set it to false in the server-settings.json file under "auto_pause".
If You don't have the file, You can unpack and copy the file from an Linux headless build to You Factorio installation folder (where the folders 'bin', 'data', etc are).
You'll need to fill in all Your server data tho (server name, player count, Your login data, etc.)

NMSquirrel
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Jan 13, 2017 1:20 am
Contact:

Re: Dedicated Server Guide on Windows

Post by NMSquirrel »

ok WTH?
it starts then hangs here...
the program stops running at that line every time..

any idea what is going on?
i have checked task manager and there is no factorio running.
northbrook cement.jpg
northbrook cement.jpg (193.75 KiB) Viewed 9545 times

ImTheRealSlayer
Inserter
Inserter
Posts: 21
Joined: Fri Dec 14, 2018 4:56 am
Contact:

Re: Dedicated Server Guide on Windows

Post by ImTheRealSlayer »

NMSquirrel wrote:
Wed Jan 30, 2019 12:23 am
ok WTH?
it starts then hangs here...
the program stops running at that line every time..

any idea what is going on?
i have checked task manager and there is no factorio running.

northbrook cement.jpg
If you can type in that line there, then congratualtions! your server is running! if not, then you might want to restart your PC. Might help, might not.
Image

JePeSWE
Inserter
Inserter
Posts: 26
Joined: Mon Feb 19, 2018 3:34 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by JePeSWE »

Hi

New at this, i follow the first post, looks like it started. But how do i connec to it, and is it possible to connect to the server from factorio on steam if the server is on the same pc.?


/Jerry

JePeSWE
Inserter
Inserter
Posts: 26
Joined: Mon Feb 19, 2018 3:34 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by JePeSWE »

daniel34 wrote:
Fri Dec 11, 2015 10:29 am
maisel16 wrote:Can i run more headless Windows Servers?
Yes you can, if you set a different port in the config.ini for each instance. The players then have to connect on that port aswell.
Where can i find the config.ini?

/Jerry

Post Reply

Return to “Multiplayer / Dedicated Server”