Skip to content

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.

text
                  ┌──────────────────────────────────────┐
  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 N

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

BinaryRuns onRole
moorcp-sharedPanel serverControl plane: REST API v1, admin and client panels, job worker, audit, PostgreSQL database
moorcp-agentEvery hosting server and DNS-only serverRuns allowlisted operations from the panel over mTLS, picks the isolation driver, writes web server configuration, and manages PowerDNS on nameserver nodes
moorctlPanel 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-shared under the system user moorcp.
  • 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.path then runs moorcp-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-agent on every hosting server and DNS-only server.
  • Only runs operations from an allowlist, with names such as account.create or ssl.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.

  1. An admin creates a single-use registration token in the panel. The token is valid for 30 minutes.
  2. 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.
  3. 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 8443 with the agent certificate.

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.

text
  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)
DataStored in
All records of every zoneEvery node (primary and replicas)
Zone ownership, templates, node list, nameserversPanel PostgreSQL
BIND copy of every zonePanel 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.1 on 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:

PortServiceOpen to
8443Admin panel, API v1, agent enrollment and heartbeatStaff, billing, all hosting servers
2083Client panelAccount owners
2085App origin (client Softaculous UI)Account owners
2086Admin app origin (Softaculous admin, CloudLinux Manager, Rspamd web UI)Staff
80Let's Encrypt validation for the panel certificateInternet
5432Panel PostgreSQLLocal only (127.0.0.1)

Hosting server:

PortService
7443Agent mTLS (change it with --listen); only needs to be open to the panel
80, 443Websites
25, 465, 587SMTP (login only on 465 and 587)
143, 993, 110, 995IMAP and POP3
21FTP
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, or cancelled;
  • 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.

DriverWhen it is usedLevel in the GUIHow it works
cloudlinuxLicensed CloudLinux serversStrongLVE + CageFS, PHP Selector, MySQL Governor
genericAlmaLinux, Rocky, RHEL without CloudLinuxStandardcgroup v2 + a systemd slice per account, filesystem quotas, /proc hidepid, /home 0711
litespeed-containersLiteSpeed Enterprise serversLSCNamespaces 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.

ModeServices.htaccessHTTPS served by
nginx-proxy (default)Nginx + Apache (127.0.0.1:8080)Full (Apache)Nginx
nginxNginx + PHP-FPM per accountConverted to Nginx rulesNginx
apacheApache (event MPM) + PHP-FPM per accountFullApache
openlitespeedOpenLiteSpeed + lsphp (LSAPI) per accountRewrites are read; common rules are convertedOpenLiteSpeed

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 ​

LocationServerContents
/etc/moorcp-shared/envPanelPanel configuration and secrets
/etc/moorcp-shared/pkiPanelInternal CA
/etc/moorcp-shared/tlsPanelPanel TLS certificate
/etc/moorcp-shared/releasePanel and hostingInstalled version, channel, and release mirror
/var/lib/moorcp-shared/upgrade-statePanelStatus and log of upgrades started from the panel (owned by root)
/var/lib/moorcp-agentHostingAgent identity and certificate
/etc/moorcp/roleDNS-onlyContains dns on a DNS-only server
/etc/moorcp-agent/envHostingAgent settings

The full list is in File locations.

See also ​

MoorCP Shared, a shared hosting panel for server fleets.