PLATINUM DOCS
Self-hosting

Hardening

Lock down a working install before it runs untrusted code or takes real users.

Lock down a working install before it runs untrusted code or takes real users. Each step below is independent.

Keep production mode on

setup.sh writes PT_PRODUCTION=1 and generates every secret. In production mode the server refuses to start while ADMIN_TOKEN, EDGE_HMAC_SECRET or DATABASE_URL hold a development default.

# on the control plane, in platinum/infra/compose
grep '^PT_PRODUCTION=' .env        # PT_PRODUCTION=1
ls -l .env                         # -rw------- (setup.sh writes mode 600)

On each host, /etc/platinum/host.env and /etc/platinum/edge-proxy.env hold secrets too. The installer writes both with mode 600.

Firewall every machine

Deny inbound by default and open only these ports.

MachinePortAllow fromFor
Control plane80, 443AnywhereCaddy: the API, previews, the console
Control plane5432Each sandbox hostPostgres, for the edge proxies
Control plane9000Each sandbox hostThe bundled object store, if you run it
Sandbox host80The control planeThe edge proxy
Sandbox host18048The control planeThe control channel
Sandbox host20000–29999AnywhereDirect TCP exposures, only if you use them

Keep SSH open from your own addresses on both.

Tighten the host firewall

The installer writes /etc/nftables.conf. Its input chain accepts 22, 80, 443, 3000, 8080 and 20000–29999 from anywhere, and the control-channel setup allows :18048 from the control plane only.

Restrict the rest in that file, then reload it. Rules added with nft add rule are gone after a reboot.

Gate each host's edge proxy

A request sent straight to a host's :80 skips the control plane's metering and admission. Set the control plane's addresses as the edge's trusted peers, before you enroll hosts:

# in platinum/infra/compose/.env, then docker compose up -d
EDGE_TRUSTED_PEERS=<control-plane-ip>

The installer then writes EDGE_TRUSTED_PEERS and EDGE_PEER_GATE=enforce into each new host's /etc/platinum/edge-proxy.env. Any other peer gets 404 peer-not-trusted. Addresses and CIDRs are separated by commas or spaces.

Restrict sign-ups and admin access

SettingDo
PT_SIGNUP_MODEKeep invite-only (written by setup.sh). The server's own default is open.
PT_ADMIN_EMAILSList only operators: these accounts become platform admins.
PT_ADMIN_IP_ALLOWLISTRestrict /_admin/* and /internal/admin/* to your addresses or CIDRs.
ADMIN_TOKENTreat it as root for the whole install. Keep it out of shell history and scripts.

Keep the host baseline

The installer boots each host with SMT off and lockdown=integrity, and runs Cloud Hypervisor as the unprivileged platinum-vmm user. Keep these when you tune a host.

cat /sys/devices/system/cpu/smt/active   # 0
cat /sys/kernel/security/lockdown        # … [integrity] …

Revoke unused install tokens

An unused install token downloads a script that contains your object storage keys and the control-channel token. List and revoke them: see Sandbox hosts.