Skip to content

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 ​

ComponentFileAfter a change
Control plane/etc/moorcp-shared/envsystemctl restart moorcp-shared
Agent/etc/moorcp-agent/envsystemctl restart moorcp-agent

File format: one NAME=value per line, without export. Lines that start with # are ignored.

bash
systemctl restart moorcp-shared

WARNING

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 ​

VariableDefaultInstallerPurpose
MOORCP_LISTEN:84430.0.0.0:8443Address of the admin panel, API, and agent endpoints
MOORCP_PUBLIC_URLemptyhttps://<hostname>:8443Base URL for absolute links (email, SSO, downloads). Empty = relative links
MOORCP_CLIENT_LISTENempty0.0.0.0:2083Client panel address. Empty = the client panel is not served on its own origin. Requires TLS
MOORCP_CLIENT_PUBLIC_URLemptyhttps://<hostname>:2083Public URL of the client panel
MOORCP_APPS_LISTENempty0.0.0.0:2085Origin for third-party app UIs (Softaculous). Empty = off
MOORCP_APPS_PUBLIC_URLemptyhttps://<hostname>:2085Public URL of the apps origin
MOORCP_APPS_ADMIN_LISTENempty0.0.0.0:2086Origin for vendor admin UIs (Softaculous admin, CloudLinux Manager). Empty = shares the apps origin
MOORCP_APPS_ADMIN_PUBLIC_URLemptyhttps://<hostname>:2086Public 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 ​

VariableDefaultInstallerPurpose
MOORCP_TLS_CERTempty/etc/moorcp-shared/tls/fullchain.pemThe panel's public certificate (full chain)
MOORCP_TLS_KEYempty/etc/moorcp-shared/tls/privkey.pemPrivate key of the public certificate. Must be set together with MOORCP_TLS_CERT
MOORCP_PKI_DIR/etc/moorcp-shared/pki/etc/moorcp-shared/pkiDirectory of the internal CA for agent mTLS
MOORCP_ADMIN_UI_DIRempty/usr/share/moorcp-shared/adminAdmin and client panel files. Empty = the GUI is not served (API only)
MOORCP_DOWNLOADS_DIR/usr/share/moorcp-shared/downloadssameinstall-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 ​

VariableDefaultInstallerPurpose
MOORCP_DATABASE_URLemptysecret, generated by the installerPanel 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_KEYempty (required)secret, generated by the installerBootstrap API key with the admin role. For initial provisioning and emergency access. The panel refuses to start if it is empty
MOORCP_SIGNING_KEYrandom per processsecret, generated by the installerSigning 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_KEYderived from MOORCP_SIGNING_KEYMaster key for encrypting stored secrets (TOTP secrets, SMTP passwords, backup destination credentials, and more)
MOORCP_SECRETS_KEY_PREVIOUSemptyThe old master key. Set only while rotating the master key
MOORCP_SECRETS_ROTATE_DAYS90Data 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:

  1. Create a new key:

    bash
    openssl rand -hex 32
  2. In /etc/moorcp-shared/env, set MOORCP_SECRETS_KEY_PREVIOUS to the old master key. If MOORCP_SECRETS_KEY was empty before, use the value of MOORCP_SIGNING_KEY. Set MOORCP_SECRETS_KEY to the new key.

  3. Restart the panel. On start, the data keys are opened with the old key and rewrapped with the new key.

  4. Run moorcp-shared secrets status (see CLI) and make sure every kekId matches the active kekId.

  5. Remove MOORCP_SECRETS_KEY_PREVIOUS, then restart again.

Staff, sessions, and API ​

VariableDefaultPurpose
MOORCP_ADMIN_ALLOWED_CIDRSempty (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_2FAfalsetrue or 1: staff must turn on 2FA before they can use the panel
MOORCP_SESSION_HOURS12Absolute lifetime of a staff session, 1–168 hours
MOORCP_INSECURE_COOKIESempty1 turns off the Secure flag on session cookies. Only for development over HTTP
MOORCP_API_RATE_PER_KEY3000Request limit per minute per API key. 0 = unlimited
MOORCP_API_RATE_PER_ACCOUNT300Request limit per minute per account touched by billing credentials. 0 = unlimited

Accounts, websites, and jobs ​

VariableDefaultPurpose
MOORCP_TERMINATE_GRACE_DAYS14Grace period for data after an account is terminated, before permanent deletion
MOORCP_SWEEP_SECONDS3600Interval of the sweeper that deletes accounts whose grace period has ended
MOORCP_DOWNLOAD_LINK_SECONDS600Lifetime of signed download links
MOORCP_ACME_EMAILemptyContact email for the Let's Encrypt account used for website certificates

Monitoring and alerts ​

VariableDefaultPurpose
MOORCP_USAGE_INTERVAL_SECONDS300Interval between account usage samples. Minimum 30
MOORCP_USAGE_RETENTION_DAYS14Age of usage samples, 1–400 days
MOORCP_ALERT_STALE_SECONDS180Time without a heartbeat before a server counts as not reporting. Minimum 60
MOORCP_ALERT_REPEAT_HOURS6Interval of reminders for critical alerts that are not acknowledged
MOORCP_MALWARE_SCAN_HOURS24Interval 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_RESOLVERsystem resolverRecursive 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.

VariableDefaultPurpose
MOORCP_DNS_DRIVERemptylokal 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_URLhttp://127.0.0.1:8081API URL of the primary PowerDNS
MOORCP_PDNS_API_KEYemptySecret. PowerDNS API key. Required with the lokal driver
MOORCP_DNS_NAMESERVERSemptyComma-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_ISSUERletsencrypt.orgIssuer for the CAA record in zone templates
MOORCP_PDNS_QUERY_ADDR<host of MOORCP_PDNS_URL>:53DNS address of the primary, used to check TXT propagation for wildcard SSL (DNS-01). off = not checked
MOORCP_PDNS_REPLICASemptyOther PowerDNS nodes replicated through the API, separated by ;. Format of each entry: name|url|api-key|query-addr (query-addr optional)
MOORCP_DNS_SYNC_SECONDS600Interval 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_RESOLVERSpublic resolversComma-separated host:port resolvers for monitoring propagation during a migration cutover

Example of a two-node cluster through env (the older way):

bash
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 ​

VariableDefaultPurpose
MOORCP_BACKUP_DESTINATIONSemptyPath 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_SECONDS30Interval at which the backup scheduler checks for due policies

License and updates ​

VariableDefaultPurpose
MOORCP_LICENSE_URLhttps://license.moorcp.comLicense server for activation, trials, and automatic token renewal. off or an empty value = offline: install tokens by hand, without automatic renewal
MOORCP_UPDATE_CHECKemptyoff 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_CHANNELfrom /etc/moorcp-shared/release, then stableChannel to check (stable or rc)
MOORCP_RELEASES_URLfrom /etc/moorcp-shared/release, then https://releases-shared.moorcp.comRelease mirror. The installer also reads it in place of --releases-url

CLI only ​

VariablePurpose
MOORCP_STAFF_PASSWORDPassword for moorcp-shared staff create and staff passwd. If it is empty, the password is read from the first line of stdin
MOORCP_LANGid 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_RESUME1 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 ​

VariableDefaultPurpose
MOORCP_AGENT_LISTEN:7443Agent mTLS listen address. This port is also protected: it cannot be closed from the Firewall ports tab
MOORCP_AGENT_STATE_DIR/var/lib/moorcp-agentDirectory of the agent keys, certificates, and identity
MOORCP_AGENT_HEARTBEAT_SECONDS30Interval of the heartbeat to the panel
MOORCP_AGENT_HOME_ROOT/homeParent of the account homes, used by the Trash cleaner
MOORCP_AGENT_TRASH_DAYS7Age 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.

VariableDefaultPurpose
MOORCP_AGENT_DRIVERdetected: cloudlinux if LVE and CageFS exist, otherwise genericAccount isolation driver
MOORCP_AGENT_WEBSERVERdetected: nginx + httpd = nginx-proxy, httpd only = apache, nginx only = nginxFallback 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_MAILon if Postfix and Dovecot are installedoff turns off email features on this server
MOORCP_AGENT_BACKUPon if restic is installedon forces the backup feature on
MOORCP_AGENT_MYSQL_SOCKET/var/lib/mysql/mysql.sockLocal MariaDB socket
MOORCP_AGENT_DB_PROFILE/etc/moorcp-agent/db-profile.jsonThe server's database profile file (local or external)

SSL (ACME) ​

VariableDefaultPurpose
MOORCP_AGENT_ACME_EMAILemptyLet's Encrypt contact email for automatic renewal on the agent
MOORCP_AGENT_ACME_DIRECTORYLet's Encrypt productionURL of another ACME directory
MOORCP_AGENT_ACME_CA_FILEemptyExtra CA file for an internal ACME server
MOORCP_AGENT_ACME_DNS01onoff turns off wildcard SSL (DNS-01) through the panel

Apps and helpers ​

VariableDefaultPurpose
MOORCP_SOFTACULOUS_PHP/usr/bin/php-cgiPHP binary that runs Softaculous
MOORCP_SOFTACULOUS_DIR/usr/local/softaculousSoftaculous install directory, also the target of an install from the panel
MOORCP_SOFTACULOUS_EMAILroot@localhostAdmin and notification sender email for Softaculous
MOORCP_AGENT_HELPER_EXEthe agent binary itselfPath of the helper binary that runs as the account user (cron, File Manager). Must be readable by the account user

moorctl ​

VariablePurpose
MOORCTL_URLPanel URL, e.g. https://panel.example.com:8443
MOORCTL_API_KEYAPI key for calling API v1

See also ​

MoorCP Shared, a shared hosting panel for server fleets.