Adding a hosting server
How to enroll a new hosting server in the panel: install it from the panel over SSH, or create a token and install the agent and the hosting stack by hand, verify the server, apply isolation, install a DNS-only server for nameservers, and set up an external database server if you need one.
Before you start
- The panel is installed and reachable from the new server on port
8443. - The new server is clean (AlmaLinux, Rocky, RHEL, or CloudLinux 9) with a lowercase FQDN hostname. If the server was enrolled with the wrong name, change it later in the panel (Changing the hostname).
- The panel can reach the new server on the agent port (
7443).
See Server preparation.
Adding a server over SSH (recommended)
Admins can install a new server straight from the panel, without logging in to it. The panel connects over SSH, runs the same installer as below, and shows its log.
Open Servers and click Add server. The Add server page (
/servers/add) opens.Under SSH connection, fill in the server IP address or hostname, the SSH port, and the username:
root, or a user withsudo. Choose Password or SSH key (OpenSSH or PEM private key, with its passphrase if it has one).Under Install options, choose the web server, extra PHP versions, ClamAV, PostgreSQL for clients, a nameserver node, and the Let's Encrypt certificate for the hostname.
Click Test connection. Server check shows the operating system, CPU, RAM, and disk, and checks:
Check Needs Operating system AlmaLinux, Rocky Linux, RHEL, or CloudLinux 9 Root access root, or sudofor the userRAM at least 2 GB (4 GB recommended) Disk at least 10 GB free on /(20 GB recommended)Hostname a full name such as server2.example.com(warning only)Reach the panel the server opens the panel URL over HTTPS and trusts its certificate Agent no MoorCP agent enrolled yet and no installation running Compare the SSH host key fingerprint with the one from your provider or from
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubon the server, then tick This is my server's host key. The panel only connects to a server with this key during the installation.Click Install. The installation log appears on the page. It takes about 10–20 minutes.
If the server needs a reboot for disk quotas, the page shows Reboot needed. Click Reboot server. The page waits for the server to come back and keeps following the installation, which continues by itself.
When the page shows Done, the server is in the server list. After a few seconds the page opens the setup wizard of the new server (see Setup wizard), which takes you through verification, isolation, email, security, and the other important settings.
INFO
- Only the Administrator role can add servers over SSH. Every installation is recorded in the audit log (
server.install_start,server.install_reboot,server.install_finish) without the password or key. - The password or key stays only in the panel's memory during the installation and is removed when it finishes. If the panel restarts, the page loses the installation, but the installation keeps running on the server: check
/var/log/moorcp-install.logthere. - The panel needs a certificate the new server trusts. With a self-signed panel certificate, use the manual command with
--panel-cainstead. - How the credentials and host key are protected: Security model.
For the server list, the setup wizard, and other server actions, see Servers.
1. Create a registration token
To install by hand instead, create a token and run the command on the server yourself.
- In the admin panel, open Servers.
- Click Install command (or Add server on the Server enrollment card if you are not an Administrator).
- The Agent enrollment token window opens. Choose:
- Default web server: the initial web server mode;
- Extra PHP versions: Remi versions, for example
74 81 83; - Install ClamAV, if needed.
- Click Copy command.
The token is valid for 30 minutes and can be used only once. If it expires, create a new one.
INFO
Only staff with write access (Administrator and Technician) can create a registration token. Administrators use Install command; Technicians use Add server.
2. Run the installer on the new server
Log in to the new server as root, then run:
curl -fsSL https://get-shared.moorcp.com | sudo bash -s -- agent --panel https://panel.example.com:8443 --token TOKENThe agent mode installs the same version as the panel (read from /v1/health), so you do not need --channel here.
Example with options:
curl -fsSL https://get-shared.moorcp.com | sudo bash -s -- agent \
--panel https://panel.example.com:8443 --token TOKEN \
--web-mode nginx-proxy --php "74 81 83" --clamavThe command copied from the token window uses the older form, which fetches the installer straight from the panel. That form still works:
curl -fsSL https://panel.example.com:8443/install-agent.sh | bash -s -- --panel https://panel.example.com:8443 --token TOKEN --web-mode nginx-proxyPanel with a self-signed certificate
If the panel still uses a self-signed certificate, the new server cannot trust the panel. Copy the panel certificate to the new server, then add --panel-ca:
- On the panel server, take
/etc/moorcp-shared/tls/fullchain.pem. - Save it on the new server, for example as
/root/panel-ca.pem. - Add
--panel-ca /root/panel-ca.pemto the installer command.
TIP
It is easier to install Let's Encrypt on the panel first. See Installing the panel.
What the installer does
- Reads the panel version from
/v1/health, then installs the agent with the same version. - Adds the EPEL, CRB, Remi, and rspamd repositories, then installs the hosting stack: Nginx, Apache, system PHP and additional PHP, MariaDB, Postfix, Dovecot, Rspamd, Unbound (local DNS resolver for Rspamd), Pure-FTPd, restic, certbot, and supporting tools. OpenLiteSpeed and lsphp are installed with
--web-mode openlitespeed. Certbot is still installed as a package, but the hostname certificate no longer needs it (see step 8). - Checks disk quotas on
/home. On an XFS root without quotas, the installer adds a boot option, enrolls the server in the panel right away, and stops with exit code 10. Reboot the server: the installation continues by itself after the reboot (moorcp-install-resume.service, log in/var/log/moorcp-install-resume.log), so you do not need to run the command again. The token may have expired by then; that is fine because the server is already enrolled. Until the installation finishes, the panel shows the agent as not reporting. - Installs the
moorcp-agentbinary and themoorcp-agentsystemd service. - Sets up ClamAV (
--clamav) and PostgreSQL for clients (--pgsql) if requested. With--clamav, the installer also writes the MoorCP clamd configuration, downloads the signatures with freshclam, and startsclamd@scanif SELinux allows it. If clamd cannot start, the install continues and prints what to do next (see Installation problems). - Sets up the web server according to
--web-mode. - Opens the web, email, FTP, and agent ports in firewalld.
- Requests a Let's Encrypt certificate for the server hostname with
moorcp-agent hostcert issue, when the hostname is a fully qualified public name. It is skipped for names ending in.localdomain,.local,.localhost,.internal,.lan,.test,.example, or.invalid, when/etc/letsencrypt/live/<hostname>/fullchain.pemalready exists, and with--no-hostname-sslor--skip-enroll. If issuing fails, the installer only warns and continues (see Server hostname certificate). - Installs PowerDNS with
--dns(nameserver node). - Enrolls the server in the panel with the token, then starts
moorcp-agent.
At the end, the installer prints:
==> Done: srv1.example.com · nginx-proxy web mode
Continue in the panel: Servers › srv1.example.com (status Verifying) › Verify, then
Settings › Isolation & limits › Apply hardening.3. Verify the server
The new server appears in Servers with status verifying. Verification runs automatically when the agent enrolls. The server becomes active once every required check passes.
| Check | Required | Meaning |
|---|---|---|
agent_reachable | Yes | The panel can reach the agent |
identity | Yes | The server hostname matches the name in the agent certificate |
os_supported | Yes | The OS is supported |
capabilities | Yes | The agent reports the server's capabilities |
cgroup_v2 | Yes (not required on cloudlinux) | cgroup v2 is active; on CloudLinux, limits are enforced by LVE |
filesystem_quota | Yes | Quotas are active on /home or / |
proc_hidden | Yes, generic driver only | /proc is mounted with hidepid |
home_private | Yes, generic driver only | /home has mode 0711 |
driver_supported | Yes | The isolation driver is supported on the server |
web_server_mode | No | The web server mode is recorded |
security_provider | No | A security provider is present |
php_versions | No | PHP versions are installed |
DNS-only servers get a lighter verification. See DNS-only server.
To run verification again:
- Open Servers › server name › Settings.
- Choose Agent & security.
- Under Server verification, click Run verification.
4. Apply isolation hardening
With the generic driver, the proc_hidden and home_private checks only pass after isolation hardening is applied:
- Open Servers › server name › Settings › Isolation & limits.
- Click Apply hardening.
- Confirm.
/homebecomes 0711 and/procis remounted with hidepid. Sites and email stay online.
The server is verified again afterwards. Once every required check passes, the status becomes active.
TIP
On a CloudLinux server, the agent uses the cloudlinux driver automatically when LVE and CageFS are detected. See CloudLinux.
5. Set capacity
Open Settings › Capacity & maintenance to set the account limit, oversell rules, and maintenance mode. See Servers.
Server hostname certificate
Email (Postfix/Dovecot), webmail, phpMyAdmin, and AdminNeo use a Let's Encrypt certificate for the server hostname, for example srv1.example.com. The agent has a built-in ACME client for it; certbot is not needed. The installer requests the certificate at the end of the install (step 8 above). To request it yourself, for example after DNS is ready, run as root on the hosting server:
moorcp-agent hostcert issueRequirements:
- an A record for the hostname points to the server;
- port 80 is open from the internet (HTTP-01 validation).
What the command does:
--domaindefaults to the server's OS hostname.--email EMAILsets the Let's Encrypt account email.--staginguses the Let's Encrypt test CA (the certificate is not trusted).- It works in every web server mode. If port 80 is free, the agent serves the challenge itself. If the web server serves the ACME webroot
/var/lib/moorcp/acmefor the hostname, it uses that. Otherwise it stops the active web server (OpenLiteSpeed, Nginx, or Apache) for a few seconds during validation and starts it again. - Files are written in the certbot layout:
/etc/letsencrypt/live/<hostname>/{privkey,fullchain,cert,chain}.pem. Then the executable deploy hooks in/etc/letsencrypt/renewal-hooks/deployrun. - For the server hostname, the agent installs the deploy hook
/etc/letsencrypt/renewal-hooks/deploy/moorcp-agent-host.sh(reloads Postfix, Dovecot, and the web server on renewal). It then runs the setup of what is installed again, so it switches to the new certificate: email TLS, webmail, phpMyAdmin, and AdminNeo. It printsupdating <name> for <hostname>for each one. If--domainis not the server hostname, mail and the hostname vhosts are left unchanged.
The agent renews the certificate itself: it checks twice a day (the first time 15 minutes after the agent starts) and renews when less than 30 days remain. A hostname that was never issued (DNS not ready yet) is retried for 7 days; after that, retries stop until you run issue again.
Other commands:
| Command | Purpose |
|---|---|
moorcp-agent hostcert status | Lists the managed hostnames and the expiry date. (renewal due), (managed by certbot), or (retries stopped; run issue again) is shown when it applies |
moorcp-agent hostcert renew | Renews now the certificates that are due, or not issued yet |
moorcp-agent hostcert remove --domain HOST | Stops renewing a hostname. The certificate files are kept |
INFO
A hostname managed by certbot (a /etc/letsencrypt/renewal/<hostname>.conf file, or symlinked files in live/) is never touched. issue refuses with <hostname> is managed by certbot; renew it with certbot, and certbot keeps renewing it.
With --pgsql, AdminNeo needs the hostname certificate first. If it is missing, the installer skips AdminNeo. Once the certificate is issued, install it from Servers › server name › Settings › Apps & tools.
Enrolling a server again
Re-running the installer is safe. If the agent is already enrolled, the enrollment step is skipped (
Agent sudah terdaftar (pakai --force untuk mendaftar ulang): agent already enrolled; use--forceto enroll again).--forceenrolls again with a new token.A hostname that is already enrolled can only be enrolled again with a token for that specific server (
POST /v1/servers/enroll-tokenswithserverId). A regular token is refused withcp.enroll_hostname_taken, so another server cannot overwrite an existing one.--skip-enrollinstalls everything without enrolling, for example for a template image. Enroll later with:bashmoorcp-agent enroll --panel https://panel.example.com:8443 --token TOKEN && systemctl enable --now moorcp-agent
DNS-only server
A DNS-only server is a small VPS that only runs the agent and PowerDNS as a nameserver node (ns1, ns2, ...). It does not install the hosting stack and is not used for accounts. 1 vCPU and 1 GB of RAM is enough.
TIP
A hosting server can also be a nameserver node: install it with --dns, or just pick it in the panel. Avoid the panel server, because a public port 53 is an easy target for attacks.
Install
Create a registration token in Servers › Add server, as in step 1 above.
On the new VPS (AlmaLinux, Rocky, RHEL, or CloudLinux 9), run:
bashcurl -fsSL https://get-shared.moorcp.com | sudo bash -s -- dns --panel https://panel.example.com:8443 --token TOKEN
The installer installs the agent, opens the DNS port (53) and the agent port in firewalld, installs PowerDNS, records the dns role in /etc/moorcp/role, then enrolls the server in the panel. At the end, it prints:
==> Done: ns1.example.com · DNS-only (PowerDNS)
Continue in the panel: Domains & DNS › Nameserver nodes › Add node › ns1.example.com.Verification
The required checks for a DNS-only server are only agent_reachable, identity, os_supported, capabilities, and dns_node (PowerDNS installed by the dns installer mode). The quota, cgroup, and isolation checks do not apply. If anything tries to place an account on this server, placement is refused with the reason "DNS-only server".
Make it a nameserver node
- Open Domains & DNS › Nameserver nodes.
- If DNS is not enabled yet, fill in Default nameservers, for example
ns1.example.comandns2.example.com, pick the server under Primary node, then click Enable DNS. Existing zones are copied to that node right away. - For the next node, click Add node, pick the server, then click Add node. The new node becomes a replica, and every zone is copied from the primary.
- At the registrar of the nameservers' parent domain, create an A record for each nameserver pointing to its node's IP, and register them as child nameservers (glue). The At the registrar card on that page shows the pairs.
See Domains and DNS to change the primary, remove nodes, and add cPanel DNSOnly replicas.
External database server
Account databases (MariaDB/MySQL and PostgreSQL) can live on another server: a separate VPS, a dedicated database server, or a managed service. phpMyAdmin and AdminNeo are still opened from the hosting server.
The panel does not install the database on the external server. Prepare that server first with the steps below (example for AlmaLinux/Rocky 9). Replace these values:
| Value | Meaning |
|---|---|
10.0.0.10 | IP of the hosting server (as seen by the database server) |
10.0.0.20 | IP of the database server |
STRONG_PASSWORD | Password of the admin user moorcp |
TIP
If both servers share a private network, use private IPs: data transfers are faster and do not cross the internet.
MariaDB
dnf install -y mariadb-serversystemctl enable --now mariadbCreate /etc/my.cnf.d/90-remote.cnf so MariaDB can be reached from the network:
[mysqld]
bind-address = 10.0.0.20systemctl restart mariadbmariadb -e "CREATE USER 'moorcp'@'10.0.0.10' IDENTIFIED BY 'STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'moorcp'@'10.0.0.10' WITH GRANT OPTION;"Use a MariaDB version equal to or newer than the hosting server's, so user password hashes carry over when databases are moved.
PostgreSQL (if used)
dnf install -y postgresql-serverpostgresql-setup --initdbsystemctl enable --now postgresqlChange two files:
/var/lib/pgsql/data/postgresql.conf:listen_addresses = 'localhost,10.0.0.20'/var/lib/pgsql/data/pg_hba.conf, add:host all all 10.0.0.10/32 scram-sha-256
systemctl restart postgresqlsudo -u postgres psql -c "CREATE ROLE moorcp LOGIN CREATEROLE CREATEDB PASSWORD 'STRONG_PASSWORD';"CREATEROLE CREATEDB is enough; SUPERUSER also works.
Database server firewall
Open the database ports only to the hosting server's IP:
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.10/32" port port="3306" protocol="tcp" accept'firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.10/32" port port="5432" protocol="tcp" accept'firewall-cmd --reloadAdd one rule for every hosting server that uses this database server.
WARNING
Never open port 3306 or 5432 to every address.
Connect it in the panel
- Open Servers › hosting server › Settings › Databases.
- Click Configure on MariaDB or PostgreSQL, then choose External endpoint.
- Fill in Private address and/or Public address, the port (
3306/5432), usermoorcp, the password, and the TLS mode:- private network:
disableorpreferred; - over the internet:
requiredorverify(with a CA certificate).
- private network:
- Click Test connection. The panel checks the network, TLS, and admin rights, then shows the hosting server's IP as seen by the database server. That is the IP to allow for the
moorcpuser and in the firewall. - Tick Move existing account databases and users to the new location if the existing databases should move too.
- Click Save and apply.
If the connection test fails:
| Symptom | Check |
|---|---|
| Connection refused / timeout | bind-address or listen_addresses, firewall |
| Access denied | The user host ('moorcp'@'IP') must be the IP from the connection test; pg_hba.conf |
| Insufficient privileges | WITH GRANT OPTION (MariaDB), CREATEROLE CREATEDB (PostgreSQL) |
