This guide walks you through setting up a dedicated Factorio server on Windows, then let’s a simple Batch manage it. By following these straightforward instructions, you’ll have your server running smoothly with minimal effort. Everything from installation to configuration is covered, and an easy-to-use batch file simplifies the process.
Summary
Batch file and Initial Setup
- Create a folder in `C:\\` named `SteamCMD`. Inside it, create a new text file named `Factorio_Dedicated_Server_Manager.bat`. Paste the following code into the file and save:
Factorio_Dedicated_Server_Manager.bat@echo off
:: Factorio Dedicated Server Manager Batch Script
:: By: Ghostwheel
:: Last Updated: Space Age Release
:: Version 1.0
:: ———————————————–
:: This script validates, manages, and runs a Factorio Dedicated Server
:: with support for save files, server settings, and elevated privileges.:: Variables
set “BaseDir=%~dp0”
set “FactorioExe=%~dp0steamapps\common\Factorio\bin\x64\factorio.exe”
set “ExampleSettings=%~dp0steamapps\common\Factorio\data\server-settings.example.json”
set “SettingsFile=%~dp0steamapps\common\Factorio\data\server-settings.json”
set “SavesDir=%APPDATA%\Factorio\saves”
set “MenuChoice=”:: Ensure Factorio executable exists
if not exist “%FactorioExe%” (
echo ERROR: Factorio executable not found at “%FactorioExe%”.
echo Please ensure Factorio is installed in the expected location.
pause
goto :ExitScript
):: Ensure server-settings.json exists, create it if necessary
if not exist “%SettingsFile%” (
if exist “%ExampleSettings%” (
echo Creating server-settings.json from server-settings.example.json…
copy “%ExampleSettings%” “%SettingsFile%” >nul
echo server-settings.json created successfully.
) else (
echo ERROR: server-settings.example.json not found at “%ExampleSettings%”.
echo Cannot create server-settings.json. Please verify the installation.
pause
goto :ExitScript
)
):: Ensure Saves directory exists
if not exist “%SavesDir%” (
echo Creating Saves directory…
mkdir “%SavesDir%”
echo Saves directory created successfully.
):: Main Menu
:MainMenu
cls
echo =====================================================
echo Factorio Dedicated Server Manager
echo =====================================================
echo [1] Load Latest Save
echo [2] Load Specific Save
echo [3] Open server-settings.json for Editing
echo [4] Install Factorio Dedicated Server
echo [5] Exit Factorio Dedicated Server Manager
echo =====================================================
set /p “MenuChoice=Please enter your choice (1-5): ”if “%MenuChoice%”==”1” goto :LoadLatestSave
if “%MenuChoice%”==”2” goto :LoadSpecificSave
if “%MenuChoice%”==”3” goto :EditSettings
if “%MenuChoice%”==”4” goto :Install
if “%MenuChoice%”==”5” goto :ExitScript:: Invalid input handling
echo Invalid option! Please select a valid option.
pause
goto :MainMenu:: Load the latest save
:LoadLatestSave
cls
echo =====================================================
echo Loading the latest save file…
echo ================================ - Download SteamCMD from here.
SteamCMD: https://developer.valvesoftware.com/wiki/SteamCMD - Place SteamCMD.exe in C:\SteamCMD\
- Run the batch file and choose the **Install** option to install Factorio.
- Once installation is complete, proceed to the configuration section.
Initial Configurations Needed
“name”: “The Factory Must Grow”,
“description”: “Friends Welcome”,
“tags”: [ “game”, “tags” ],
“_comment_max_players”: “Maximum number of players allowed, admins can join even a full server. 0 means unlimited.”,
“max_players”: 0,
“_comment_visibility”: [
“public: Game will be published on the official Factorio matching server”,
“lan: Game will be broadcast on LAN”
],
“visibility”: {
“public”: true,
“lan”: true
},
“_comment_credentials”: “Your factorio.com login credentials. Required for games with visibility public”,
“username”: “username”,
“password”: “password”,
“_comment_token”: “Authentication token. May be used instead of ‘password’ above.”,
“token”: “”,
“game_password”: “password”,
“_comment_require_user_verification”: “When set to true, the server will only allow clients that have a valid Factorio.com account”,
“require_user_verification”: true,
“_comment_max_upload_in_kilobytes_per_second”: “optional, default value is 0. 0 means unlimited.”,
“max_upload_in_kilobytes_per_second”: 0,
“_comment_max_upload_slots”: “optional, default value is 5. 0 means unlimited.”,
“max_upload_slots”: 5,
“_comment_minimum_latency_in_ticks”: “optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.”,
“minimum_latency_in_ticks”: 0,
“_comment_max_heartbeats_per_second”: “Network tick rate. Maximum rate game updates packets are sent at before bundling them together. Minimum value is 6, maximum value is 240.”,
“max_heartbeats_per_second”: 60,
“_comment_ignore_player_limit_for_returning_players”: “Players that played on this map already can join even when the max player limit was reached.”,
“ignore_player_limit_for_returning_players”: false,
“_comment_allow_commands”: “possible values are, true, false and admins-only”,
“allow_commands”: “admins-only”,
“_comment_autosave_interval”: “Autosave interval in minutes”,
“autosave_interval”: 10,
“_comment_autosave_slots”: “server autosave slots, it is cycled through when the server autosaves.”,
“autosave_slots”: 5,
“_comment_afk_autokick_interval”: “How many minutes until someone is kicked when doing nothing, 0 for never.”,
“afk_autokick_interval”: 0,
“_comment_auto_pause”: “Whether should the server be paused when no players are present.”,
“auto_pause”: true,
“_comment_auto_pause_when_players_connect”: “Whether should the server be paused when someone is connecting to the server.”,
“auto_pause_when_players_connect”: false,
“only_admins_can_pause_the_game”: true,
“_comment_autosave_only_on_server”: “Whether autosaves should be saved only on server or also on all connected clients. Default is true.”,
“autosave_only_on_server”: true,
“_comment_non_blocking_saving”: “Highly experimental feature, enable only at your own risk of losing your saves. On UNIX systems, server will fork itself to create an autosave. Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.”,
“non_blocking_saving”: false,
“_comment_segment_sizes”: “Long network messages are split into segments that are sent over multiple ticks. Their size depends on the number of peers currently connected. Increasing the segment size will increase upload bandwidth requirement for the server and download bandwidth requirement for clients. This setting only affects server outbound messages. Changing these settings can have a negative impact on connection stability for some clients.”,
“minimum_segment_size”: 25,
“minimum_segment_size_peer_count”: 20,
“maximum_segment_size”: 100,
“maximum_segment_size_peer_count”: 10
}
For example:
This file must be manually created if you want admin privileges.
If you want the server to appear in the public browser, ensure your Factorio.com credentials are correct in the `username` and `password` fields. You can find them on the Factorio website under your account settings.
“password”: “password”,
Example:
“password”: “Beanz$”,
You’ll want to configure
and
Here is server-settings.json filled out with generic parameters. You can copy this into your own server-settings.json and change as needed. Or leave it.
If you want to have the server publicly visible on the in game server browser list then you’ll need to go to Factorio.com and sign in to find your username and password. Go to your Account settings and it will be listed there. Replace this:
“password”: “password”,
Example:
“password”: “Beanz$”,
server-adminlist.json does not exist by default. So you’ll have to create it if you want admin abilities. Just create a new text file in C:\SteamCMD\steamapps\common\Factorio\data\ and call it server-adminlist.json. Fill it in with the below
For example:
Extras
Command to have your server start on Windows startup.
This disables it.
And that wraps up our share on Factorio: [Easy Mode] Factorio Dedicated Server using Windows Batch. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by Ghostwheel, who deserves all the credit. Happy gaming!