deploymate

Operate

Secure your server

A DeployMate server is a machine on the internet that can run code for you, so it deserves a few minutes of care. This page covers what DeployMate checks for you, the one command that applies the fixes, and what the dashboard does to protect itself.

The Security page

In the sidebar, under Server, open Security. It reads your machine and lists what an attacker could reach: whether the firewall is on and drops by default, which ports listen on every interface (databases on a public address are critical), SSH password and root login, fail2ban, automatic updates and a pending reboot, who is in the docker group, containers that publish a port or run privileged, and Redis services without a password. Each finding says what it found and the exact fix. The page only reads; nothing on it changes the machine. The same report is at GET /api/v1/security and as the MCP tool security_status.

deploymate harden

Run it over SSH. It prints a plan and changes nothing until you add --apply:

sudo deploymate harden                                   # public server
sudo deploymate harden --ssh-from 192.168.1.0/24          # tunnel server
sudo deploymate harden --apply                            # when the plan looks right

It picks a profile on its own: a public server (ports open) or a tunnel server (DEPLOYMATE_LE_MODE=off, see tunnels).

BothAutomatic security updates. SSH settings: at most 4 tries per connection, no root login, and password login off, but only when you have a key installed and SSH has logged you in with it before. The new SSH config is checked with sshd -t before it takes effect.
PublicFirewall: SSH rate-limited, 80 and 443 open, everything else denied. fail2ban for SSH.
TunnelPorts 80 and 443 closed (the tunnel connects out). Port 22 closed to everyone except the network you give with --ssh-from (it must be a network the machine is on, or harden refuses). No fail2ban: behind a tunnel every connection looks local, so it couldn't tell attackers apart. Protect SSH with the tunnel's access policy instead.
Keep a way inChanges to the firewall and SSH start a five-minute revert timer inside systemd, so it fires even if your session drops. Open a second terminal and log in; if it works, run sudo deploymate harden --confirm. If you don't, the old settings come back by themselves. sudo deploymate harden --undo reverses everything later. If the server is only reachable through a tunnel, make sure you can still reach the machine another way (keyboard, or your provider's console) before closing port 22.

Databases and containers

New Redis services get a password, because every container on the server's network can reach every Redis. A Redis created earlier keeps working without one; its page offers Add a password, which restarts it and redeploys the apps that use it, and Remove password for an app that can't use one. Every container DeployMate starts runs with no-new-privileges, a trimmed set of Linux capabilities and a process limit.

The dashboard itself

  • Headers. The dashboard refuses to be framed, sets a content security policy and, over HTTPS, HSTS.
  • Sign-in limits. Ten failed sign-ins from one address in 15 minutes, or thirty for one email, and further attempts are refused. Behind a Cloudflare tunnel the real visitor address is used. Every attempt is listed on the Sign-ins page in the sidebar (counts, latest attempts, a tag for an address that never signed in before), and an alert event, Repeated failed dashboard sign-ins, can post to your webhook.
  • Sessions last 7 days. Sign out everywhere on the Sign-ins page ends all of them.
  • Not yet: two-factor sign-in. Until then, put an access policy (Cloudflare Access, a VPN) in front of the dashboard.

After a scare: what to rotate

  1. Sign out everywhere, and change your dashboard password.
  2. Revoke API tokens you don't recognise on the Tokens page, and create new ones.
  3. Rotate backup storage keys (the S3 or R2 access keys) and download a fresh backup key for each database.
  4. Disconnect and reconnect GitHub, and review its installation.
  5. If you use a tunnel, rotate the tunnel token in Cloudflare.
  6. Check ~/.ssh/authorized_keys for keys you didn't add, and run the Security page again.