What epd setup installs
epd setup prepares Docker or the PM2 runtime, starts Traefik, and deploys your app. On Debian and Ubuntu servers running systemd, it also configures a secure host baseline. Other distributions and containers without systemd emit a warning and skip the baseline.
To apply it without deploying:
epd setup --skip-deploy
epd doctorDefaults
server:
auto_updates: true
firewall: true
allow: []
ssh_hardening: true
log_rotation: true
reboot_window: "03:00"All settings describe the host, so use consistent settings across projects that share a server. Setting a protection to false stops EPD from managing it. It does not undo changes from an earlier setup.
Security updates and time
EPD installs unattended-upgrades, enables the daily APT timers, and limits unattended upgrades to security origins. Security updates that require a reboot can reboot the host at 03:00 in the server's time zone. To require manual reboots, set reboot_window: false. A single server's reboot interrupts its applications.
EPD enables an existing chrony or systemd-timesyncd service, or installs chrony if neither is available.
Firewall and SSH access
EPD owns the inet epd_baseline nftables table. It never flushes the whole ruleset or edits Docker's tables. Host input defaults to drop, with exceptions for established traffic, loopback, ICMP including IPv6 discovery, DHCP replies, SSH, TCP 80/443, configured Traefik entrypoints, and server.allow TCP ports.
A separate forwarding chain blocks new connections to other DNAT-published ports, including Docker ports that bypass the host input chain. Docker outbound traffic keeps its existing forwarding behavior. Cross-host replica ports are allowed from the configured proxy peers. For hostname-based cross-host peers, set proxy.private_ips to their source IP addresses.
Add every extra public TCP port needed by applications on the same host to server.allow. UDP-published services other than DHCP replies are not opened by this baseline. Existing firewall rules can still impose additional restrictions.
Before changing access, EPD verifies a new SSH connection using public-key authentication. It saves the previous EPD firewall table and SSH configuration, then arms an independent systemd rollback timer. A second fresh key connection must succeed before EPD confirms the change. Failed checks restore the previous policy immediately. If the CLI terminates or loses connectivity, the timer restores access after 60 seconds. Recovery files are root-only under /var/lib/epd-baseline/epd-baseline-*.
The SSH policy disables password and keyboard-interactive authentication, enables public-key authentication, and allows root login only with a key. An existing PermitRootLogin no remains disabled. EPD validates the configuration before reloading SSH. It does not create a passwordless sudo rule. Non-root users need existing sudo authorization, an interactive sudo password, or EPD_SUDO_PASSWORD for unattended runs.
The confirmed firewall is loaded on boot by epd-firewall.service. Repeated setup checks the current rules and avoids reapplying an unchanged policy.
Docker log limits
EPD merges json-file logging with max-size: 10m and max-file: 3 into /etc/docker/daemon.json, preserving unrelated daemon options. It does not restart Docker during setup. Restart Docker in a maintenance window, then recreate existing containers to apply the limits. Process-mode PM2 logs are not managed by this setting.
Verification
epd doctor reports missing or changed firewall, SSH, update, and Docker log configuration. Docker checks cover configuration on disk, not whether existing containers have adopted it.
bun run typecheck
bun test
bash packages/cli/test/e2e/baseline.sh
bash packages/cli/test/e2e/run.shThe baseline test runs a disposable privileged Ubuntu 24.04 systemd container. It checks repeat setup, diagnostics, preservation of an unrelated nftables table, immediate recovery from an SSH-blocking policy, and timer recovery after CLI termination. A real VM remains useful for validating boot ordering and provider networking before rolling this out to production servers.
The implementation follows OpenSSH's configuration rules and Docker's guidance on separate nftables tables and forwarding hooks.