This guide covers everything you need to configure and run your Factorio dedicated server on Legion Hosting, including account authentication, startup variables, server settings, world generation, connecting players, and save management. For mod installation, see Factorio Mod Installation.
1. Getting a Factorio Account Token
A Factorio account username and token are required if you want your server to appear in the public multiplayer server browser. They are also needed for downloading mods from the official mod portal.
- Go to factorio.com/login and sign into your Factorio account.
- Navigate to your Profile page.
- Scroll down to the API Authentication Tokens section.
- Click Generate to create a new token (or copy your existing token).
- Copy the token string -- you will paste it into GPanel's Startup tab in the
SERVER_TOKENfield.
SERVER_USERNAME and SERVER_TOKEN empty. However, the server will not be able to download mods from the mod portal automatically without valid credentials.
2. First Start
After purchasing your Factorio server from Legion Hosting, follow these steps to get it running for the first time:
- Log into GPanel and select your Factorio server.
- Go to the Startup tab.
- Set the FACTORIO_VERSION variable:
latest-- installs the current stable release (recommended for most players).experimental-- installs the latest experimental/beta build with the newest features, but may have bugs.
- Set your SERVER_NAME to whatever you want displayed in the server browser.
- Fill in SERVER_USERNAME and SERVER_TOKEN if you want public server listing (see section above).
- Go to the Console tab and click Start.
- The server will download the Factorio dedicated server files and generate a default save. This may take a few minutes on first launch.
FACTORIO_VERSION variable in the Startup tab and restart your server. The new version will be downloaded automatically.
3. GPanel Startup Variables
These variables are configured in GPanel's Startup tab and control core server behavior. They take effect on each server start.
| Variable | Default | Description |
|---|---|---|
FACTORIO_VERSION |
latest |
Server version to install. Use latest for stable or experimental for the latest beta. |
SAVE_NAME |
gamesave |
Name of the save file the server loads on startup (without extension). |
SERVER_NAME |
|
Server name displayed in the multiplayer browser. |
SERVER_DESC |
|
Short description shown alongside the server name in the browser. |
SERVER_USERNAME |
|
Your Factorio account username. Required for public server listing and mod downloads. |
SERVER_TOKEN |
|
Your Factorio account authentication token. Required alongside username for public listing. |
MAX_SLOTS |
20 |
Maximum number of player slots on the server. |
SAVE_INTERVAL |
10 |
Auto-save interval in minutes. |
SAVE_SLOTS |
5 |
Number of rotating auto-save slots. Older saves are overwritten when this limit is reached. |
AFK_KICK |
0 |
Minutes before an idle player is kicked. 0 disables AFK kick. |
4. server-settings.json
The primary server configuration file is located at:
data/server-settings.json
Edit this file via the File Manager in GPanel or through SFTP. Below are the most important settings.
SERVER_NAME, SERVER_DESC, MAX_SLOTS, SERVER_USERNAME, and SERVER_TOKEN) may override corresponding values in server-settings.json at startup. Always check your Startup tab values first if settings appear to not take effect.
| Setting | Default | Description |
|---|---|---|
name |
"" |
Server name shown in the multiplayer browser. |
description |
"" |
Server description shown in the browser. |
tags |
[] |
Array of tag strings (e.g., ["modded", "vanilla", "friendly"]) for filtering in the browser. |
max_players |
0 |
Maximum players. 0 means unlimited (use MAX_SLOTS startup variable instead). |
visibility |
{"public": true, "lan": true} |
Controls whether the server appears in the public browser and/or LAN browser. Requires valid username and token for public visibility. |
game_password |
"" |
Password required to join. Leave empty for no password. |
require_user_verification |
true |
When true, only players with a verified Factorio account can join. |
autosave_interval |
10 |
Auto-save interval in minutes (may be overridden by SAVE_INTERVAL startup variable). |
autosave_slots |
5 |
Number of rotating auto-save files (may be overridden by SAVE_SLOTS startup variable). |
afk_autokick_interval |
0 |
AFK kick timeout in minutes. 0 disables it. |
auto_pause |
true |
Pauses the game when no players are connected. Saves resources on your server. |
only_admins_can_pause_the_game |
true |
Restricts the pause ability to server admins only. |
admins |
[] |
Array of Factorio usernames who have admin privileges (e.g., ["YourUsername"]). Admins can kick, ban, and run commands. |
Example server-settings.json
{
"name": "My Factorio Server",
"description": "A Legion Hosting Factorio Server",
"tags": ["vanilla", "friendly"],
"max_players": 0,
"visibility": {
"public": true,
"lan": true
},
"username": "YourFactorioUsername",
"token": "YourTokenHere",
"game_password": "",
"require_user_verification": true,
"max_heartbeats_per_second": 60,
"allow_commands": "admins-only",
"autosave_interval": 10,
"autosave_slots": 5,
"afk_autokick_interval": 0,
"auto_pause": true,
"only_admins_can_pause_the_game": true,
"max_upload_in_kilobytes_per_second": 0,
"max_upload_slots": 5,
"minimum_latency_in_ticks": 0,
"ignore_player_limit_for_returning_players": false,
"admins": ["YourFactorioUsername"]
}
5. Map Generation
Factorio uses two configuration files to control how new maps are generated and how the world behaves during gameplay.
map-gen-settings.json (World Generation)
Located at:
data/map-gen-settings.json
This file controls the terrain, resource distribution, and enemy placement when a new map is created. Changes to this file only take effect when generating a fresh map -- they do not alter an existing save.
| Setting | Description |
|---|---|
width / height |
Map dimensions in tiles. 0 means infinite (default). Set specific values to limit map size. |
seed |
Map generation seed. Use null for a random seed, or specify a number to reproduce a specific map. |
peaceful_mode |
false by default. When true, enemies will not attack first. |
autoplace_controls |
Controls frequency, size, and richness of resources and terrain features. Each entry (e.g., iron-ore, copper-ore, coal, stone, crude-oil, trees, enemy-base) accepts frequency, size, and richness values. |
cliff_settings |
Controls cliff generation: name, cliff_elevation_0 (first cliff altitude), cliff_elevation_interval (spacing between cliff levels), richness (cliff density). |
starting_area |
Size of the safe starting area (no enemies). Default is 1. Higher values give more room before encountering biters. |
property_expression_names |
Advanced terrain expressions for water coverage, elevation, and moisture. control-setting:moisture:bias and similar keys adjust terrain generation. |
Resource Frequency, Size, and Richness Values
For each resource in autoplace_controls, you can adjust three properties. Values are multipliers where 1 is normal:
| Property | Effect |
|---|---|
frequency |
How often the resource appears. Higher = more patches spread across the map. |
size |
How large each resource patch is. |
richness |
How many items each tile of the resource yields before depletion. |
Example map-gen-settings.json
{
"width": 0,
"height": 0,
"seed": null,
"peaceful_mode": false,
"autoplace_controls": {
"iron-ore": { "frequency": 1, "size": 1.5, "richness": 2 },
"copper-ore": { "frequency": 1, "size": 1.5, "richness": 2 },
"coal": { "frequency": 1, "size": 1, "richness": 1.5 },
"stone": { "frequency": 1, "size": 1, "richness": 1.5 },
"crude-oil": { "frequency": 1, "size": 1, "richness": 2 },
"uranium-ore": { "frequency": 1, "size": 1, "richness": 1 },
"trees": { "frequency": 1, "size": 1, "richness": 1 },
"enemy-base": { "frequency": 1, "size": 1, "richness": 1 }
},
"cliff_settings": {
"name": "cliff",
"cliff_elevation_0": 10,
"cliff_elevation_interval": 40,
"richness": 1
},
"starting_area": 1,
"property_expression_names": {
"control-setting:moisture:frequency:multiplier": "1",
"control-setting:moisture:bias": "0"
}
}
map-settings.json (Runtime World Behavior)
Located at:
data/map-settings.json
This file controls runtime behavior such as pollution spread, enemy evolution, and expansion. Unlike map-gen-settings.json, some of these settings can affect an existing save when changed and the map is reloaded.
| Section | Key Settings | Description |
|---|---|---|
pollution |
enabled, diffusion_ratio, ageing, min_to_diffuse |
Controls whether pollution spreads, how fast it diffuses, and how quickly it decays. Disabling pollution also disables pollution-driven enemy attacks. |
enemy_evolution |
enabled, time_factor, destroy_factor, pollution_factor |
Controls how enemies evolve over time, from destroying spawners, and from pollution. Lower factors = slower evolution. Set enabled to false to freeze evolution entirely. |
enemy_expansion |
enabled, max_expansion_distance, settler_group_min_size, settler_group_max_size, min_expansion_cooldown, max_expansion_cooldown |
Controls whether enemies build new bases and how aggressively they expand. Disable to prevent biters from spreading across the map. |
steering |
default, moving |
Pathfinding behavior for units. Rarely needs adjustment. |
Example map-settings.json
{
"pollution": {
"enabled": true,
"diffusion_ratio": 0.02,
"min_to_diffuse": 15,
"ageing": 1,
"expected_max_per_chunk": 150,
"min_to_show_per_chunk": 50
},
"enemy_evolution": {
"enabled": true,
"time_factor": 0.000004,
"destroy_factor": 0.002,
"pollution_factor": 0.0000009
},
"enemy_expansion": {
"enabled": true,
"max_expansion_distance": 7,
"settler_group_min_size": 5,
"settler_group_max_size": 20,
"min_expansion_cooldown": 14400,
"max_expansion_cooldown": 216000
}
}
6. Creating a New Map
By default, your server generates a map with standard settings on first start. To create a fresh map with custom generation settings:
- Stop your server in GPanel.
- Edit
data/map-gen-settings.jsonanddata/map-settings.jsonwith your desired world generation and runtime settings (see section above). - Navigate to the saves directory in the File Manager.
- Delete or rename the existing save file (e.g.,
gamesave.zip) so the server generates a new one. - Ensure the
SAVE_NAMEstartup variable matches the save file name you want (default isgamesave). - Start the server. It will detect that no save exists with that name and generate a new map using your updated settings.
seed value in map-gen-settings.json to a specific number before generating. Use null for a random seed.
7. How to Connect
There are two ways for players to connect to your Factorio server.
Option A: Public Server Browser
If you have configured SERVER_USERNAME and SERVER_TOKEN with valid Factorio credentials and visibility.public is set to true:
- Open Factorio and click Play.
- Select Multiplayer.
- Click Browse public games.
- Use the search bar to find your server by name.
- Click the server to join. Enter the game password if one is set.
Option B: Direct Connect
- Open Factorio and click Play.
- Select Multiplayer.
- Click Connect to address.
- Enter your server's IP address and port in the format:
IP:Port - Click Connect.
8. Save Management
Auto-Save Configuration
Auto-saves are controlled by two startup variables:
SAVE_INTERVAL-- How often the server auto-saves, in minutes (default: 10).SAVE_SLOTS-- The number of rotating auto-save files kept (default: 5). Once the limit is reached, the oldest auto-save is overwritten.
Auto-save files are stored in the saves directory with names like _autosave1.zip, _autosave2.zip, etc.
Manual Saves
You can trigger a manual save at any time by running the following command in the GPanel console:
/server-save
This creates a save using the current SAVE_NAME. You can also save to a specific filename:
/server-save my-backup
Uploading an Existing Save
To transfer an existing Factorio world to your server:
- Stop your server in GPanel.
- Locate your local save file. On most systems, Factorio saves are found at:
- Windows:
%APPDATA%\Factorio\saves\ - Linux:
~/.factorio/saves/ - macOS:
~/Library/Application Support/factorio/saves/
- Windows:
- Upload the
.zipsave file to the saves directory on your server via the File Manager or SFTP. - In GPanel's Startup tab, set
SAVE_NAMEto the uploaded file name (without the.zipextension). - Start the server.
FACTORIO_VERSION startup variable to the version your save was created with.
Related Articles
- Factorio Mod Installation
- How to Find Your Server IP and Port
- How to Upload Files via SFTP
- Server Startup Guide
Need Help?
If you are experiencing issues not covered in this guide, open a support ticket with your server details and a description of the problem.