Valhalla can be configured using TOML configuration files or environment variables. This guide covers all available configuration options.
Each server type has its own configuration file:
config_login.toml- Login serverconfig_world.toml- World serverconfig_channel_<N>.toml- Channel servers (one per channel)config_cashshop.toml- Cash shop server
For containerized deployments, configuration can be set via environment variables. Variable names follow this pattern:
VALHALLA_<SECTION>_<KEY>=value
For example:
[login]
clientListenAddress = "0.0.0.0"Becomes:
VALHALLA_LOGIN_CLIENTLISTENADDRESS=0.0.0.0All server executables accept the following flags:
| Flag | Required | Description | Example |
|---|---|---|---|
-type |
Yes | Server type to start | -type login, -type world, -type channel, -type cashshop |
-config |
No | Path to TOML config file | -config config_login.toml |
-metrics-port |
No | Port for Prometheus metrics | -metrics-port 9000 (default) |
# Login server with custom config
./Valhalla -type login -config config_login.toml
# World server with default config and custom metrics port
./Valhalla -type world -metrics-port 9001
# Channel server
./Valhalla -type channel -config config_channel_1.tomlAll server types require database configuration.
| Parameter | Type | Description | Default |
|---|---|---|---|
address |
string | Database server address | 127.0.0.1 |
port |
string | Database server port | 3306 |
user |
string | Database username | root |
password |
string | Database password | password |
database |
string | Database name | maplestory |
Environment Variable Prefix: VALHALLA_DATABASE_
[database]
address = "127.0.0.1"
port = "3306"
user = "root"
password = "password"
database = "maplestory"Configuration section: [login]
| Parameter | Type | Description | Default | Env Variable |
|---|---|---|---|---|
clientListenAddress |
string | Address to listen for client connections | 0.0.0.0 |
VALHALLA_LOGIN_CLIENTLISTENADDRESS |
clientListenPort |
string | Port for client connections | 8484 |
VALHALLA_LOGIN_CLIENTLISTENPORT |
serverListenAddress |
string | Address to listen for server connections | 0.0.0.0 |
VALHALLA_LOGIN_SERVERLISTENADDRESS |
serverListenPort |
string | Port for server connections | 8485 |
VALHALLA_LOGIN_SERVERLISTENPORT |
withPin |
bool | Enable PIN code requirement | false |
VALHALLA_LOGIN_WITHPIN |
autoRegister |
bool | Auto-create accounts on login attempt | false |
VALHALLA_LOGIN_AUTOREGISTER |
packetQueueSize |
int | Size of packet processing queue | 512 |
VALHALLA_LOGIN_PACKETQUEUESIZE |
latency |
int | Simulated latency in milliseconds (for testing) | 0 |
VALHALLA_LOGIN_LATENCY |
jitter |
int | Simulated jitter in milliseconds (for testing) | 0 |
VALHALLA_LOGIN_JITTER |
When autoRegister = true:
- New accounts are automatically created when users attempt to login with non-existent credentials
- Default values: gender=0, dob=1111111, eula=1, adminLevel=0, PIN="1111"
- Security Note: Only enable this for development or private servers. Disable for production.
[login]
clientListenAddress = "0.0.0.0"
clientListenPort = "8484"
serverListenAddress = "0.0.0.0"
serverListenPort = "8485"
withPin = false
autoRegister = false
packetQueueSize = 512
latency = 0
jitter = 0Configuration section: [world]
| Parameter | Type | Description | Default | Env Variable |
|---|---|---|---|---|
message |
string | World server message displayed to players | message |
VALHALLA_WORLD_MESSAGE |
ribbon |
int | Ribbon type (0=none, 1=event, 2=new, 3=hot) | 2 |
VALHALLA_WORLD_RIBBON |
expRate |
float | Experience rate multiplier | 1.0 |
VALHALLA_WORLD_EXPRATE |
dropRate |
float | Drop rate multiplier | 1.0 |
VALHALLA_WORLD_DROPRATE |
mesosRate |
float | Mesos rate multiplier | 1.0 |
VALHALLA_WORLD_MESOSRATE |
loginAddress |
string | Login server address | 127.0.0.1 |
VALHALLA_WORLD_LOGINADDRESS |
loginPort |
string | Login server port | 8485 |
VALHALLA_WORLD_LOGINPORT |
listenAddress |
string | Address to listen for connections | 0.0.0.0 |
VALHALLA_WORLD_LISTENADDRESS |
listenPort |
string | Port to listen on | 8584 |
VALHALLA_WORLD_LISTENPORT |
packetQueueSize |
int | Size of packet processing queue | 512 |
VALHALLA_WORLD_PACKETQUEUESIZE |
0- No ribbon1- Event ribbon (yellow)2- New ribbon (green)3- Hot ribbon (red)
[world]
message = "Welcome to Valhalla!"
ribbon = 2
expRate = 1.0
dropRate = 1.0
mesosRate = 1.0
loginAddress = "127.0.0.1"
loginPort = "8485"
listenAddress = "0.0.0.0"
listenPort = "8584"
packetQueueSize = 512Configuration section: [channel]
| Parameter | Type | Description | Default | Env Variable |
|---|---|---|---|---|
worldAddress |
string | World server address | 127.0.0.1 |
VALHALLA_CHANNEL_WORLDADDRESS |
worldPort |
string | World server port | 8584 |
VALHALLA_CHANNEL_WORLDPORT |
listenAddress |
string | Address to listen for server connections | 0.0.0.0 |
VALHALLA_CHANNEL_LISTENADDRESS |
listenPort |
string | Port for server connections | 8685 |
VALHALLA_CHANNEL_LISTENPORT |
clientConnectionAddress |
string | Address clients connect to (external IP) | 127.0.0.1 |
VALHALLA_CHANNEL_CLIENTCONNECTIONADDRESS |
packetQueueSize |
int | Size of packet processing queue | 512 |
VALHALLA_CHANNEL_PACKETQUEUESIZE |
maxPop |
int | Maximum channel population | 250 |
VALHALLA_CHANNEL_MAXPOP |
latency |
int | Simulated latency in milliseconds (for testing) | 0 |
VALHALLA_CHANNEL_LATENCY |
jitter |
int | Simulated jitter in milliseconds (for testing) | 0 |
VALHALLA_CHANNEL_JITTER |
Each channel requires its own configuration file and process. Channels are numbered starting from 1:
- Channel 1:
listenPort = 8685 - Channel 2:
listenPort = 8686 - Channel 3:
listenPort = 8687 - And so on...
[channel]
worldAddress = "127.0.0.1"
worldPort = "8584"
listenAddress = "0.0.0.0"
listenPort = "8685"
clientConnectionAddress = "127.0.0.1"
packetQueueSize = 512
maxPop = 250
latency = 0
jitter = 0Configuration section: [cashshop]
| Parameter | Type | Description | Default | Env Variable |
|---|---|---|---|---|
worldAddress |
string | World server address | 127.0.0.1 |
VALHALLA_CASHSHOP_WORLDADDRESS |
worldPort |
string | World server port | 8584 |
VALHALLA_CASHSHOP_WORLDPORT |
listenAddress |
string | Address to listen for server connections | 0.0.0.0 |
VALHALLA_CASHSHOP_LISTENADDRESS |
listenPort |
string | Port for server connections | 8600 |
VALHALLA_CASHSHOP_LISTENPORT |
clientConnectionAddress |
string | Address clients connect to (external IP) | 127.0.0.1 |
VALHALLA_CASHSHOP_CLIENTCONNECTIONADDRESS |
packetQueueSize |
int | Size of packet processing queue | 512 |
VALHALLA_CASHSHOP_PACKETQUEUESIZE |
latency |
int | Simulated latency in milliseconds (for testing) | 0 |
VALHALLA_CASHSHOP_LATENCY |
jitter |
int | Simulated jitter in milliseconds (for testing) | 0 |
VALHALLA_CASHSHOP_JITTER |
[cashshop]
worldAddress = "127.0.0.1"
worldPort = "8584"
listenAddress = "0.0.0.0"
listenPort = "8600"
clientConnectionAddress = "127.0.0.1"
packetQueueSize = 512
latency = 0
jitter = 0For local testing:
clientConnectionAddress = "127.0.0.1"For LAN or internet access, set to your server's external IP:
clientConnectionAddress = "192.168.1.100" # LAN
# or
clientConnectionAddress = "203.0.113.1" # Public IPSee Docker.md and Kubernetes.md for container-specific networking.
Higher values can handle more simultaneous connections but use more memory:
- Small servers (1-50 players):
512 - Medium servers (50-200 players):
1024 - Large servers (200+ players):
2048
For development environments mimicking real-world conditions:
latency = 50 # 50ms base latency
jitter = 10 # ±10ms variationNote: Always set to 0 for production servers.
- Installation Guide - Setting up Valhalla
- Local Setup - Running locally
- Docker Setup - Running with Docker
- Kubernetes Setup - Kubernetes deployment