This guide covers how to set up your Foundry dedicated server on Legion Hosting, configure startup variables, edit the server settings file, set up world generation, connect to your server, and manage saves and backups. Foundry is a voxel-based factory-building game where players mine resources, build automated production lines, and expand massive factories across a procedurally generated world. For admin controls, player management, and troubleshooting, see Foundry Admin and Server Management.
1. First Start
- Log in to GPanel and select your Foundry server.
- Go to the Startup tab and review the configurable variables (see the table in Section 2).
- Set SERVER_NAME to a name for your server. This appears in the Steam server browser.
- Set SRV_PW if you want to restrict access. Leave it blank for a public server.
- Optionally set a MAP_SEED to control world generation. Leave blank for a random seed.
- Return to the Console tab and click Start.
- Wait for the console to confirm the server has started. The first launch may take a couple of minutes as the server generates the world and creates initial configuration files.
App.cfg or other configuration files, start the server once, let it finish loading, then stop it before editing. The files will not exist until the first run.
2. GPanel Startup Variables
The following variables are available in the GPanel Startup tab. These are passed to the server on each start.
| Variable | Required | Description |
|---|---|---|
SERVER_NAME |
Yes | The name displayed in the Steam server browser. |
SRV_PW |
No | Optional password players must enter to join. Leave blank for a public server. |
MAX_PLAYERS |
No | Maximum number of concurrent players. Default is 32. |
MAP_SEED |
No | World generation seed number. Use the same seed to recreate identical terrain. Leave blank for a random world. |
WORLD_NAME |
No | The name of the world/save folder. Default is MyFoundry. Changing this creates a new world. |
PUBLIC_SERVER |
No | Whether the server appears in the Steam server browser. Set to true or false. Default is true. |
3. Server Configuration File
For advanced settings beyond what the startup variables offer, you can edit the server configuration file directly. Stop your server before making changes.
File Location
App.cfg
Open this file using the Files tab in GPanel or connect via SFTP. The file uses a simple key=value format with one setting per line. If the file does not exist, start and stop the server once to generate it.
App.cfg on startup. Changes made while the server is running will not take effect until the next restart.
Key Settings in App.cfg
| Setting | Default | Description |
|---|---|---|
server_name |
My Server |
Server name shown in the Steam server browser. |
server_password |
(empty) | Password required to join the server. Empty means public. |
server_world_name |
MyFoundry |
The world/save folder name. Each unique name creates a separate world with its own save data. |
server_max_players |
32 |
Maximum concurrent players allowed on the server. |
server_is_public |
true |
Controls whether the server is listed in the Steam server browser. |
server_port |
3724 |
Game port. This is managed by GPanel -- do not change it unless instructed by support. |
server_query_port |
27015 |
Steam query port used for server browser listings. Managed by GPanel. |
map_seed |
(random) | Seed number for procedural world generation. Use any integer value. The same seed always produces the same terrain layout. |
autosave_interval |
300 |
Auto-save interval in seconds. Default is 300 (5 minutes). Set to 0 to disable auto-save. |
pause_server_when_empty |
true |
Pauses the game world when no players are connected. Set to false to keep the factory running 24/7. |
Example Configuration
server_name=My Legion Factory
server_password=
server_world_name=MyFoundry
server_max_players=16
server_is_public=true
server_port=3724
server_query_port=27015
map_seed=48293175
autosave_interval=300
pause_server_when_empty=true
server_port and server_query_port are assigned by GPanel and must match your allocated ports. Changing them will prevent players from connecting and the server from appearing in the browser.
4. World Generation
Foundry uses procedural world generation to create its voxel terrain. The world is generated from a seed number, which determines the layout of terrain, ore deposits, and biomes.
Map Seed
- Set the
map_seedvalue inApp.cfgor theMAP_SEEDstartup variable to any integer. - Using the same seed always produces the same world layout, which is useful if you want to share a specific world with others or recreate a world after a reset.
- Leave the seed blank or omit it entirely to let the server generate a random world.
- The seed only affects initial world generation. Changing the seed on an existing world has no effect -- you must create a new world (change
server_world_name) for a new seed to take effect.
World Name and Multiple Worlds
The server_world_name setting determines which save folder the server uses. You can maintain multiple worlds by switching between different world names:
- Each unique
server_world_namecreates a separate world with its own save data, factory state, and player progress. - To switch worlds, stop the server, change the
server_world_nameinApp.cfg, and restart. - Previous worlds are preserved and can be loaded again by switching back to their name.
Pause When Empty
The pause_server_when_empty option controls whether your factory continues operating when no players are online:
- true (default) -- The world pauses when all players disconnect. Factories stop producing, resources stop being consumed. Good for saving server resources and keeping the game state predictable.
- false -- The factory keeps running 24/7. Production lines continue, resources accumulate, and the world progresses even when nobody is playing. Can increase server resource usage.
5. How to Connect
Option A -- Steam Server Browser
- Launch Foundry.
- From the main menu, select Multiplayer.
- Click Join Game to open the server browser.
- Use the search bar to find your server by name.
- Select your server and click Join. Enter the server password if one is set.
Option B -- Direct Connect
- Launch Foundry.
- From the main menu, select Multiplayer.
- Choose the Direct Connect option.
- Enter your server's IP address and port from GPanel's Network tab:
<your-server-ip>:<port> - Enter the server password if prompted and click Connect.
6. Save Management
Auto-Save
The server auto-saves at the interval specified by autosave_interval in App.cfg (default: every 300 seconds / 5 minutes). Foundry auto-saves are non-intrusive and do not cause noticeable lag for most factory sizes.
Save File Location
Save files are stored on the server at the path specified by server_persistent_data_override_folder in App.cfg. The default path is:
serverfiles/
This directory contains the full world state including terrain modifications, placed structures, factory machines, conveyor belts, and player inventories.
Manual Backups via SFTP
- Stop the server from GPanel to ensure all data is written to disk.
- Connect to your server via SFTP. See How to Upload Files via SFTP for instructions.
- Download the entire save directory for your world (e.g.,
serverfiles/). - Store the backup in a safe location on your computer.
Restoring a Save
- Stop the server from GPanel.
- Connect via SFTP and navigate to the
serverfiles/directory. - Upload your backed-up world directory, replacing the existing one.
- Ensure the folder name matches the
server_world_nameinApp.cfg. - Start the server from GPanel. The server will load the restored save.
7. Performance Tips
Foundry is a factory-building game, and server performance is directly affected by factory complexity. Keep these tips in mind as your factory grows:
- Factory complexity: Large numbers of machines, conveyor belts, and logistics networks increase server tick load. If you notice lag, consider consolidating or optimizing production chains.
- Chunk loading: The server processes all loaded chunks. More active factory areas spread across the map means more chunks to simulate. Keeping your factory compact reduces the number of chunks the server must track.
- Player count: More connected players means more chunks loaded around each player. If performance degrades with many players, consider reducing
server_max_players. - Auto-save frequency: Very frequent auto-saves (under 60 seconds) on large worlds can cause periodic hitches. The default 300 seconds is usually fine, but you can increase it if needed.
- Pause when empty: Enabling
pause_server_when_empty=trueprevents unnecessary simulation when nobody is playing, which helps maintain consistent performance during active play sessions.
Related Articles
- Foundry Admin and Server Management
- How to Find Your Server IP and Port
- How to Upload Files via SFTP
- Server Startup Guide
Need Help?
If you run into issues with your Foundry server that are not covered here, open a support ticket and include your server IP, a description of the problem, and any relevant error messages from the GPanel console.