Architecture
This page explains the components of MoorCP Shared, how the panel talks to hosting servers, the ports in use, and the isolation drivers and web server modes. Read it before you design your server topology.
Overview
MoorCP Shared consists of one control plane (the panel) and one agent on each hosting server. Staff, clients, and billing only talk to the control plane. The control plane sends commands to the agents over mTLS.
┌──────────────────────────────────────┐
staff ─────────▶│ moorcp-shared (control plane) │◀── billing (API v1)
client ────────▶│ :8443 admin + API · :2083 client │
│ :2085 apps · PostgreSQL · jobs │
└──────────────────┬───────────────────┘
│ mTLS (internal CA)
┌────────────────────┼────────────────────┐
▼ ▼ ▼
moorcp-agent moorcp-agent moorcp-agent
hosting server 1 hosting server 2 hosting server NThe panel and a hosting server can share one machine (all-in-one) or run separately. For production with many servers, keep the panel apart from the hosting servers.
The agent is also used on DNS-only servers: small VPSes that only run the agent and PowerDNS as nameservers, without the hosting stack. See DNS and nameserver nodes.
Components
| Binary | Runs on | Role |
|---|---|---|
moorcp-shared | Panel server | Control plane: REST API v1, admin and client panels, job worker, audit, PostgreSQL database |
moorcp-agent | Every hosting server and DNS-only server | Runs allowlisted operations from the panel over mTLS, picks the isolation driver, writes web server configuration, and manages PowerDNS on nameserver nodes |
moorctl | Panel server (or an admin's computer) | Admin CLI and API test client |
Control plane (moorcp-shared)
- Stores all data (servers, packages, accounts, websites, jobs, audit) in a local PostgreSQL 16 database. This database is not exposed to the network.
- Serves the admin panel, the client panel, and API v1.
- Runs long operations as jobs in the job worker and records every action in the audit log.
- Runs as the systemd service
moorcp-sharedunder the system usermoorcp. - Checks for new releases every 30 minutes and verifies the signature of the release list with the same key the installer uses.
- Cannot replace itself, because it runs without root privileges. When an admin clicks Upgrade, the panel only writes a request. The root unit
moorcp-shared-upgrade.paththen runsmoorcp-shared self-upgrade, which verifies the release and runs the installer in upgrade mode. See Upgrading.
Agent (moorcp-agent)
- A single binary that runs as the systemd service
moorcp-agenton every hosting server and DNS-only server. - Only runs operations from an allowlist, with names such as
account.createorssl.issue. The panel cannot send free-form shell commands. - Sends a heartbeat to the panel every 30 seconds: load, CPU, RAM, swap, disk, inodes, network, uptime, and service status.
- Sites and email keep running even if the agent or the panel is down. Only management from the panel stops.
Panel and agent communication
The panel has its own internal CA (created by the installer in /etc/moorcp-shared/pki). Every agent certificate is signed by this CA.
- An admin creates a single-use registration token in the panel. The token is valid for 30 minutes.
- The agent installer uses that token to enroll. The agent creates its own private key, and the panel signs its certificate. The name in the certificate is set by the panel and matches the server hostname.
- From then on:
- panel to agent uses mTLS with TLS 1.3 on the agent port (default
7443). The agent only accepts the panel's certificate, and every command has an expiry time (24 hours at most); - agent to panel (heartbeat, certificate renewal) uses port
8443with the agent certificate.
- panel to agent uses mTLS with TLS 1.3 on the agent port (default
Agent certificates are renewed automatically without a restart.
INFO
Because the panel verifies the agent by its certificate name, the agent address can be a private IP, behind NAT, or loopback. The panel only needs to reach the hosting server on the agent port.
WARNING
The internal CA and /etc/moorcp-shared/env contain secrets. If they are lost, the panel can no longer trust its agents. Back up both, or enable Panel backup.
DNS and nameserver nodes
You enable DNS from the panel in Domains & DNS › Nameserver nodes. Each node is a MoorCP server (a hosting server or a DNS-only server) that runs PowerDNS Authoritative with its own zone database.
panel ──mTLS (agent)──▶ node 1 (primary) ── PowerDNS, copy of all zones
──mTLS (agent)──▶ node 2 (replica) ── PowerDNS, copy of all zones
──WHM API token─▶ cPanel DNSOnly (replica, optional)| Data | Stored in |
|---|---|
| All records of every zone | Every node (primary and replicas) |
| Zone ownership, templates, node list, nameservers | Panel PostgreSQL |
| BIND copy of every zone | Panel PostgreSQL, included in the panel backup |
- The first node is the primary; later nodes are replicas. Changes go to the primary first, then to every replica. A replica that was down is brought up to date by the next sync (every 10 minutes by default).
- The panel never calls the PowerDNS API directly. The PowerDNS API only listens on
127.0.0.1on the node. Every request goes through the agent's mTLS connection, and the API key stays on the node. - Zone copies in the panel. On every sync, the panel stores a BIND export of every zone that changed. A zone missing from the primary is rebuilt from this copy, including the records clients created.
- cPanel DNSOnly replicas. An existing cPanel DNSOnly server can be added as a replica through a WHM API token. MoorCP only writes its own zones there, and the primary is always a MoorCP node.
- DNS-only servers are not used for hosting accounts. Account placement refuses them with the reason "DNS-only server".
See Domains and DNS and Adding a hosting server.
Ports
Panel server:
| Port | Service | Open to |
|---|---|---|
8443 | Admin panel, API v1, agent enrollment and heartbeat | Staff, billing, all hosting servers |
2083 | Client panel | Account owners |
2085 | App origin (client Softaculous UI) | Account owners |
2086 | Admin app origin (Softaculous admin, CloudLinux Manager, Rspamd web UI) | Staff |
80 | Let's Encrypt validation for the panel certificate | Internet |
5432 | Panel PostgreSQL | Local only (127.0.0.1) |
Hosting server:
| Port | Service |
|---|---|
7443 | Agent mTLS (change it with --listen); only needs to be open to the panel |
80, 443 | Websites |
25, 465, 587 | SMTP (login only on 465 and 587) |
143, 993, 110, 995 | IMAP and POP3 |
21 | FTP |
53 (TCP and UDP) | DNS, only if this server is a nameserver node |
DNS-only server: 53 (TCP and UDP) for DNS and 7443 for the agent.
The installer opens these ports in firewalld when firewalld is active. The full list is in Ports and services.
Jobs
Operations that take time or touch a server, such as creating an account, issuing SSL, backups, migrations, and Git deploys, run as jobs:
- job status:
queued,running,succeeded,failed, orcancelled; - a job that fails with a temporary error is retried automatically up to 3 attempts;
- a failed job can be retried manually from the job details.
See Jobs.
Isolation drivers
Each hosting server uses one isolation driver. Account, package, and website logic is the same for every driver; only the agent knows how to enforce limits on that server.
| Driver | When it is used | Level in the GUI | How it works |
|---|---|---|---|
cloudlinux | Licensed CloudLinux servers | Strong | LVE + CageFS, PHP Selector, MySQL Governor |
generic | AlmaLinux, Rocky, RHEL without CloudLinux | Standard | cgroup v2 + a systemd slice per account, filesystem quotas, /proc hidepid, /home 0711 |
litespeed-containers | LiteSpeed Enterprise servers | LSC | Namespaces and cgroups from LiteSpeed Containers |
The agent picks the driver automatically: cloudlinux when LVE and CageFS are detected, otherwise generic. The GUI always shows the isolation level of each server, so servers with weaker isolation stand out.
INFO
The litespeed-containers driver needs LiteSpeed Enterprise. A LiteSpeed Enterprise web server mode is not available yet, so for now use cloudlinux or generic.
See CloudLinux to convert a server to CloudLinux.
Web server modes
Website data is stored in a neutral form in the panel. Each web server mode renders its own configuration, so you can switch modes without recreating websites.
| Mode | Services | .htaccess | HTTPS served by |
|---|---|---|---|
nginx-proxy (default) | Nginx + Apache (127.0.0.1:8080) | Full (Apache) | Nginx |
nginx | Nginx + PHP-FPM per account | Converted to Nginx rules | Nginx |
apache | Apache (event MPM) + PHP-FPM per account | Full | Apache |
openlitespeed | OpenLiteSpeed + lsphp (LSAPI) per account | Rewrites are read; common rules are converted | OpenLiteSpeed |
The initial mode is chosen when you install the server (--web-mode). After that, switch modes from the panel with a pre-flight check and automatic rollback. See Web server modes.
Important locations
| Location | Server | Contents |
|---|---|---|
/etc/moorcp-shared/env | Panel | Panel configuration and secrets |
/etc/moorcp-shared/pki | Panel | Internal CA |
/etc/moorcp-shared/tls | Panel | Panel TLS certificate |
/etc/moorcp-shared/release | Panel and hosting | Installed version, channel, and release mirror |
/var/lib/moorcp-shared/upgrade-state | Panel | Status and log of upgrades started from the panel (owned by root) |
/var/lib/moorcp-agent | Hosting | Agent identity and certificate |
/etc/moorcp/role | DNS-only | Contains dns on a DNS-only server |
/etc/moorcp-agent/env | Hosting | Agent settings |
The full list is in File locations.
