Skip to main content

Configuration File Location

Server configuration is stored in server.cfg within each world save directory:
%AppData%\Nitrox\saves\<World Name>\server.cfg
Each world save has its own independent configuration file. Changes only affect that specific world.

Configuration File Format

The server.cfg file uses a simple key-value format:
# Comments start with #
ServerPort=11000
MaxConnections=100
ServerPassword=
GameMode=SURVIVAL

Core Settings

Network Configuration

ServerPort

ServerPort=11000
  • Type: Integer
  • Default: 11000
  • Description: UDP port the server listens on for incoming connections
  • Note: Must be forwarded through your router for internet play

MaxConnections

MaxConnections=100
  • Type: Integer
  • Default: 100
  • Range: Must be greater than 0
  • Description: Maximum number of simultaneous player connections

AutoPortForward

AutoPortForward=true
  • Type: Boolean
  • Default: true
  • Description: Automatically attempts to open the server port on your router via UPnP
  • Note: Requires UPnP support on your router
Source: SubnauticaServerConfig.cs:118-119

LANDiscoveryEnabled

LANDiscoveryEnabled=true
  • Type: Boolean
  • Default: true
  • Description: Allow the server to respond to LAN discovery broadcasts
  • Note: Enables automatic server detection for players on the same local network
Source: SubnauticaServerConfig.cs:120-121

Authentication & Security

ServerPassword

ServerPassword=
  • Type: String
  • Default: Empty (no password)
  • Description: Password required for players to join the server
  • Note: Leave empty for a public server

AdminPassword

AdminPassword=abc123XYZ789
  • Type: String
  • Default: Randomly generated 12-character string
  • Description: Password for admin privileges
  • Important: Change this from the default!
Source: SubnauticaServerConfig.cs:93
public string AdminPassword { get; set; } = StringHelper.GenerateRandomString(12);

DefaultPlayerPerm

DefaultPlayerPerm=PLAYER
  • Type: Enum
  • Default: PLAYER
  • Options:
    • NONE - No permissions
    • PLAYER - Basic player permissions, cannot use cheats
    • MODERATOR - Can manage players, use vanilla cheats
    • ADMIN - Full server administration
    • CONSOLE - All permissions (reserved for console)
  • Description: Default permission level for new players
Source: Perms.cs:5-27

LocalhostIsAdmin

LocalhostIsAdmin=true
  • Type: Boolean
  • Default: true
  • Description: Players connecting from localhost (127.0.0.1) automatically get admin permissions
  • Warning: Disable this if using a proxy server
Source: SubnauticaServerConfig.cs:104-105

Gameplay Settings

Game Mode

GameMode=SURVIVAL
  • Type: Enum
  • Default: SURVIVAL
  • Options:
    • SURVIVAL (0) - Standard survival mode
    • FREEDOM (2) - No hunger/thirst
    • HARDCORE (257) - Permadeath
    • CREATIVE (1790) - Unlimited resources, no threats
  • Description: World game mode
Source: NitroxGameMode.cs:6-12
public enum NitroxGameMode
{
    SURVIVAL = 0,
    FREEDOM = 2,
    HARDCORE = 257,
    CREATIVE = 1790,
}

World Seed

Seed=
  • Type: String
  • Default: Empty (random)
  • Description: Leave blank for random spawn position, or specify a seed for reproducible worlds
Source: SubnauticaServerConfig.cs:25-26

PvP Settings

PvPEnabled=true
  • Type: Boolean
  • Default: true
  • Description: Enables or disables player-versus-player damage and interactions
Source: SubnauticaServerConfig.cs:129-130

Death Settings

KeepInventoryOnDeath=false
  • Type: Boolean
  • Default: false
  • Description: Prevents players from losing items when they die
Source: SubnauticaServerConfig.cs:30-31

Save & Backup Configuration

Save Interval

SaveInterval=120000
  • Type: Integer (milliseconds)
  • Default: 120000 (2 minutes)
  • Minimum: 1000 (1 second)
  • Description: Time between automatic world saves
  • Note: More frequent saves = more safety but slightly more disk I/O
Source: SubnauticaServerConfig.cs:34-43

Auto-Save Control

DisableAutoSave=false
  • Type: Boolean
  • Default: false
  • Description: Completely disable automatic saving
  • Warning: Not recommended - use manual save commands only
Source: SubnauticaServerConfig.cs:87

Backup Settings

MaxBackups=10
DisableAutoBackup=false
MaxBackups:
  • Type: Integer
  • Default: 10
  • Range: 0 or greater (0 = unlimited)
  • Description: Number of backup saves to retain
Source: SubnauticaServerConfig.cs:45-54 DisableAutoBackup:
  • Type: Boolean
  • Default: false
  • Description: Disable automatic backup creation
Source: SubnauticaServerConfig.cs:89

Post-Save Command

PostSaveCommandPath=
  • Type: String (file path)
  • Default: Empty
  • Description: Path to executable/script to run after successful save (e.g., for custom backup solutions)
  • Examples:
    • Windows: C:\Scripts\backup.bat
    • Linux: /home/user/scripts/backup.sh
Source: SubnauticaServerConfig.cs:56-61

Performance Settings

Entity Cache

CreateFullEntityCache=false
  • Type: Boolean
  • Default: false
  • Description: Pre-load all 504,732 world entities on server start
  • Warning: Initial startup will take several minutes, but improves player experience in new areas
Source: SubnauticaServerConfig.cs:14-15
# WARNING! Will make server load take longer on the cache run
# but players will gain a performance boost when entering new areas.
CreateFullEntityCache=false

Initial Sync Timeout

InitialSyncTimeout=120000
  • Type: Integer (milliseconds)
  • Default: 120000 (2 minutes)
  • Description: Maximum time allowed for initial world sync when a player joins
  • Note: Increase if players with slow connections timeout during join
Source: SubnauticaServerConfig.cs:74-83

Safe Building

SafeBuilding=true
  • Type: Boolean
  • Default: true
  • Description: Reject build actions detected as desynced
  • Note: Prevents building glitches but may occasionally reject valid builds
Source: SubnauticaServerConfig.cs:123-124

Serialization Settings

Serializer Mode

SerializerMode=JSON
  • Type: Enum
  • Default: JSON
  • Options:
    • JSON - Human-readable, easier to debug
    • PROTOBUF - Binary format, smaller file size
  • Description: Format for save files
  • Warning: Cannot easily switch between formats without data conversion
Source: SubnauticaServerConfig.cs:98-99

UI Settings

Console Disable

DisableConsole=false
  • Type: Boolean
  • Default: false
  • Description: Disable server console for all players
Source: SubnauticaServerConfig.cs:85

Embedded Mode

IsEmbedded=true  
  • Type: Boolean
  • Default: true
  • Description: When started via launcher, use launcher UI instead of external window
Source: SubnauticaServerConfig.cs:126-127

Player Stats Configuration

Default values for new players joining the server:
# Oxygen
DefaultOxygenValue=45
DefaultMaxOxygenValue=45

# Health
DefaultHealthValue=80

# Survival stats
DefaultHungerValue=50.5
DefaultThirstValue=90.5

# Infection
DefaultInfectionValue=0.1
Source: SubnauticaServerConfig.cs:107-116
DefaultInfectionValue: Recommended to keep at 0.1 (default starting value). Set to 0 to cure new players by default.

Example Configurations

Public Casual Server

# Open to everyone, relaxed gameplay
ServerPort=11000
MaxConnections=50
ServerPassword=
GameMode=FREEDOM
PvPEnabled=false
KeepInventoryOnDeath=true
SaveInterval=120000
MaxBackups=10
AutoPortForward=true
LANDiscoveryEnabled=true

Private Hardcore Server

# Password-protected, challenging gameplay  
ServerPort=11000
MaxConnections=10
ServerPassword=MySecretPassword123
AdminPassword=SuperSecretAdmin456
GameMode=HARDCORE
PvPEnabled=true
KeepInventoryOnDeath=false
SaveInterval=60000
MaxBackups=20
AutoPortForward=true
LANDiscoveryEnabled=false

High-Performance Server

# Optimized for large player counts
ServerPort=11000
MaxConnections=100
ServerPassword=
GameMode=SURVIVAL
CreateFullEntityCache=true
SaveInterval=300000
MaxBackups=5
InitialSyncTimeout=180000
SafeBuilding=true

Applying Configuration Changes

1

Stop the Server

Gracefully shut down the server to ensure no data corruption.
2

Edit server.cfg

Modify the configuration file with your preferred text editor.
3

Restart the Server

Start the server again. New settings will be applied on startup.
Some settings like GameMode and SerializerMode should not be changed after world creation. Create a new world if you need to change these.

Configuration via Console Commands

Some settings can be changed while the server is running:
# Change admin password
changeadminpassword <new_password>

# Change server password  
changeserverpassword <new_password>

# Toggle autosave
autosave

# View/modify config
config
Use the config command to view current configuration values without stopping the server.

Troubleshooting Configuration Issues

Solution:
  • Check for syntax errors in server.cfg
  • Verify values are within valid ranges
  • Restore from a backup config if needed
  • Check server logs for specific error messages
Solution:
  • Ensure you edited the correct save folder’s server.cfg
  • Fully restart the server (stop and start, not just reload)
  • Some settings only apply to new players/worlds
Solution:
  • File is created on first server start
  • Check the correct save folder: %AppData%/Nitrox/saves/<WorldName>/
  • Create manually if needed - server will populate defaults

Next Steps

Hosting a Server

Learn how to start and manage your server

Troubleshooting

Solve common server issues

Build docs developers (and LLMs) love