Skip to content

Complete environment examples ​

These examples contain placeholders only. Generate your own keys, use your own database/mail services, and restart the relevant process after configuration changes. Downloads are safe templates copied from source examples, never local preview or production configuration.

Web application ​

Copy web-platform/web/.env.example to .env.local. A standalone launcher reads this file; in EasyPanel/container deployments supply the same variables through the service environment.

Download the full web environment example

ini
# Configuration template only. Copy to .env.local (web) or .env (API / agent).
# Generate your own secrets. AUTH_SECRET and SAMP_AGENT_KEY must be set before use.
# Optional mail, Discord and voice integrations are unconfigured.
AUTH_DISCORD_ID=
AUTH_DISCORD_SECRET=
AUTH_SECRET=
AUTH_URL=http://localhost:3000
CDN_DIR=./cdn
DATABASE_URL=mysql://openrp:CHANGE_ME@127.0.0.1:3306/omprp
DISCORD_BOT_TOKEN=
DISCORD_GUILD_ID=
DISCORD_UCP_ROLE_ID=
LIVEKIT_API_KEY=
LIVEKIT_API_SECRET=
LIVEKIT_URL=
RCON_HOST=127.0.0.1
RCON_PORT=7777
RECAPTCHA_SECRET_KEY=
RECAPTCHA_SITE_KEY=
SAMP_AGENT_KEY=
SAMP_AGENT_URL=http://127.0.0.1:7001
SAMP_MAX_PLAYERS=50
SAMP_QUERY_HOST=127.0.0.1
SMTP_FROM=OpenRP Framework <noreply@example.com>
SMTP_HOST=127.0.0.1
SMTP_PASS=
SMTP_PORT=1025
SMTP_SECURE=false
SMTP_USER=
VOICE_DEV_KEY=

# Enable only after configuring Discord OAuth, bot, guild and role settings.
DISCORD_ENABLED=false

# Also enable FEATURE_CUSTOM_SKINS in the gamemode and restart it.
CUSTOM_SKINS_ENABLED=false

# Optional external voice service. No channels or groups are shipped.
VOICE_ENABLED=false

# Standalone npm start bind address; use a reverse proxy for public HTTPS.
WEB_BIND=127.0.0.1

# Standalone or container web listening port.
PORT=3000

Required and connection settings ​

VariableMeaning
DATABASE_URLMySQL-protocol URL for the shared MariaDB database; percent-encode credential URL characters
AUTH_SECRETUnique long random authentication secret; changing it invalidates web sessions
AUTH_URLActual public web origin, HTTPS in production
WEB_BINDStandalone npm start bind; loopback by default
PORTWeb listening port; 3000 by default
SAMP_AGENT_URLPrivate HTTP origin of the agent
SAMP_AGENT_KEYSecret shared only between web and agent
SAMP_QUERY_HOSTGame query host; use the private game service hostname across containers
RCON_HOSTLegacy/fallback query hostname used when the explicit query host is absent
RCON_PORTGame query/RCON UDP port; match the game port
SAMP_MAX_PLAYERSDisplay capacity fallback; keep aligned with game configuration
CDN_DIRFilesystem root for the web CDN-serving route; distinct from game models/

The Docker runner already sets its internal listening host. WEB_BIND applies to the standalone launcher; it is not a replacement for Docker port publishing or an EasyPanel domain target.

Mail settings ​

VariableMeaning
SMTP_HOSTYour SMTP hostname
SMTP_PORTYour submission port, commonly 587 or 465
SMTP_SECUREtrue for implicit TLS; normally false with STARTTLS on 587
SMTP_USER, SMTP_PASSYour dedicated SMTP credentials
SMTP_FROMAuthorised sender address with optional display name

The loopback 1025 default is a local mail-capture example, not a working production sender. Replace it with your own mail service. No framework-hosted SMTP is supplied.

Optional integrations ​

VariablesUse
DISCORD_ENABLEDKeep false until your Discord setup is complete
AUTH_DISCORD_ID, AUTH_DISCORD_SECRETYour own OAuth application credentials
DISCORD_BOT_TOKEN, DISCORD_GUILD_ID, DISCORD_UCP_ROLE_IDYour own bot, guild and linking role
CUSTOM_SKINS_ENABLEDAlso enable the Pawn flag and configure assets/agent/artwork
VOICE_ENABLEDKeep false without a configured external voice service
LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRETYour LiveKit service and credentials
VOICE_DEV_KEYDevelopment-only voice integration key; leave unset in production
RECAPTCHA_SITE_KEY, RECAPTCHA_SECRET_KEYMatching optional reCAPTCHA key pair

NODE_ENV is managed by the normal development/production scripts or container. Do not expose secrets by renaming them to NEXT_PUBLIC_* variables.

Server agent ​

Copy the agent .env.example to .env in web-platform/samp-agent/. Choose the platform-specific binary/path.

ini
# Configuration template only. Copy to .env.local (web) or .env (API / agent).
# Generate your own secrets. AUTH_SECRET and SAMP_AGENT_KEY must be set before use.
# Optional mail, Discord and voice integrations are unconfigured.
AGENT_PORT=7001
SAMP_AGENT_KEY=
SAMP_BIN=./omp-server
SAMP_DIR=/path/to/openrp-framework
SAMP_HOST=127.0.0.1
SAMP_PORT=7777
SAMP_RCON_PASSWORD=
# Windows: SAMP_DIR=F:/path/to/openrp-framework and SAMP_BIN=./omp-server.exe

# Keep loopback for standalone use; use 0.0.0.0 only on a private container network.
AGENT_BIND=127.0.0.1
ini
# Configuration template only. Copy to .env.local (web) or .env (API / agent).
# Generate your own secrets. AUTH_SECRET and SAMP_AGENT_KEY must be set before use.
# Optional mail, Discord and voice integrations are unconfigured.
AGENT_PORT=7001
SAMP_AGENT_KEY=
SAMP_BIN=./omp-server.exe
SAMP_DIR=F:/Servers/OpenRP-Framework
SAMP_HOST=127.0.0.1
SAMP_PORT=7777
SAMP_RCON_PASSWORD=
# Windows: SAMP_DIR=F:/path/to/openrp-framework and SAMP_BIN=./omp-server.exe

# Keep loopback for standalone use; use 0.0.0.0 only on a private container network.
AGENT_BIND=127.0.0.1

Download Linux agent example · Download Windows agent example

VariableMeaning
AGENT_BIND127.0.0.1 standalone; 0.0.0.0 only when intentionally private-networked
AGENT_PORTAgent HTTP port, 7001 by default
SAMP_AGENT_KEYRequired generated key; must match web
SAMP_DIRAbsolute game root containing runtime, models, scriptfiles and log.txt
SAMP_BIN./omp-server.exe on Windows or ./omp-server on Linux
SAMP_HOST, SAMP_PORTAddress/UDP port for game RCON communication
SAMP_RCON_PASSWORDOptional configured game RCON password; enable/match engine RCON if used

The agent does not configure the game’s database or compile-time Pawn secrets from this .env.

Gamemode/server configuration ​

The gamemode does not automatically load a .env file. Supply these actual files instead:

Copy fromLocal filenameContents
config.example.jsonconfig.jsonopen.mp engine settings
mysql.example.inimysql.iniGame MySQL connection
gamemodes/config/secrets.example.pwngamemodes/config/secrets.pwnCompiled local script secrets

Download engine config · Download MySQL config · Download Pawn secrets template

MySQL example ​

ini
hostname = 127.0.0.1
username = openrp
password = CHANGE_ME
database = omprp
auto_reconnect = true

Pawn secrets example ​

text
// ---------------------------------------------------------------------------
// Local configuration + secrets.
//
// Copy this file to config/secrets.pwn (gitignored) and fill it in.
// The gamemode will not compile without it.
// ---------------------------------------------------------------------------

// Password used by the built-in server-side password check (change it!).
#define SERVER_PASSWORD "change-me"

// ---- Discord (optional, disabled by default) ------------------------------
// Uncomment to compile the Discord integration in. Requires the discord-connector
// plugin and a `discord_bot_token` option in your server config.
//#define DISCORD_ENABLED
//
// To post to Discord channels or ping roles, #define the DISCORD_CHANNEL_* and
// DISCORD_ROLE_* values here (the list of names is in discord/header.pwn).
// Any channel left undefined is simply skipped.

Full open.mp configuration example ​

json
{
    "announce": false,
    "artwork": {
        "cdn": "",
        "enable": true,
        "models_path": "models",
        "port": 7777,
        "web_server_bind": ""
    },
    "banners": {
        "dark": "",
        "light": ""
    },
    "logo": "",
    "discord": {
        "invite": ""
    },
    "chat_input_filter": true,
    "enable_query": true,
    "game": {
        "allow_interior_weapons": true,
        "chat_radius": 200,
        "death_drop_amount": 0,
        "gravity": 0.00800000037997961,
        "group_player_objects": false,
        "lag_compensation_mode": 1,
        "map": "San Andreas",
        "mode": "OpenRP Framework",
        "nametag_draw_radius": 70,
        "player_marker_draw_radius": 250,
        "player_marker_mode": 1,
        "time": 12,
        "use_all_animations": true,
        "use_chat_radius": false,
        "use_entry_exit_markers": true,
        "use_instagib": false,
        "use_manual_engine_and_lights": false,
        "use_nametag_los": true,
        "use_nametags": true,
        "use_player_marker_draw_radius": false,
        "use_player_ped_anims": false,
        "use_stunt_bonuses": true,
        "use_vehicle_friendly_fire": false,
        "use_zone_names": false,
        "validate_animations": true,
        "vehicle_respawn_time": 10000,
        "weather": 10
    },
    "language": "English",
    "logging": {
        "enable": true,
        "file": "log.txt",
        "log_chat": true,
        "log_connection_messages": true,
        "log_cookies": false,
        "log_deaths": true,
        "log_queries": false,
        "log_sqlite": false,
        "log_sqlite_queries": false,
        "timestamp_format": "[%H:%M:%S]",
        "use_prefix": true,
        "use_timestamp": true
    },
    "max_bots": 0,
    "max_players": 50,
    "name": "OpenRP Framework",
    "network": {
        "acks_limit": 8000,
        "aiming_sync_rate": 30,
        "allow_037_clients": true,
        "bind": "",
        "cookie_reseed_time": 300000,
        "grace_period": 5000,
        "http_threads": 150,
        "in_vehicle_sync_rate": 30,
        "limits_ban_time": 60000,
        "message_hole_limit": 3000,
        "messages_limit": 750,
        "minimum_connection_time": 0,
        "minimum_send_bits_per_second": 96000,
        "mtu": 576,
        "multiplier": 10,
        "on_foot_sync_rate": 30,
        "player_marker_sync_rate": 2500,
        "player_timeout": 10000,
        "port": 7777,
        "public_addr": "",
        "stream_radius": 300,
        "stream_rate": 1000,
        "time_sync_rate": 30000,
        "use_lan_mode": false,
        "use_omp_encryption": false
    },
    "npc": {
        "aim_sync_skip_update_limit": 15,
        "aiming_sync_rate": 30,
        "in_vehicle_sync_rate": 30,
        "in_vehicle_sync_skip_update_limit": 15,
        "on_foot_sync_rate": 30,
        "on_foot_sync_skip_update_limit": 15,
        "process_update_rate": 50
    },
    "pawn": {
        "legacy_plugins": [
            "ColAndreas",
            "crashdetect",
            "samp_bcrypt",
            "streamer",
            "fsutil",
            "pawnregex",
            "mysql"
        ],
        "main_scripts": [
            "gamemode 1"
        ],
        "side_scripts": []
    },
    "rcon": {
        "allow_teleport": false,
        "enable": false,
        "password": "CHANGE_ME"
    },
    "sleep": 5,
    "use_dyn_ticks": true,
    "website": "https://example.com"
}

Set branding/features/coordinates in their source modules and recompile. An MYSQL_PASSWORD environment variable will not replace mysql.ini unless you build an explicit configuration-generation step yourself.

Optional API scaffold ​

Copy web-platform/api/.env.example to .env. This API is optional and separate from the agent.

Download API environment example

ini
# API scaffold configuration. Copy to .env.
PORT=3001
WEB_URL=http://localhost:3000

PORT is its listening port; WEB_URL configures the allowed web CORS origin. CORS is not endpoint authentication.

Generate secrets ​

sh
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Generate separate values for different purposes. Keep local configured files, mail credentials, tokens and databases out of source commits and website screenshots.

Open-source roleplay foundations for open.mp. Bring your own world.