server.cfg Setup
A reference for the server.cfg entries required by Shiva.
Minimal Example
ini
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
set sv_maxclients 64
set sv_licenseKey "your-license-key"
set sv_hostname "My Shiva Server"
# Database
set mysql_connection_string "mysql://shiva:password@127.0.0.1/shiva?charset=utf8mb4"
# Shiva secrets (keep these out of version control!)
set SHIVA_API_SECRET "a-random-secret-string"
# Core dependencies — must come first
ensure shiva-db
ensure shiva-fw
ensure shiva-core
# shiva-boot must be last — starts the module loader
ensure shiva-boot
# Default modules
ensure shiva-player
ensure shiva-economy
ensure shiva-jobs
ensure shiva-gangs
ensure shiva-inventory
ensure shiva-vehicles
ensure shiva-weapons
ensure shiva-notifications
ensure shiva-commands
# Your custom modules
ensure my-custom-moduleLoad Order
Critical: The following order is required. shiva-core's internal boot sequence depends on it.
| # | Resource | Why |
|---|---|---|
| 1 | shiva-db | Database pool must initialise before any ORM or migration code runs |
| 2 | shiva-fw | Provides shared globals (Container, EventBus, Collection, etc.) |
| 3 | shiva-core | Loads in order internally: config → logger → container → eventbus → querybuilder → database → models → migrations → cache → scheduler → security → state → jurisdiction → modules → api_bridge → boot |
| 4–n | Shiva modules | Any order; dependency graph is resolved automatically |
| last | shiva-boot | Fires shiva:ready after all modules have loaded |
WARNING
shiva-boot must be the last Shiva resource in server.cfg. Loading it too early will cause modules to miss the shiva:ready event.
ConVars Reference
Required
| ConVar | Description |
|---|---|
mysql_connection_string | Full MySQL/MariaDB connection string |
sv_licenseKey | Your Cfx.re license key |
sv_maxclients | Must match Shiva.maxPlayers in config |
Shiva Secrets
| ConVar | Description |
|---|---|
SHIVA_API_SECRET | Shared secret for shiva-api JWT tokens |
SHIVA_DEV | Set to true to enable dev mode (verbose logging, hot-reload) |
shiva-db Tuning (Optional)
| ConVar | Default | Description |
|---|---|---|
shiva_db_pool_limit | 10 | Maximum connections in the pool |
shiva_db_max_idle | 5 | Maximum idle connections kept alive |
shiva_db_idle_timeout | 60000 | Idle connection timeout in ms |
shiva_db_connect_timeout | 5000 | Connection attempt timeout in ms |
shiva_db_slow_query_ms | 500 | Queries slower than this (ms) are logged as warnings |
shiva_db_debug | false | Log every SQL query (very verbose) |
ini
# Example tuning for a high-population server
set shiva_db_pool_limit "20"
set shiva_db_slow_query_ms "200"Enabling txAdmin
txAdmin is the recommended way to manage your server. Set sv_licenseKey to a txAdmin-issued key and follow txAdmin's standard setup — Shiva is fully compatible.