Hardening checklist

What to do on a ScalPanel server after installing it, so the defaults match a production hosting service.

Work through this list after the installer finishes and before you take on customers. Each item says why it matters.

Right after installing

  1. Store the admin password safely. The installer prints it once.
  2. Back up the keyring offline. Copy /etc/scalpanel/secrets/keyring to a password manager or offline storage, apart from your database backups. Without it, no backup of the control plane can be decrypted, and anyone with both can read every stored secret.
  3. Give the panel a real certificate. Point the server's host name (A record) at the server. Replace the self-signed certificate in /etc/scalpanel/tls, then restart the panel with scalpanelctl compose restart panel.
  4. Turn on two-factor authentication for your own admin user in My security. Add a passkey or TOTP, and keep the ten recovery codes somewhere safe.
  5. Set the nameservers and web addresses in Admin → Basic setup, so customer zones and certificates work.

Accounts and access

  • Require two-factor authentication with the security.require_mfa policy. It is off by default. Turn it on for provider staff and resellers at least.
  • Restrict staff sign-ins to your office or VPN networks in Admin → Admin access. If you lock yourself out, run scalpanelctl admin admin-access-off on the server.
  • Give staff the smallest role that does the job. Provider administrators can see and change everything.
  • Review the audit log in Admin → Audit log, and set its retention. The default keeps every event.

Resource limits

  • Set limits in every package (Admin → Packages, or create plans in Admin → Isolation & resource plans). Disk space, files, disk I/O and monthly transfer are unlimited by default. CPU (1 core), memory (1024 MiB) and processes (256) have defaults.
  • Make disk limits hard with project quotas (steps below). Without them, a website can write past its limit until the next measurement.
  • Do not oversell memory. Each website may use its account's whole memory limit. Leave room for the platform's own services.

Turn on project quotas

  1. Put /srv/scalpanel/sites on its own disk, formatted as XFS, or as ext4 with project quotas.
  2. If websites exist already, stop ScalPanel and Docker, and copy the site directories onto the new disk with cp -a (or rsync -aHAX).
  3. Mount the disk at /srv/scalpanel/sites with the prjquota option in /etc/fstab, so it is mounted before Docker starts. Then start Docker and ScalPanel again.
  4. Check the node's page in the admin panel: it shows whether project quotas are enforced. Each website is tagged on its next apply, at the latest after 30 minutes.

For ext4, format and mount like this:

mkfs.ext4 -O quota,project -E quotatype=prjquota /dev/<disk>
/dev/<disk> /srv/scalpanel/sites ext4 defaults,prjquota 0 2

Network

  • Keep the outgoing ports small. security.outbound_ports allows 80 and 443 by default. Open more only when needed: the list applies to every website on the server. Outgoing UDP (security.outbound_udp_ports) is closed by default; open single ports such as 123 rather than all, since open UDP can be abused for floods.
  • Filter the panel ports. Published Docker ports bypass a host firewall such as ufw. Use Security → Firewall (it covers every port ScalPanel publishes) or Security → Admin access to limit who reaches the admin panel (2087), and protect the host's own SSH separately: ScalPanel's firewall does not touch it.
  • Know what Admin → Firewall covers. Its rules run on the node, so on an all-in-one server they apply to the ports the node serves: web (80, 443), FTP and remote database access. Use Admin → Admin access and an outside firewall for the panels, mail, the SSH gateway and DNS.
  • Keep FTP off (Admin → FTP server) unless customers need it. If you turn it on, keep FTPS required.
  • Keep SSH grants short. security.ssh_max_grant_hours defaults to 24 hours, and permanent access (security.ssh_permanent_access) is off. Keep it that way unless you have a reason.

PHP and websites

  • Keep the disabled PHP functions (exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec, putenv). Removing them makes a compromised website more useful to an attacker, though it stays inside its container.
  • Remove PHP versions that no longer get security updates in Admin → PHP versions.

Mail

  • Ask your provider for reverse DNS (PTR) for the server's IP address, matching the mail host name.
  • Check each domain in Admin → Email deliverability or the customer's Email deliverability page (MX, SPF, DKIM, DMARC, reverse DNS).
  • Keep the website mail rate low. limit.site_mail_per_hour defaults to 100 per website. A hacked website will use all of it.
  • Configure alert email to go through a relay with a good reputation, so security alerts arrive.

The server

  • Install kernel updates and reboot. Every website shares the host kernel. A kernel bug is the main way out of a container.
  • Run nothing else on the server. The website host (the node container) is privileged. Other software on the same host adds attack surface to every customer.
  • Keep ScalPanel updated from Admin → Updates or with scalpanelctl update. Updates are signed and verified before they are installed.
  • Set up off-site backups in Admin → Off-site backups: account backups and a daily control-plane dump go to a restic server, S3-compatible storage or SFTP.
  • Watch the free disk space. A full disk stops PostgreSQL, mail and the panels. scalpanelctl cleanup removes images of old releases.
  • Run the Security advisor (Admin → Security advisor) and fix what it reports.

Settings to leave alone in production

  • SCALPANEL_ALLOW_HTTP: allows downloading releases over plain HTTP. For testing only.
  • SCALPANEL_WEBHOOK_ALLOW_NETS and SCALPANEL_WEBHOOK_ALLOW_HTTP: let alert webhooks reach private networks or plain HTTP. For development only.