Environment variables
This page lists every environment variable that MoorCP Shared reads: the control plane (MOORCP_*), the agent (MOORCP_AGENT_*), and moorctl (MOORCTL_*). It is written for admins who want to change panel behavior outside the GUI.
How to change them
| Component | File | After a change |
|---|---|---|
| Control plane | /etc/moorcp-shared/env | systemctl restart moorcp-shared |
| Agent | /etc/moorcp-agent/env | systemctl restart moorcp-agent |
File format: one NAME=value per line, without export. Lines that start with # are ignored.
systemctl restart moorcp-sharedWARNING
Invalid numeric values (letters, negative numbers, out of range) are silently ignored and the default is used. Check the result after a restart. Some wrong values (CIDRs, certificate pairs, the DNS driver) make the panel refuse to start. See journalctl -u moorcp-shared.
The Installer column shows the value that the panel installer writes to the env file. Empty means the variable is not written and the default in the code is used. Variables marked secret, generated by the installer get a random value at install time and exist only on that server.
Control plane
Addresses and origins
| Variable | Default | Installer | Purpose |
|---|---|---|---|
MOORCP_LISTEN | :8443 | 0.0.0.0:8443 | Address of the admin panel, API, and agent endpoints |
MOORCP_PUBLIC_URL | empty | https://<hostname>:8443 | Base URL for absolute links (email, SSO, downloads). Empty = relative links |
MOORCP_CLIENT_LISTEN | empty | 0.0.0.0:2083 | Client panel address. Empty = the client panel is not served on its own origin. Requires TLS |
MOORCP_CLIENT_PUBLIC_URL | empty | https://<hostname>:2083 | Public URL of the client panel |
MOORCP_APPS_LISTEN | empty | 0.0.0.0:2085 | Origin for third-party app UIs (Softaculous). Empty = off |
MOORCP_APPS_PUBLIC_URL | empty | https://<hostname>:2085 | Public URL of the apps origin |
MOORCP_APPS_ADMIN_LISTEN | empty | 0.0.0.0:2086 | Origin for vendor admin UIs (Softaculous admin, CloudLinux Manager). Empty = shares the apps origin |
MOORCP_APPS_ADMIN_PUBLIC_URL | empty | https://<hostname>:2086 | Public URL of the vendor admin origin |
TIP
When the panel hostname changes, change every *_PUBLIC_URL at once, then issue a new TLS certificate for the new hostname.
TLS, PKI, and files
| Variable | Default | Installer | Purpose |
|---|---|---|---|
MOORCP_TLS_CERT | empty | /etc/moorcp-shared/tls/fullchain.pem | The panel's public certificate (full chain) |
MOORCP_TLS_KEY | empty | /etc/moorcp-shared/tls/privkey.pem | Private key of the public certificate. Must be set together with MOORCP_TLS_CERT |
MOORCP_PKI_DIR | /etc/moorcp-shared/pki | /etc/moorcp-shared/pki | Directory of the internal CA for agent mTLS |
MOORCP_ADMIN_UI_DIR | empty | /usr/share/moorcp-shared/admin | Admin and client panel files. Empty = the GUI is not served (API only) |
MOORCP_DOWNLOADS_DIR | /usr/share/moorcp-shared/downloads | same | install-agent.sh and the agent binaries for new servers |
INFO
Without MOORCP_TLS_CERT and MOORCP_TLS_KEY, the panel runs plain HTTP (for use behind a reverse proxy). In that mode the agent mTLS heartbeat cannot be verified and the client panel is not started on its own origin.
Database and secrets
| Variable | Default | Installer | Purpose |
|---|---|---|---|
MOORCP_DATABASE_URL | empty | secret, generated by the installer | Panel PostgreSQL URL, e.g. postgres://moorcp:PASSWORD@127.0.0.1:5432/moorcp?sslmode=disable. Empty = in-memory storage, data is lost on restart (testing only) |
MOORCP_ADMIN_API_KEY | empty (required) | secret, generated by the installer | Bootstrap API key with the admin role. For initial provisioning and emergency access. The panel refuses to start if it is empty |
MOORCP_SIGNING_KEY | random per process | secret, generated by the installer | Signing key for short-lived download links, and the source of the secrets master key when MOORCP_SECRETS_KEY is empty. If it is empty, links stop working after a restart |
MOORCP_SECRETS_KEY | derived from MOORCP_SIGNING_KEY | Master key for encrypting stored secrets (TOTP secrets, SMTP passwords, backup destination credentials, and more) | |
MOORCP_SECRETS_KEY_PREVIOUS | empty | The old master key. Set only while rotating the master key | |
MOORCP_SECRETS_ROTATE_DAYS | 90 | Data key age before automatic rotation, 0–3650 days. 0 = off |
DANGER
Do not simply change MOORCP_SIGNING_KEY or MOORCP_SECRETS_KEY. Secrets that are already stored can no longer be decrypted. Follow the master key rotation steps below.
Master key rotation:
Create a new key:
bashopenssl rand -hex 32In
/etc/moorcp-shared/env, setMOORCP_SECRETS_KEY_PREVIOUSto the old master key. IfMOORCP_SECRETS_KEYwas empty before, use the value ofMOORCP_SIGNING_KEY. SetMOORCP_SECRETS_KEYto the new key.Restart the panel. On start, the data keys are opened with the old key and rewrapped with the new key.
Run
moorcp-shared secrets status(see CLI) and make sure everykekIdmatches the activekekId.Remove
MOORCP_SECRETS_KEY_PREVIOUS, then restart again.
Staff, sessions, and API
| Variable | Default | Purpose |
|---|---|---|
MOORCP_ADMIN_ALLOWED_CIDRS | empty (all) | Comma-separated CIDRs or IPs allowed to open the admin GUI and log in as staff. An IP without a prefix is treated as /32 or /128. API keys are not affected. An invalid CIDR makes the panel refuse to start |
MOORCP_ADMIN_REQUIRE_2FA | false | true or 1: staff must turn on 2FA before they can use the panel |
MOORCP_SESSION_HOURS | 12 | Absolute lifetime of a staff session, 1–168 hours |
MOORCP_INSECURE_COOKIES | empty | 1 turns off the Secure flag on session cookies. Only for development over HTTP |
MOORCP_API_RATE_PER_KEY | 3000 | Request limit per minute per API key. 0 = unlimited |
MOORCP_API_RATE_PER_ACCOUNT | 300 | Request limit per minute per account touched by billing credentials. 0 = unlimited |
Accounts, websites, and jobs
| Variable | Default | Purpose |
|---|---|---|
MOORCP_TERMINATE_GRACE_DAYS | 14 | Grace period for data after an account is terminated, before permanent deletion |
MOORCP_SWEEP_SECONDS | 3600 | Interval of the sweeper that deletes accounts whose grace period has ended |
MOORCP_DOWNLOAD_LINK_SECONDS | 600 | Lifetime of signed download links |
MOORCP_ACME_EMAIL | empty | Contact email for the Let's Encrypt account used for website certificates |
Monitoring and alerts
| Variable | Default | Purpose |
|---|---|---|
MOORCP_USAGE_INTERVAL_SECONDS | 300 | Interval between account usage samples. Minimum 30 |
MOORCP_USAGE_RETENTION_DAYS | 14 | Age of usage samples, 1–400 days |
MOORCP_ALERT_STALE_SECONDS | 180 | Time without a heartbeat before a server counts as not reporting. Minimum 60 |
MOORCP_ALERT_REPEAT_HOURS | 6 | Interval of reminders for critical alerts that are not acknowledged |
MOORCP_MALWARE_SCAN_HOURS | 24 | Interval of scheduled malware scans per account. 0 = off. Only used until the schedule is saved in the panel (Security › Malware Report); after that the panel setting applies |
MOORCP_RBL_RESOLVER | system resolver | Recursive resolver host:port for IP blacklist checks (DNSBL). Spamhaus refuses queries through public resolvers such as 1.1.1.1 and 8.8.8.8 |
DNS (PowerDNS)
The main way to turn on DNS is the GUI: Domains & DNS › Nameserver nodes. Nodes, default nameservers, and cPanel DNSOnly replicas are stored in the panel database, so they need none of the variables below. See Domains and DNS.
The variables MOORCP_DNS_DRIVER, MOORCP_PDNS_*, and MOORCP_DNS_NAMESERVERS are the older way to configure DNS through env, and they are still supported. While MOORCP_DNS_DRIVER=lokal is active, nodes from the panel are not used and the nodes page shows a notice. To move to panel nodes, remove the MOORCP_DNS_DRIVER line from the env file and restart the panel.
| Variable | Default | Purpose |
|---|---|---|
MOORCP_DNS_DRIVER | empty | lokal to manage zones in a PowerDNS configured through env. Empty = DNS is managed through nameserver nodes in the panel (off while there are no nodes). Any value other than empty or none makes the panel refuse to start |
MOORCP_PDNS_URL | http://127.0.0.1:8081 | API URL of the primary PowerDNS |
MOORCP_PDNS_API_KEY | empty | Secret. PowerDNS API key. Required with the lokal driver |
MOORCP_DNS_NAMESERVERS | empty | Comma-separated default nameservers, e.g. ns1.example.com,ns2.example.com. Required with the lokal driver. If they are already set in the GUI, the GUI value is used |
MOORCP_DNS_CAA_ISSUER | letsencrypt.org | Issuer for the CAA record in zone templates |
MOORCP_PDNS_QUERY_ADDR | <host of MOORCP_PDNS_URL>:53 | DNS address of the primary, used to check TXT propagation for wildcard SSL (DNS-01). off = not checked |
MOORCP_PDNS_REPLICAS | empty | Other PowerDNS nodes replicated through the API, separated by ;. Format of each entry: name|url|api-key|query-addr (query-addr optional) |
MOORCP_DNS_SYNC_SECONDS | 600 | Interval of the DNS cluster sync, the nameserver reconciliation of all zones, and saving zone copies. Applies to panel nodes and to env configuration |
MOORCP_DNS_RESOLVERS | public resolvers | Comma-separated host:port resolvers for monitoring propagation during a migration cutover |
Example of a two-node cluster through env (the older way):
MOORCP_DNS_DRIVER=lokal
MOORCP_PDNS_URL=http://10.0.0.11:8081
MOORCP_PDNS_API_KEY=API_KEY
MOORCP_DNS_NAMESERVERS=ns1.example.com,ns2.example.com
MOORCP_PDNS_REPLICAS="ns2|http://10.0.0.12:8081|API_KEY_NS2|10.0.0.12:53"Backup
| Variable | Default | Purpose |
|---|---|---|
MOORCP_BACKUP_DESTINATIONS | empty | Path of a JSON file of backup destinations, e.g. /etc/moorcp-shared/backup-destinations.json. Destinations from this file are read-only in the GUI. Destinations created in the GUI do not need this variable |
MOORCP_BACKUP_SCHEDULER_SECONDS | 30 | Interval at which the backup scheduler checks for due policies |
License and updates
| Variable | Default | Purpose |
|---|---|---|
MOORCP_LICENSE_URL | https://license.moorcp.com | License server for activation, trials, and automatic token renewal. off or an empty value = offline: install tokens by hand, without automatic renewal |
MOORCP_UPDATE_CHECK | empty | off turns off the check for new MoorCP releases. When it is on, the panel checks the release index one minute after start and then every 30 minutes, and refuses an index without a valid signature |
MOORCP_UPDATE_CHANNEL | from /etc/moorcp-shared/release, then stable | Channel to check (stable or rc) |
MOORCP_RELEASES_URL | from /etc/moorcp-shared/release, then https://releases-shared.moorcp.com | Release mirror. The installer also reads it in place of --releases-url |
CLI only
| Variable | Purpose |
|---|---|
MOORCP_STAFF_PASSWORD | Password for moorcp-shared staff create and staff passwd. If it is empty, the password is read from the first line of stdin |
MOORCP_LANG | id makes terminal commands of moorcp-shared and moorcp-agent (everything except serve, including the diagnostic commands mail, app, and website check) print Indonesian. Default: English |
MOORCP_NO_RESUME | 1 when running the hosting server installer stops it from setting up moorcp-install-resume.service. After the disk-quota reboot you then run the same installer command again yourself |
Agent
Every agent variable is optional. The /etc/moorcp-agent/env file may be empty. The installer only writes MOORCP_AGENT_LISTEN when the agent port is not 7443.
Basics
| Variable | Default | Purpose |
|---|---|---|
MOORCP_AGENT_LISTEN | :7443 | Agent mTLS listen address. This port is also protected: it cannot be closed from the Firewall ports tab |
MOORCP_AGENT_STATE_DIR | /var/lib/moorcp-agent | Directory of the agent keys, certificates, and identity |
MOORCP_AGENT_HEARTBEAT_SECONDS | 30 | Interval of the heartbeat to the panel |
MOORCP_AGENT_HOME_ROOT | /home | Parent of the account homes, used by the Trash cleaner |
MOORCP_AGENT_TRASH_DAYS | 7 | Age of File Manager Trash entries before automatic deletion |
Component selection
By default the agent detects components from the installed binaries. The following variables override that detection.
| Variable | Default | Purpose |
|---|---|---|
MOORCP_AGENT_DRIVER | detected: cloudlinux if LVE and CageFS exist, otherwise generic | Account isolation driver |
MOORCP_AGENT_WEBSERVER | detected: nginx + httpd = nginx-proxy, httpd only = apache, nginx only = nginx | Fallback web server mode if no switch has ever been made. The mode from a switch in /etc/moorcp/webserver-mode always takes precedence |
MOORCP_AGENT_MAIL | on if Postfix and Dovecot are installed | off turns off email features on this server |
MOORCP_AGENT_BACKUP | on if restic is installed | on forces the backup feature on |
MOORCP_AGENT_MYSQL_SOCKET | /var/lib/mysql/mysql.sock | Local MariaDB socket |
MOORCP_AGENT_DB_PROFILE | /etc/moorcp-agent/db-profile.json | The server's database profile file (local or external) |
SSL (ACME)
| Variable | Default | Purpose |
|---|---|---|
MOORCP_AGENT_ACME_EMAIL | empty | Let's Encrypt contact email for automatic renewal on the agent |
MOORCP_AGENT_ACME_DIRECTORY | Let's Encrypt production | URL of another ACME directory |
MOORCP_AGENT_ACME_CA_FILE | empty | Extra CA file for an internal ACME server |
MOORCP_AGENT_ACME_DNS01 | on | off turns off wildcard SSL (DNS-01) through the panel |
Apps and helpers
| Variable | Default | Purpose |
|---|---|---|
MOORCP_SOFTACULOUS_PHP | /usr/bin/php-cgi | PHP binary that runs Softaculous |
MOORCP_SOFTACULOUS_DIR | /usr/local/softaculous | Softaculous install directory, also the target of an install from the panel |
MOORCP_SOFTACULOUS_EMAIL | root@localhost | Admin and notification sender email for Softaculous |
MOORCP_AGENT_HELPER_EXE | the agent binary itself | Path of the helper binary that runs as the account user (cron, File Manager). Must be readable by the account user |
moorctl
| Variable | Purpose |
|---|---|
MOORCTL_URL | Panel URL, e.g. https://panel.example.com:8443 |
MOORCTL_API_KEY | API key for calling API v1 |
