The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Kastell listing page.
Your infrastructure, fortified.
English | Türkçe
Server security is fragmented. Lynis scans but doesn't fix. OpenSCAP is powerful but complex. Custom scripts work until they don't -- and nobody maintains them. Each tool has its own output format, its own update cycle, its own learning curve.
Kastell takes a different approach: one CLI that audits, fixes, hardens, and monitors. Scan your server, apply safe fixes, lock it down to production standards, and keep watching -- all with the same tool.
AI-native from day one. Kastell ships with a built-in MCP server, so Claude, Cursor, or any MCP-compatible AI agent can manage your servers directly. Go from a prompt to production hardening in seconds.
You don't need four separate tools to secure a server.
Running kastell without any arguments launches an interactive search menu with a gradient ASCII banner and quick-start examples. Browse actions by emoji-categorized groups, type to filter results instantly, and configure options step by step -- no need to remember any command names or flags.
Each action includes sub-options (server mode, template, log source, port number, etc.) and a <- Back option to return to the main menu at any point.
If you already know the commands, you can still use them directly:
Kastell handles server provisioning, SSH key setup, firewall configuration, and platform installation automatically.
| Problem | Solution |
|---|---|
| Broke your server with an update? | Pre-update snapshot protection via maintain |
| No idea if your server is healthy? | Built-in monitoring, health checks, and doctor diagnostics |
| Security is an afterthought? | Firewall, SSH hardening, SSL, and security audits built-in |
| Backups? Maybe someday... | One-command backup & restore with manifest tracking |
| Managing multiple servers? | --all flag across backup, maintain, status, and health |
| Existing server not tracked? | kastell add brings any server under management |
| Don't want to memorize commands? | Just run kastell -- interactive menu guides you |
| Feature | Kastell | Lynis | OpenSCAP |
|---|---|---|---|
| Installation | npm i -g kastell | Package manager | Package manager |
| Language | TypeScript | Shell | C/Python |
| Security Checks | 449 | 300+ | Varies by profile |
| Auto-Fix | Safe tier | Suggest only | Suggest only |
| MCP (AI Agent) | 17 tools | -- | -- |
| Compliance | CIS, PCI-DSS, HIPAA | CIS, HIPAA | CIS, STIG, PCI-DSS |
| Cloud Provision | 4 providers | -- | -- |
| Hardening (Lock) | 24-step | -- | -- |
| Remote Monitoring | Guard daemon | -- | -- |
| Telegram Bot | Built-in | -- | -- |
| Platform Support | Linux (SSH) | Linux/macOS/BSD | Linux |
| License | Apache 2.0 | GPL-3.0 | LGPL-2.1 |
| Provider | Status | Regions | Starting Price |
|---|---|---|---|
| Hetzner Cloud | Stable | EU, US | ~€4/mo |
| DigitalOcean | Stable | Global | ~$18/mo |
| Vultr | Stable | Global | ~$12/mo |
| Linode (Akamai) | Beta | Global | ~$12/mo |
Prices reflect the cheapest plan with at least 2 GB RAM (required by Coolify and Dokploy). Bare mode has no minimum requirements -- plans start from ~$2.50/mo depending on provider. You can choose a different size during setup. Linode support is in beta -- community testing welcome.
| Platform | Mode Flag | Min RAM | Min CPU | Description |
|---|---|---|---|---|
| Coolify | --mode coolify (default) | 2 GB | 2 vCPU | Docker-based PaaS (port 8000) |
| Dokploy | --mode dokploy | 2 GB | 2 vCPU | Docker Swarm-based PaaS (port 3000) |
| Bare | --mode bare | — | — | Generic VPS, no platform overhead |
Kastell uses a PlatformAdapter architecture -- the same commands (update, maintain, logs, health) work across all platforms. The platform is stored in your server record and auto-detected on each command.
| Feature | Command / Flag | Description |
|---|---|---|
| Dry Run | --dry-run | Preview destructive commands without executing. Available on: destroy, update, restart, remove, maintain, restore, firewall, domain, backup, snapshot, secure. |
| Shell Completions | kastell completions bash|zsh|fish | Generate shell completion scripts for tab-completion of commands and options. |
| Config Validation | kastell config validate | Check servers.yaml for structural and type errors using Zod strict schemas. |
| Version Check | kastell --version | Shows current version and notifies if a newer version is available on npm. |
Deploy with a single config file:
| Template | Best For | Includes |
|---|---|---|
starter | Testing, side projects | 1-2 vCPU, 2-4 GB RAM |
production | Live applications | 2-4 vCPU, 4-8 GB RAM, full hardening |
dev | Development & CI/CD | Same as starter, no hardening |
Kastell is built with security as a priority -- 12,132 tests across 380 suites, including dedicated security test suites.
StrictHostKeyChecking=accept-new with IP validation (octet range) and environment filteringspawn/spawnSync, no execSync)0o600)--full-setup enables UFW firewall and SSH hardening automaticallykastell destroy without --force, pre-commit audit guard warns on score dropsThis section documents security contracts shipped in v2.3.1. Future work is described elsewhere (see CHANGELOG.md for upcoming entries).
KASTELL_STRICT_HOST_KEY=true — when set, Kastell rejects unknown SSH host keys outright. Direct SSH connections (i.e. those that go through accept-new) emit a one-time Trust-On-First-Use (TOFU) warning so operators see the risk; combined with KASTELL_STRICT_HOST_KEY=true, the warning is promoted to a hard error.--force flag or the command's documented opt-in flag. Without one, the command exits with a non-zero status and a clear error.0o600 POSIX permissions remain the source of truth on Linux/macOS; Windows uses the equivalent DACL.audit --json QuickWin entries now include a stable id (check ID) and severity field, in addition to the existing description and commands. This makes QuickWins programmatically consumable without parsing the human-readable description.--dry-run (or via server_fix MCP dry-run), each FORBIDDEN-tier fix now renders a short reason explaining why the fix is classified FORBIDDEN (e.g. "requires reboot", "disrupts active SSH sessions"). The reason is sourced from the check's forbiddenReason field.Requires Node.js 20 or later.
KASTELL_SAFE_MODE environment variable controls destructive operations:
true — provision, destroy, restore are blockedfalse — all operations are enabledKASTELL_SAFE_MODE=true kastell destroy <server> → rejectedAffected commands: init, destroy, backup-restore, snapshot-restore, snapshot-delete, restart, maintain.
Server creation fails?
Run kastell doctor --check-tokens to verify your API token and local environment.
Server not responding?
Use kastell status my-server --autostart to check platform status and auto-restart if needed, or kastell health to check all servers at once.
Need to start fresh?
kastell destroy my-server removes the cloud server entirely.
See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
Kastell uses 11,206 tests across 344 suites. Run npm test before submitting PRs.
Kastell includes a built-in Model Context Protocol server for AI-powered server management. Works with Claude Code, Cursor, Windsurf, and other MCP-compatible clients.
Available tools:
| Tool | Actions | Description |
|---|---|---|
server_info | list, status, health, sizes | Query server information, check cloud provider and platform status |
server_logs | logs, monitor | Fetch platform/Docker logs and system metrics via SSH |
server_manage | add, remove, destroy | Register, unregister, or destroy cloud servers |
server_maintain | update, restart, maintain | Update platform, restart servers, run full maintenance |
server_secure | secure, firewall, domain | SSH hardening, firewall rules, domain/SSL management (10 subcommands) |
server_backup | backup, snapshot | Backup/restore databases and create/manage VPS snapshots |
server_provision | create | Provision new servers on cloud providers |
server_audit | audit | 449-check security audit with compliance framework filtering; use --explain for remediation guidance |
server_evidence | collect | Collect forensic evidence package with checksums |
server_guard | start, stop, status | Manage autonomous security monitoring daemon |
server_doctor | diagnose | Proactive health analysis with remediation commands |
server_lock | harden | 24-step production hardening (SSH, UFW, sysctl, auditd, AIDE, Docker) |
server_fleet | overview | Fleet-wide health and security posture dashboard |
server_fix | fix --safe | Apply safe auto-fixes with backup (SAFE tier only, dryRun default) |
All destructive operations (destroy, restore, snapshot-delete, provision, restart, maintain, snapshot-create) require
SAFE_MODE=falseto execute.
Kastell is available as a Claude Code plugin for the Anthropic marketplace. The plugin bundles:
Install via Claude Code plugin manager or use directly with claude --plugin-dir kastell-plugin.
| Platform | Config Location | Guide |
|---|---|---|
| Claude Code | claude mcp add or .mcp.json | Setup Guide |
| Claude Desktop | claude_desktop_config.json | Setup Guide |
| VS Code / Copilot | .vscode/mcp.json | Setup Guide |
| Cursor | .cursor/mcp.json | Setup Guide |
More platforms (JetBrains, Windsurf, Gemini, and others) coming in v2.0.
Kastell provides llms.txt for AI crawlers and is listed in the MCP Registry as io.github.kastelldev/kastell.
These contracts apply to the CLI and the MCP server.
server_provision returns after the provider creates the server and Kastell
durably registers it. readiness.status may be pending; follow with
server_info status or server_info health. The interactive kastell init
command continues waiting through its existing readiness checks.
1.0.--all failures return 1.audit --json and audit --ci reserve stdout for one JSON payload.Use kastell audit in your CI pipeline to enforce security baselines:
The --threshold flag causes a non-zero exit code when the score falls below the target, failing the CI job automatically.
Infrastructure should be boring, predictable, and safe.
Kastell is not a script. It's your DevOps safety layer for self-hosted infrastructure.
Apache 2.0 -- see LICENSE
Built by @omrfc