RUGENDOCS
Hosting rugen-server

Configuration

Every rugen-server environment variable and command line flag, with defaults.

rugen-server is configured with environment variables (in compose: the .env file or Dokploy’s Environment tab). Everything is optional.

Server

VariableDefaultMeaning
RUGEN_PUBLIC_URL–Public https URL. Logged, and its host is the UDP fallback host.
RUGEN_NAMErugen serverName in the in-game server list.
RUGEN_MOTDemptyMessage of the day.
RUGEN_BIND0.0.0.0:8080HTTP / WebSocket listener.
RUGEN_UDP_BIND0.0.0.0:7001UDP relay listener; off to disable it.
RUGEN_UDP_PUBLICpublic URL host + porthost:port clients send UDP to. Must not be Cloudflare-proxied.
RUGEN_DATA/dataDirectory of rugen.db (and packages/).
RUST_LOGinfoerror, warn, info, debug. Client IPs only appear at debug.

Packages

Temporary character packages for bring your own character.

VariableDefaultMeaning
RUGEN_PKG_DAYS3Days a package is kept after its upload, whatever uses it. Players see it in the game’s consent dialog.
RUGEN_PKG_TTLRUGEN_PKG_DAYSA package expires this long after its last use (90m, 2d, or seconds), never later than RUGEN_PKG_DAYS.
RUGEN_PKG_MAX_TOTAL5GBAll packages together; least recently used are evicted above it.
RUGEN_PKG_MAX150MBLargest single package accepted.
RUGEN_PKG_S3(off)Bucket that also serves packages (Cloudflare R2), same URL format as RUGEN_BACKUP_S3; objects under chars/. See Packages.
RUGEN_PKG_S3_MAX_GB8Stop copying new packages to that bucket above this many GB (they are served directly).
RUGEN_PKG_RATE_ACCOUNT1GBUpload bytes per account per hour.
RUGEN_PKG_RATE_IP2GBUpload bytes per client IP per hour.
RUGEN_PKG_REPLAY_TTL720Hours the packages of a stored ranked replay are evicted last (still deleted after RUGEN_PKG_DAYS).

Fairness

Thresholds for the matchup verdict.

VariableDefaultMeaning
RUGEN_FAIR_RATIO1.6Power-score ratio above which a matchup is UNBALANCED.
RUGEN_FAIR_COMMUNITY_GAP200Community rating gap that is UNBALANCED.
RUGEN_FAIR_MIN_GAMES10Verified games before a character’s community rating counts.

Re-simulation

Only with a server built with --features resim; see Re-simulation.

VariableDefaultMeaning
RUGEN_RESIM_DATA–Engine data/ folder (with common1.cns / fight.def) for re-simulating disputed matches.
RUGEN_RESIM_MOTIFRUGEN_RESIM_DATAMotif for re-simulation.

Backups

Daily off-site backups to any S3-compatible bucket (AWS S3, Cloudflare R2, MinIO, Backblaze B2, Wasabi). Off unless RUGEN_BACKUP_S3 is set; see Backups for what they contain and how to restore.

VariableDefaultMeaning
RUGEN_BACKUP_S3–The bucket as one URL, s3://ACCESS_KEY:SECRET_KEY@HOST/BUCKET[/prefix][?region=…]. Secret.
RUGEN_BACKUP_RETENTION_DAYS7Days backups are kept: 14, 30, 365… (any whole number ≥ 1). The newest backup is always kept.
RUGEN_BACKUP_INCLUDE–Extras, comma-separated: packages (incremental), signing-key (see the security note).

One-liners:

# Cloudflare R2
RUGEN_BACKUP_S3=s3://ACCESS_KEY_ID:SECRET_ACCESS_KEY@<accountid>.r2.cloudflarestorage.com/rugen-backups?region=auto
# AWS S3
RUGEN_BACKUP_S3=s3://AKIA...:[email protected]/rugen-backups?region=eu-west-1
# MinIO, plain HTTP, objects under a prefix
RUGEN_BACKUP_S3=s3+http://minio:[email protected]:9000/rugen/play-rugen-dev
  • s3:// (or s3+https://) uses HTTPS, s3+http:// plain HTTP.
  • Everything after the bucket is a key prefix (/rugen/play-rugen-dev → bucket rugen, objects under play-rugen-dev/). It may be left out. Either way the server writes only into its own backups/ folder under the prefix (see the bucket layout); chars/ and stages/ next to it are reserved for content uploads later.
  • Surrounding whitespace and one pair of quotes ("…" or '…') around RUGEN_BACKUP_S3 and RUGEN_BACKUP_RETENTION_DAYS are ignored, so a value quoted in an env file still parses.
  • region defaults to auto for R2, the region in AWS / B2 / Wasabi host names, else us-east-1.
  • Path-style addressing by default; add style=virtual (?region=x&style=virtual) for stores that only accept bucket.host.
  • Percent-encode /, +, @, :, ? and % in the access key or secret: / → %2F, + → %2B, @ → %40. AWS secrets often contain / or +.

A backup runs once a day at 03:00 UTC (the time is fixed; there is no interval setting). A bad value is logged at start with the credentials redacted and shown as misconfigured on /health; the server runs anyway.

Admin rate limit

VariableDefaultMeaning
RUGEN_REPLAY_DAYS30Days a shared replay is kept.
RUGEN_REPLAY_MB256Total size of shared replays; the oldest go first above it.
RUGEN_LIVE_MB64Memory for the input logs of live matches (all matches together; 15 minutes per match at most).
RUGEN_RATE_ADMIN30/v1/admin/* calls per client IP per minute.

Compose only

VariableDefaultMeaning
RUGEN_IMAGEghcr.io/rugen-dev/rugen-server:latestImage tag used by the compose file.
RUGEN_HTTP_PORT8080Host port for HTTP.
RUGEN_UDP_PORT7001Host port for the UDP relay.
CF_TUNNEL_TOKEN–Tunnel token, deploy/cloudflared/ only.

Command line flags

The binary also takes a few flags; a flag wins over its environment variable.

rugen-server [--bind 0.0.0.0:8080] [--udp-bind 0.0.0.0:7001|off] [--data /data]
             [--name NAME] [--healthcheck] [--backup out.db]
rugen-server [--data /data] --reset-password <username>
rugen-server [--data /data] --backup-now | --restore <object key|name|latest>
FlagMeaning
--bind addrSame as RUGEN_BIND.
--udp-bind addrSame as RUGEN_UDP_BIND (off, 0, false or none disable UDP).
--data dirSame as RUGEN_DATA.
--name NAMESame as RUGEN_NAME.
--healthcheckProbe GET /health on the local listener and exit 0 / 1 (used by Docker).
--backup out.dbWrite a consistent copy of the database and exit.
--backup-nowUpload one backup to RUGEN_BACKUP_S3 now and exit. Works while the server runs.
--restore whichDownload a backup (latest, a backup name or object key), verify it and swap it in as rugen.db; the old database is kept as rugen.db.<time>.bak. The server must be stopped. See Restore.
--reset-password userSet a temporary password on a named account, log it out on every device, print the password and exit. Works while the server runs. See Password resets.
--help, -hPrint usage.

Something wrong on this page? Edit it on GitHub.

SEARCH !!

    ↑↓ to move, Enter to open