Repository navigation
Deploying to a Server
📖 Canonical version: read this page on the official docs site — https://www.redamon.org/docs/deploying-to-a-server. The GitHub wiki is a mirror.
RedAmon normally runs on your own machine at http://localhost:3000. This guide is for the other case: putting a full RedAmon instance on a Linux server on the internet - an AWS EC2 box, a DigitalOcean droplet, a Hetzner server, or bare metal - so you (and your teammates) can reach it from a browser over HTTPS.
You drive the whole thing from your laptop with one command. You never install anything on the server by hand.
Local vs. server - which do you want?
- Just trying RedAmon out, or working solo on your own laptop? Follow Getting Started instead. It runs on
localhostand needs none of this.- Want a shared, always-on instance reachable over the internet? You're in the right place.
Security first. RedAmon was designed to run local-only and trusts everything on its own network. Exposing it raw on a public IP would hand anonymous attackers an unauthenticated root shell (the Kali sandbox terminal), among other things. The deploy tool exists precisely to close that gap: it wraps RedAmon in nginx + TLS + a firewall + host hardening so that only the login page is reachable from the internet. Do not shortcut it by opening extra ports "to make things work" - see What the deploy protects you from.
If you already know your way around a cloud server, here's the whole flow:
# on your laptop, in the repo
cd tooling/deploy/single-host
cp .env.example .env
# edit .env: HOST_IP, DOMAIN, SSH_KEY_PATH, OPERATOR_ALLOW_CIDRS,
# LETSENCRYPT_EMAIL, ADMIN_NAME / ADMIN_EMAIL / ADMIN_PASSWORD
./deploy.sh initType INIT when prompted, wait 30-60 minutes for the first build, then log in at https://<your-domain>/. The rest of this page explains each step.
You need three things.
A fresh Ubuntu 22.04 or 24.04 box with a public IP. You install nothing on it manually - deploy.sh detects and installs every prerequisite for you (Docker Engine 28.0.0 or newer, nginx, certbot, the firewall, swap, and so on), and it's safe to re-run.
RedAmon is heavy. Pick a size:
| Profile | vCPU | RAM | Disk | Example (AWS) | Notes |
|---|---|---|---|---|---|
| Bare minimum (core only) | 2 | 8 GB | 80 GB | t3.large | Fits the ~70 GB platform with almost no operational headroom. Slow and swappy. |
| Recommended (core + real scans, no GVM) | 4 | 16 GB | 200 GB | m5.xlarge | ~70 GB platform + ~100 GB free for your data. The sane default. |
| Full (GVM + Knowledge Base + local AI judge) | 8 | 32 GB | 250 GB | m5.2xlarge | ~95 GB platform + ~100 GB operational. Needed for the heavy features. |
Disk sizing. The fixed platform footprint is ~70 GB without GVM (OS ~9 GB + all built and pulled images ~44 GB after deduplicating shared Kali base layers + build cache ~15-20 GB) and ~95 GB with GVM (its images plus the vulnerability-feed volumes/DB add ~20-25 GB and keep growing on feed updates). On top of that, plan for ~100 GB of free space for operational data - the Neo4j attack graph, scan artifacts/outputs and Postgres grow as you use it, and so do the saved logs in
./logs, up toLOGS_QUOTA_GB(20 GB unless set; Docker's own copy of each container's output stops at 30 MB). So: 200 GB without GVM, 250 GB with GVM, each leaving about 100 GB free for operations. gp3-style volumes resize online, so you can start smaller and grow in place; setDOCKER_BUILD_CACHE_MAX_GBso the build cache can't slowly eat that headroom.
RAM is checked at start. RedAmon refuses to start when the memory Docker can use does not cover the minimum of every service the profile runs (the memory allocator's per-service floors): about 6.1 GB for the core stack and about 9.4 GB with GVM, at the default reserves, including room in the scan pool for one Kali sandbox. If you must run on something smaller, you can override the check (see Troubleshooting), but expect it to be painful.
A DNS name like redamon.example.com with its A record pointing at your server's IP. This gets you a real, browser-trusted HTTPS certificate automatically (via Let's Encrypt), which is the default and by far the smoothest path.
No domain? You can still deploy on a bare IP, but you'll get a browser certificate warning (self-signed TLS). See Access modes.
Set up the DNS record before you deploy - Let's Encrypt validates the certificate by looking up your domain, so it has to resolve first.
bash, ssh, scp, and curl. Almost every Linux and macOS machine already has these. (Only if you insist on password-based SSH do you also need sshpass - but key-based SSH is recommended and needs nothing extra.)
You'll also need the SSH key (.pem file) that lets you log into the server, and the repository checked out on your laptop.
Before deploying, configure your cloud provider's firewall (AWS Security Group, GCP firewall, Azure NSG). This is your reliable outer wall. Open exactly three ports and nothing else:
| Port | Allow from | Why |
|---|---|---|
| 443/tcp | Your IP (or 0.0.0.0/0 if you trust the built-in gate) |
The RedAmon app (HTTPS) |
| 80/tcp | 0.0.0.0/0 |
Required so Let's Encrypt can issue your certificate, and to redirect visitors to HTTPS |
| 22/tcp | Your IP only | SSH management |
Do not open anything else. In particular, never open
8090,3000,5432,7687,7474or11434(the AI attack-surface judge), nor a port of the Kali sandboxes' reverse-shell pool outside./deploy.sh revshell-open. Those are internal services that stay locked to the server's own loopback interface. Your browser reaches everything it needs through port 443. Opening the others would defeat the entire security design.
On your laptop, from the repository root:
cd tooling/deploy/single-host
cp .env.example .envNow open .env in your editor. It's long, but for a standard HTTPS-on-a-domain deployment you only need to fill in a handful of fields. Here's a minimal, working example:
# --- how to reach the server ---
HOST_IP=203.0.113.50 # your server's public IP
REMOTE_USER=ubuntu # the SSH user (ubuntu on most cloud images)
SSH_KEY_PATH=~/.ssh/redamon.pem # your SSH key
# --- how the app is exposed ---
ACCESS_MODE=https-domain # the recommended default
DOMAIN=redamon.example.com # your domain (A record -> HOST_IP)
TLS_MODE=letsencrypt # free, browser-trusted certificate
LETSENCRYPT_EMAIL=you@example.com # for certificate renewal notices
# --- who can reach it ---
OPERATOR_ALLOW_CIDRS=203.0.113.10/32 # YOUR IP; only these can open the app
# --- the first login ---
ADMIN_NAME=Your Name
ADMIN_EMAIL=you@example.com
ADMIN_PASSWORD=<a-long-strong-password>That's enough for a secure, TLS-protected instance. A few notes on the important fields:
-
OPERATOR_ALLOW_CIDRSis your access list. Only these IP ranges can even see the login page. Set it to your office/home IP (e.g.203.0.113.10/32for a single address). You can list several, comma-separated. Leave it wide (0.0.0.0/0) only if you deliberately want the login page reachable from anywhere. -
ADMIN_PASSWORDmust be 12 characters to 72 bytes (initrefuses anything else, because bcrypt reads no further than 72 bytes), and should be long and random. The app locks an email after 5 failed sign-ins in 15 minutes (a browser that signed in to it before keeps signing in), and nginx rate-limits the login route, but a weak admin password is still a real risk. -
SSH_KEY_PATHstays on your laptop and is never copied to the server.
Every other variable has a sensible default. When you need to tune something - extra features, custom TLS, tighter hardening, a non-standard SSH port - the Complete .env reference further down this page explains every single variable in detail.
These are off by default because they add build time and RAM pressure. Flip them to true in .env only if you have the capacity for them:
| Set | To enable | Cost |
|---|---|---|
ENABLE_GVM=true |
The GVM / OpenVAS vulnerability scanner | +10-20 min feed sync on first boot; needs the Full profile |
ENABLE_KB=true |
The local Knowledge Base (semantic search) | +~4.4 GB image, more RAM |
LLM API keys are not set here. You configure your AI provider keys inside the app after logging in - see AI Model Providers and Global Settings.
Still in tooling/deploy/single-host, run:
./deploy.sh initThe tool asks you to type INIT to confirm. This is a from-scratch build, and the wipe is total: it erases every Docker container, image, volume, and network on the server - not just RedAmon's. On a fresh, dedicated box that's exactly what you want; do not point init at a server that already runs other Docker workloads you care about. Once confirmed, it works through:
- Host bootstrap - installs Docker (upgrading an Engine older than 28.0.0), nginx, certbot, the firewall, swap, and so on.
- Hardening - locks down SSH and the host firewall.
- Clone & build - pulls the code onto the server and builds all the images. This is the slow part: 30-60 minutes the first time, because of the large Kali and agent images. Grab a coffee.
-
First admin - creates the login account from your
.env. - nginx + TLS - issues your HTTPS certificate and stands up the reverse proxy.
-
Verification - confirms internal services are locked to loopback, containers are healthy, and
https://<domain>/api/healthreturns OK.
Preview without touching anything. Run
DRY_RUN=true ./deploy.sh initfirst to see exactly what the tool would do, without changing the server.
Want to watch the details? Add
VERBOSE=truein front of the command to stream the full remote output.
When init finishes, open https://<your-domain>/ in a browser (from an IP that's in your OPERATOR_ALLOW_CIDRS) and sign in with the admin email and password you set.
From here, the rest of the wiki takes over:
- Identity & Access Management - add teammates
- Creating a Project - set up your first target
- Running Reconnaissance - run a scan
- AI Model Providers - plug in your LLM keys
ACCESS_MODE is the master switch for how the app is exposed. In almost all cases you want the first one.
| Mode | When to use it | TLS |
|---|---|---|
https-domain ✅ |
You have a domain. The default and recommended choice. | Free Let's Encrypt cert (TLS_MODE=letsencrypt) |
https-ip |
Bare IP, no domain, but you still want encryption | Self-signed (browser warning) or your own provided cert |
http-domain / http-ip
|
Lab/testing only - no encryption at all | None |
Avoid the
http-*modes on any real server. They send passwords and session cookies in plaintext and turn off the security headers. They're gated behindALLOW_INSECURE=1and a loud warning for exactly that reason. Only use them on a throwaway lab box you control end-to-end.
Using your own certificate? Set TLS_MODE=provided, drop fullchain.pem and privkey.pem into the cert/ folder, and the tool ships them to the server for you. This is the way to get a trusted certificate on a bare IP.
This is the full configuration surface, grouped exactly as it appears in .env.example. For a first deployment you only touch the handful in Step 2; everything else has a working default. Two things apply across the whole file:
-
CLI positionals override the connection fields.
./deploy.sh init 1.2.3.4 ~/.ssh/key.pem ubuntuoverridesHOST_IP,SSH_KEY_PATH, andREMOTE_USERfor that run. -
Multiple instances: keep one config per instance (
.env.prod,.env.staging,.env.<client>) and select it with--env NAME.
| Variable | Default | Detail |
|---|---|---|
HOST_IP |
(required) | Public IP or DNS name of the target server. This is where deploy.sh connects over SSH, and - in the *-ip access modes - the public address browsers use. It stays on your laptop and is never written to the server. Overridable as the first CLI positional. |
REMOTE_USER |
ubuntu |
The SSH login user. It must be able to run sudo (ideally passwordless). ubuntu is right for most AWS/cloud Ubuntu images; use admin, debian, or another sudoer as your image dictates. |
SSH_KEY_PATH |
~/.ssh/redamon.pem |
Path to your private SSH key. The recommended auth method. ~ is expanded. The key never leaves your laptop - it is not copied to the server. Overridable as the second CLI positional. |
SSH_PASSWORD |
(empty) | Password-auth fallback. Requires sshpass installed locally. Discouraged - and note that deploying over a password makes the hardening step leave password login enabled (so you can't lock yourself out), which is weaker. Prefer a key. |
SSH_PORT |
22 |
The port the server's sshd actually listens on. This value is shipped to the host: it drives both the ufw allow-rule for SSH and the fail2ban [sshd] jail. If your server moved SSH to a non-standard port, set this to match - otherwise the firewall could lock you out. |
| Variable | Default | Detail |
|---|---|---|
REPO_URL |
https://github.com/samugit83/redamon.git |
The public git URL cloned onto the server. The install then fetches its redamon.wiki submodule, the documentation AI Navigator answers from, and ./redamon.sh update keeps it current; if the fetch fails the deploy goes on and only AI Navigator's documentation answers are missing. No access token is needed. Point it at your own fork if you deploy custom code. |
REPO_BRANCH |
master |
The branch to deploy. ./deploy.sh update pulls this branch's latest commit. |
APP_DIR |
redamon |
The checkout directory name on the server (under the remote user's home). It also fixes COMPOSE_PROJECT_NAME, which RedAmon uses to recognize your existing database volumes and preserve their passwords. Never change it between init and update - doing so orphans your data volumes, and RedAmon would treat the instance as brand new. |
REDAMON_VERSION |
(empty) | An optional version string stamped into the built images for traceability. Blank uses RedAmon's own default. Cosmetic - it doesn't change behavior. |
| Variable | Default | Detail |
|---|---|---|
ACCESS_MODE |
https-domain |
The master switch: https-domain | https-ip | http-domain | http-ip. It derives the public host, the nginx listeners, the WebSocket scheme (wss/ws), and whether Secure cookies + HSTS are on. See Access modes. The two http-* values are lab-only and refuse to run without ALLOW_INSECURE=1. |
DOMAIN |
redamon.example.com |
Your DNS name. Required for the *-domain modes, ignored for *-ip. Its A record must resolve to HOST_IP before you deploy, because Let's Encrypt validates it. |
HTTP_PORT |
80 |
The port nginx listens on for HTTP and that ufw opens. Keep it 80 when using Let's Encrypt - the ACME http-01 challenge always validates on port 80. Change it only when another load balancer/proxy sits in front and presents 80/443 to clients itself. |
HTTPS_PORT |
443 |
The HTTPS port nginx listens on and ufw opens. Same caveat as HTTP_PORT: only change it behind a fronting load balancer. |
TLS_MODE |
letsencrypt |
How the certificate is obtained. letsencrypt (domain only; free, browser-trusted, auto-renewing) | provided (you supply the cert) | self-signed (IP only; generated on the host, browser warning expected). Consulted only for https-* modes. |
LETSENCRYPT_EMAIL |
ops@example.com |
Required for letsencrypt. Used for certbot registration and expiry/renewal notices. Use a mailbox you actually read. |
LETSENCRYPT_STAGING |
false |
Set true to issue against Let's Encrypt's staging CA while testing. Staging certs aren't browser-trusted, but they dodge the production limit of 5 certificates per week - invaluable while you iterate on DNS/firewall. Flip back to false for the real certificate. |
SSL_CERT_LOCAL |
cert/fullchain.pem |
provided mode only: local path (relative to tooling/deploy/single-host) to your full-chain certificate. It's SCP'd to /etc/ssl/redamon/ on the host, idempotently (by md5). Drop your files in the cert/ folder. |
SSL_KEY_LOCAL |
cert/privkey.pem |
provided mode only: local path to your private key. Copied to the host with 600 permissions. |
SSL_KEY_PASSWORD |
(empty) | The passphrase, if your provided private key is encrypted. |
HSTS_ENABLE |
true |
Emit the Strict-Transport-Security header on HTTPS, telling browsers to only ever use HTTPS for your domain. Automatically absent in the http-* modes. Leave it on for any real deployment. |
| Variable | Default | Detail |
|---|---|---|
OPERATOR_ALLOW_CIDRS |
203.0.113.10/32 |
A comma-separated CIDR list that does double duty: it's the nginx allow-gate (only these sources see the app) and the ufw source for port 443. Scope it to your own IP ranges. Using 0.0.0.0/0 means the login page is reachable from anywhere and you rely on the login + rate-limit alone. |
SSH_ALLOW_CIDRS |
(empty) | A comma-separated CIDR list for the ufw port-22 rule. If blank, it falls back to OPERATOR_ALLOW_CIDRS. Set it separately when you administer over SSH from a different location than you browse the app. |
GATE_MODE |
ip_allowlist |
How nginx gates the app: ip_allowlist (recommended - uses OPERATOR_ALLOW_CIDRS) | basic_auth (an HTTP Basic auth prompt in front of everything) | none (no edge gate; rely on the app login only). |
BASIC_AUTH_USER |
(empty) | Required when GATE_MODE=basic_auth: the username nginx demands before the app loads. |
BASIC_AUTH_PASS |
(empty) | Required when GATE_MODE=basic_auth: the matching password. |
WS_REQUIRE_SESSION |
true |
Makes nginx run an auth_request that validates a logged-in webapp session cookie before allowing any /ws/* WebSocket upgrade. This sits in front of the app-layer signed ws-ticket as a second layer. Keep it on - the agent WebSockets include a root PTY. |
CSP_ENFORCE |
false |
false runs the Content-Security-Policy in Report-Only mode (computed and reported, but nothing is blocked - the safe default). Set true to actually enforce the CSP, but only after confirming the WebGL attack-surface graph and the xterm terminal still render correctly. |
ENABLE_UFW |
true |
The host firewall (ufw). Leave on - it's a core part of the loopback-only posture. |
ENABLE_SSH_HARDENING |
true |
Enforce key-only login and disable root SSH. Safety valve: if you deployed over a password, it will not disable password login (so you can't be locked out). Install a key and re-run harden over it to fully close password auth. |
ENABLE_FAIL2BAN |
true |
Enable fail2ban jails for sshd and nginx that ban IPs after repeated failures. |
ENABLE_UNATTENDED_UPGRADES |
true |
Enable automatic, unattended installation of host security updates. |
| Variable | Default | Detail |
|---|---|---|
ENABLE_GVM |
false |
Maps to install --gvm. Turns on the GVM/OpenVAS vulnerability scanner. Heavy: expect a 10-20 min feed sync on first boot before scans return anything, and plan for the Full sizing profile. The deploy rotates GVM's default admin/admin credentials and prints the new password once - capture it. |
ENABLE_KB |
false |
Maps to install --kbase. The real Knowledge Base switch: it bakes ML embedding models into the image (+~4.4 GB) and enables semantic search over your KB. |
ENABLE_KB_REFRESH |
false |
Enables the kb-refresh sidecar that periodically refreshes Knowledge Base content. |
ENABLE_ZRAM |
true |
Maps to REDAMON_ENABLE_ZRAM=1. Enables a compressed-RAM (zram) cushion that helps memory-tight hosts survive spikes. |
SKIP_KBis deliberately not a variable you set. RedAmon derives it from the.kbase-enabledflag it manages internally. Control the Knowledge Base withENABLE_KBonly.
| Variable | Default | Detail |
|---|---|---|
SWAP_PCT |
25 |
Swapfile as a percentage of host RAM, created at any size. 25% is the threshold that unlocks the memory governor's higher burst factor, so leaving it on buys you headroom as well as OOM protection. 0 skips. |
SWAP_SIZE_GB |
(unset) | Deprecated explicit override in GB. Blank uses SWAP_PCT. |
REDAMON_SKIP_RAM_GATE |
false |
true bypasses RedAmon's start-up memory check (the services' minimums) so it will boot on an undersized box. Risky; if you use it, keep SWAP_SIZE_GB on and expect heavy swapping. |
REDAMON_BUILD_PARALLEL |
(empty) | Caps how many container images build concurrently. Blank lets RedAmon auto-size from the host's CPU/RAM. Lower it (e.g. 1 or 2) if the build itself runs out of memory. |
DOCKER_DNS |
(empty) | Comma-separated resolvers (e.g. 8.8.8.8,8.8.4.4) merged into /etc/docker/daemon.json. Set this only if container DNS resolution is broken on your host; otherwise leave it blank. |
DOCKER_BUILD_CACHE_MAX_GB |
(empty) | Ceiling (GB) for the Docker BuildKit build cache, applied as builder.gc.defaultKeepStorage in /etc/docker/daemon.json so the daemon auto-garbage-collects the cache to that size. install/update already drop the cache each build orphans (a plain docker builder prune -f after every successful build, so incremental rebuilds stay fast), which bounds the growth RedAmon itself causes. This ceiling is the second line of defence, covering cache the daemon accumulates outside those builds. Set e.g. 30 to bound the total without slowing rebuilds (the cap only evicts the least-useful layers). Blank leaves Docker's default GC. Changing it triggers a one-time docker restart during bootstrap. |
| Variable | Default | Detail |
|---|---|---|
REVSHELL_TARGET_CIDRS |
(empty) | The Rules-of-Engagement target scope for ./deploy.sh revshell-open. It scopes the temporary ufw rule for the reverse-shell pool's ports to just these CIDRs. Empty means the pool stays fully closed. See Catching reverse shells. |
KALI_SANDBOX_PORT_POOL |
(empty) |
first-last host ports for direct reverse shells: each running Kali sandbox (one per person) gets one, published on 127.0.0.1 only. The deploy refuses a pool bound on any other address, starting below 1024, holding more than 100 ports, or covering a port the server already serves (SSH, HTTP, HTTPS, 5432, 7474, 7687, 8010, 4444, 11434 and every port the compose files publish). It is reached from outside only through revshell-open. Empty: no pool (init and update remove the key from the server's .env), and a reverse shell needs the person's own tunnel. |
KALI_SANDBOX_MAX_CONCURRENT |
(empty) | A hard count of running Kali sandboxes (each reserves 1 GiB), a whole number (0 blocks every new one; the deploy refuses anything else before it touches the server). Advised on a server several people use. Empty: init and update remove the key from the server, and memory decides. |
KALI_SANDBOX_IDLE_MINUTES |
(empty) | Minutes without use before a person's Kali sandbox stops, a whole number of at least 1 (the deploy refuses anything else). Empty: init and update remove the key from the server, and the default, 20, holds. |
KALI_SANDBOX_PORT_HOLD_HOURS |
(empty) | Hours a stopped sandbox's pool port stays its person's: nobody else gets it, and their next sandbox gets it back, so a late callback never lands in another person's sandbox. A whole number (0: freed at once; the deploy refuses anything else). Empty: init and update remove the key from the server, and the default, 24, holds. |
TUNNELS_ENABLED |
false |
Unused: the deploy still writes it to the server .env, but nothing reads it. Tunnels (ngrok, chisel) are per person, each in that person's own Kali sandbox, turned on in Settings → Tunneling by whoever holds the Tunnels permission (platform:tunnels). |
| Variable | Default | Detail |
|---|---|---|
ADMIN_NAME |
(required) | Display name of the first admin user, created automatically during init. |
ADMIN_EMAIL |
(required) | Login email of the first admin, who is the instance's Root. With RBAC_IDENTITY_ENABLED=true in the server's app .env, every update confirms the admin this email names as Root when it cannot ask (it has no terminal). |
ADMIN_PASSWORD |
(required) | The first admin's password: 12 characters to 72 bytes (init refuses anything else; bcrypt reads no further than 72 bytes); make it long and random. The app locks an email for 15 minutes after 5 failed sign-ins (a browser that signed in to it before keeps signing in), and nginx's limit_req rate-limits the login route. |
| Variable | Default | Detail |
|---|---|---|
NVD_API_KEY |
(empty) | An NVD API key. Grants a higher rate limit for CVE/NVD lookups, so vulnerability enrichment runs faster. |
KB_EMBEDDING_USE_API |
(empty) | Set to use a remote embedding API instead of the baked-in local model. Lets you skip the +4.4 GB model image and offload embeddings to a service. |
KB_EMBEDDING_API_BASE_URL |
(empty) | Base URL of that remote embedding API. |
KB_EMBEDDING_API_KEY |
(empty) | Auth key for the remote embedding API. |
WORKSPACE_URL_IMPORT_ENABLED |
(empty = on) |
false turns off Import from URL in the Agent Workspace for every user; folder and archive uploads stay. While it is on, the server fetches the public URLs a signed-in user names (private, loopback and metadata addresses are always refused). A change reaches the running agent on the next update. |
LOGS_QUOTA_GB |
(empty = 20) | Quota in GB on ./logs, every project's saved scan, agent, Triage and CodeFix logs: past it the hourly sweep deletes the oldest finished logs of the project using the most space. 0 = no quota. Empty keeps the server's value. Lower it on a small disk. A change reaches the running orchestrator on the next update. |
LLM provider keys are not set here. Configure your AI provider credentials inside the app after logging in - see AI Model Providers and Global Settings.
| Variable | Default | Detail |
|---|---|---|
INIT_FORCE |
false |
true skips the typed INIT wipe confirmation. CI only, dangerous - it removes the last guard before a total Docker wipe. Never set it interactively. |
BACKUP_BEFORE_UPDATE |
false |
Reserved for a pre-update database snapshot (Postgres dump + Neo4j snapshot). Currently a placeholder flag. |
DRY_RUN |
false |
true prints the fully resolved plan and exits without touching the host. Run DRY_RUN=true ./deploy.sh init to preview exactly what will happen. |
VERBOSE |
false |
true streams the full remote command output instead of the summarized progress view. Useful when a step fails and you need to see why. |
ALLOW_INSECURE |
0 |
Must be 1 to permit the plaintext http-* access modes. A guardrail: those modes invert the whole security posture (plaintext cookies/credentials, no HSTS), so they refuse to run without this explicit opt-in. |
All of these run from your laptop, from the same tooling/deploy/single-host directory. None of them (except init) touch your data - all your projects, scans, reports, and graph data live in Docker volumes that survive updates.
| Command | What it does |
|---|---|
./deploy.sh update |
Pull the latest code and rebuild only what changed. Keeps all your data. Its closing check (which init runs too) also lists the running Kali sandboxes, reports an error while the old shared redamon-kali container still runs (a completed update removes it; the error says what to run when one did not), and warns when the Kali image was not rebuilt for per-user sandboxes. |
./deploy.sh status |
Health check: containers, firewall, nginx config, certificate expiry. |
./deploy.sh logs [service] |
Tail live logs of a compose service (defaults to the agent service, e.g. ./deploy.sh logs webapp). A person's Kali sandbox is not a compose service: on the server, docker ps --filter label=redamon.sandbox=1 lists the sandboxes and docker logs <name> reads one. |
./deploy.sh ssl-renew |
Renew or re-install the TLS certificate and reload nginx. |
./deploy.sh harden |
Re-apply host hardening + nginx/TLS only, without rebuilding. |
./deploy.sh down |
Stop the stack (keeps all data and images). |
Managing more than one instance? Keep separate config files like
.env.prodand.env.staging, and select one with--env, e.g../deploy.sh status --env staging.
One rule that matters: never SSH into the server and run
docker compose upby hand. That reloads the wrong configuration and would republish the internal ports on the public interface, and it starts the webapp without its plugin network, so every plugin action fails. Always go through./deploy.sh. (The same applies toredamon.sh up devon the host - it hardcodes its own compose files and defeats the production overlay.)
./deploy.sh update is the routine you'll use most. It pulls the latest commit of your REPO_BRANCH, then rebuilds only the images that actually changed. It is non-destructive: all your engagement data - Postgres, Neo4j, reports, GVM feeds, embedding models - lives in named Docker volumes that survive the update untouched. Database passwords are preserved too, because RedAmon detects the existing volumes by the stable COMPOSE_PROJECT_NAME (which is why you must never change APP_DIR between runs).
What update does under the hood: the deploy applies three small code changes to the checkout on the server at deploy time (they aren't committed to the app source): the baked single-origin WebSocket URL, a WebSocket-origin fix for CypherFix, and the Secure-cookie flip for HTTPS. Before pulling, update restores those files so the tree fast-forwards cleanly, runs the pull + selective rebuild, then re-applies the patches and rebuilds the webapp image so the single-origin URL and Secure-cookie behavior survive. Finally it re-renders the nginx config.
One-off data fixes run with the update. When a release changes how something is stored, update brings the data already in your volumes up to date, once: for example the urlscan backfill masks the urlscan tokens earlier releases stored in clear, in the graph and in every recon JSON file. Each job logs counts, never a value, and a failed one never fails the update: it says so and can be run again by hand. An update with nothing new to pull does not retry it, so check the update log for "urlscan backfill skipped" or "did not finish".
The update that brings Tradecraft 2.0 deletes one volume, once: redamon_tradecraft_cache, where the previous Tradecraft kept the pages it downloaded (derived data it could download again; nothing reads it any more). A volume still in use only warns: the removal runs again at the next update that brings changes (like the backfill, an update with nothing new to pull does not retry it), or remove it by hand on the server once no container uses it: docker volume rm redamon_tradecraft_cache, then touch ~/<APP_DIR>/.tradecraft-cache-removed. To keep it, create the marker .tradecraft-cache-removed in the checkout on the server before updating (touch ~/<APP_DIR>/.tradecraft-cache-removed). Your Tradecraft resources themselves are in Postgres and are converted at the agent's first start; see Tradecraft Lookup.
The update onto 8.0.0 makes the logs folder. It creates ./logs in the checkout on the server before the stack restarts, and moves the MCP presets' data (agentic/logs/mcp_memory.json and agentic/logs/sandbox/) into agentic/mcp-data. Docker made agentic/logs as root, so that move runs as root in a throwaway alpine container; if the update log warns Could not move agentic/logs/... instead, run the sudo mv it prints, or a saved Memory, Filesystem or SQLite MCP server starts empty. The old agent logs left in agentic/logs are no longer read. The KB refresh sidecar (ENABLE_KB_REFRESH) is not recreated by update: run docker compose --profile kb-refresh up -d --no-deps kb-refresh in the checkout on the server to give it the new image and the bounded Docker logs.
The update shows what it changes for your accounts. When an update rebuilds the webapp, redamon.sh update prints a read-only report before anything restarts: which members keep which shared tool as a legacy grant, the tunnel rows, members' stdio MCP servers that will stop running, and whether SCANNER_API_KEY is set (see Shared Tools and Legacy Access). ./deploy.sh update runs without a terminal, so it prints the report and goes on; to read it first, run ./redamon.sh update --preview in the checkout on the server, which pulls and builds but restarts nothing. Scan containers no longer receive INTERNAL_API_KEY: they need SCANNER_API_KEY, which the update generates when it is missing, and a scan start answers 503 scanner_key_missing without it. A scan that was running during the update may fail its next call back to the webapp: start it again. The report also names who will be Root and which accounts the instance settings (tunnel, TrafficMind) are copied from.
The identity controls. Root, account status, invites and the shorter admin sessions follow RBAC_IDENTITY_ENABLED, which deploy.sh does not set. redamon.sh writes it to the app's .env on the server (~/<APP_DIR>/.env) as true, next to the other four switches (RBAC_PERMISSIONS_ENABLED, RBAC_SHARING_ENABLED, RBAC_SHARING_WRITE_ENABLED, RBAC_GOVERNANCE_ENABLED), whenever a line is missing or blank, so they are on from the first deploy, and the update that brings this release turns them on on an older server. No project is shared until Root turns the sharing policy on in the IAM console. A value already in that file is kept. That update confirms Root: the only admin, or the one your deploy .env's ADMIN_EMAIL names (otherwise it leaves Root unconfirmed and says so; run ./redamon.sh set-root <email> in the checkout on the server). Invite and reset links then point at the public address the deploy set up (https://<your-domain> in a domain mode) until Root sets another one. Invitees open those links through the same firewall and nginx gate as you: add their addresses to OPERATOR_ALLOW_CIDRS (and, with GATE_MODE=basic_auth, give them the Basic-auth login) before you send an invite, or the link never reaches the app. To turn them off, set RBAC_IDENTITY_ENABLED=false in that file and run ./deploy.sh update; every later update keeps it.
Docker Engine 28.0.0 or newer. RedAmon refuses to build or start on an older engine. ./deploy.sh update brings Docker Engine and Compose up to date itself, before the pull (the same step init and harden run, and a no-op on a current server), so a server set up on an older Docker needs nothing extra.
Rollback is manual. There is no one-command rollback, and ./deploy.sh update cannot do one: it runs redamon.sh update, which first pulls your branch forward again, so a checkout reset to an older commit comes straight back to the newest one. Going back means checking out the older commit and rebuilding it with ./redamon.sh install, as Going back to 7.7.2 after the RBAC release shows. Your engagement data is in volumes, but every release's first start runs prisma db push --accept-data-loss against its own schema: the database is made to match the older release, and whatever that release does not know is dropped. Back up before any downgrade.
Back up before big changes.
BACKUP_BEFORE_UPDATEis currently a reserved placeholder, so take your own snapshot before a risky update: apg_dumpof Postgres and a Neo4j dump from inside their containers, or a provider-level disk snapshot of the whole server. Keep the server.env'sREDAMON_SECRET_HMAC_KEYwith a Neo4j dump: restored under a different key (for example on a re-initialised server), every urlscan Secret gets a new id at the next scan, and its mute or Priority Board verdict stays on the old node.
The release with Root, permission sets, sharing and the IAM console adds 16 tables and 28 columns to the database. RedAmon 7.7.2 does not ignore them: its first start runs prisma db push --accept-data-loss against its own schema, which drops every one of them with its data (the upgrade test suite checks this on every scenario). The graph, your projects, scans, reports and conversations stay.
What changes on 7.7.2. It has two account types, admins (everything) and members, and none of the new data:
- Shares are gone: every shared project is private to its owner again, and so is every shared conversation. Transfer offers and owners' consents are gone; a transfer already completed stays done.
- Permission sets, overrides and admin profiles are gone: a member on a narrower set (even No access) or with a denied permission, and an admin with a profile, get the full rights of their account type. Every member can use the five shared tools again (the Kali terminal, every user's shell sessions, the tunnel settings, the instance-wide emergency stop, every Nuclei template), and every admin can manage the other admins.
- A disabled or invited account still cannot sign in (it has no password), but the password held for re-enabling it is lost, and so are invite and reset links.
- A session revoked since the upgrade (a revoked device, a sign-out everywhere, a disabled account) is valid again until it expires, because 7.7.2 checks neither: give
AUTH_SECRETa new value (step 5). - Instance LLM providers and their keys are gone. 7.7.2 sends a model id it does not know to OpenAI with the project owner's key, so the
instance/...model ids are reset first (step 4). - Root, the instance settings (security policy, public address, sharing policy, quotas, audit retention), device sessions, plugin allowlists and the new audit columns go too; the audit rows stay. Two project settings added since 7.7.2 by other work go as well: the hostname policy of IP-mode projects and Naabu's run timeout.
On an install (./redamon.sh), from the RedAmon folder:
- Read what the downgrade would drop. The report is read-only: every table and column with its rows, the accounts whose rights change, the accounts that cannot sign in, the revoked sessions and the projects on an instance model:
docker compose exec webapp node scripts/rbac-upgrade-preview.mjs --downgrade - Back up the database, and keep a copy of
.env:docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc' > redamon-before-downgrade.dump cp .env .env.before-downgrade
- Turn the RBAC switches off: delete the
RBAC_*_ENABLEDlines from.env(or set them tofalse), run./redamon.sh up, thendocker compose restart agent. The install now runs on the account rows alone, as 7.7.2 will, and writes no new RBAC data while you finish. - Reset every
instance/...model id (projects, the models accounts remember for new projects, tradecraft resources, saved presets) to the default a new row gets; their owners pick a model again on 7.7.2:docker compose exec -T webapp node scripts/rbac-upgrade-preview.mjs --downgrade-sql \ | docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -v ON_ERROR_STOP=1'
- When the report lists a revoked session or an account signed out everywhere, give
AUTH_SECRETa new value (everyone signs in again after the downgrade):sed -i "s|^AUTH_SECRET=.*|AUTH_SECRET=$(openssl rand -hex 32)|" .env - Run the report of step 1 again: the instance models are gone from it. What it still lists is what the next step deletes; this is the last point to stop.
- Check out 7.7.2 and rebuild it.
./redamon.sh updatecannot do this step (it pulls the newest release first);installrebuilds every image of the checked-out release and starts it, and keeps.envand the volumes. Pass the flags you installed with (--gvm,--kbase):git fetch origin git checkout --detach 442debbf # the 7.7.2 release commit ./redamon.sh install - On 7.7.2, review the members who now have the shared tools, and delete the disabled and invited accounts you do not want back.
On a single-host deploy (deploy.sh) there is no downgrade command: ./deploy.sh update always moves the code forward. Take a disk snapshot of the server first (step 2 is still worth doing). Run steps 1 to 6 over SSH in ~/<APP_DIR>, editing the server's .env there, and recreate the webapp after step 3 with ./deploy.sh update from your laptop (it also pulls any newer commit of your branch, so read the report after it). For step 7, on the server, export what the deploy passes to its own install, then check out and install:
export COMPOSE_FILE="docker-compose.yml:$HOME/.redamon-deploy/docker-compose.prod.yml"
export DOMAIN=<your domain> WEBAPP_NODE_ENV=production
export NEXT_PUBLIC_AGENT_WS_URL=wss://<your host>/ws/agent AGENT_CORS_ORIGINS=https://<your host> # ws:// and http:// without TLS
git fetch origin 442debbf95ff6f4cace7f9f8e134780aa3eb7d60 && git checkout --detach FETCH_HEAD
./redamon.sh install # plus --gvm / --kbase when ENABLE_GVM / ENABLE_KB are onthen run ./deploy.sh harden from your laptop to re-apply nginx and the host hardening. 7.7.2's own compose file publishes its shared Kali container's 4444 on every address, past ufw; the overlay in ~/.redamon-deploy keeps it off the public interface whichever release your laptop's checkout is on: before per-user Kali sandboxes it re-binds 4444 to loopback, and from that release on it gives the container no host port at all. In that second case 7.7.2's revshell-open has no 4444 to forward: catch reverse shells through a tunnel, or put your laptop's checkout on 7.7.2 too, run ./deploy.sh harden from it, then ./redamon.sh up on the server with the exports above, so the container takes 7.7.2's overlay. Several webapp copies sharing one database are downgraded together: stop every copy before step 7, since a copy of the new release left running fails on the dropped tables, and one that restarts creates them again.
Upgrading again later. Check out the release again (git checkout master) and run ./redamon.sh install with the same flags: update would find the checkout already up to date. The first start creates the tables and columns empty, and the RBAC backfills run again, because each one skips only when its marker and its data are there and the downgrade left only the marker: Root is chosen again among the admins, unconfirmed (./redamon.sh set-root <email> confirms it), the instance settings are copied again from the accounts' rows (kept in sync while the release ran), and members who existed at the first upgrade get their legacy grants again, minus those an admin removed. Shares, sets, overrides and instance providers start empty. Disabled and invited accounts come back active, still without a password: set one with ./redamon.sh reset-password, or disable them again. To get everything back instead, restore the backup before upgrading; you lose what changed on 7.7.2:
docker compose stop webapp
docker compose exec -T postgres sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" --clean --if-exists' < redamon-before-downgrade.dumpYou don't need this to deploy, but it demystifies what the one command is doing.
deploy.sh is a thin remote driver around RedAmon's own redamon.sh. It doesn't reimplement RedAmon - it prepares a bare host, gets the repo onto it, and drives redamon.sh install/update over SSH, then wraps the result in the internet-facing security layer (nginx + TLS + firewall + hardening) that redamon.sh deliberately omits because RedAmon is designed to run local-only. It never edits redamon.sh; it steers it through four channels: the subcommand, CLI flags on install, exported environment variables, and keys appended to the server-side application .env.
The host is bootstrapped dynamically. On init (and harden; update runs only its Docker step, before the pull), the deploy runs a detect-and-install matrix - each item is probed and installed only if missing or too old, idempotently: base packages (git, openssl, curl, jq, expect…), Docker Engine + Compose v2 from Docker's official repo (installed or upgraded when the Engine is older than 28.0.0 or Compose older than 2.24, purging any old docker.io/v1 compose first; the bootstrap stops if either is still too old afterwards, because RedAmon's plugin networks need Engine 28.0.0 and the prod overlay needs Compose 2.24), the docker service and group membership, nginx, certbot (only when Let's Encrypt is used), ufw, fail2ban, unattended-upgrades, a swapfile sized at SWAP_PCT of RAM (any host size), optional Docker DNS, and raised inotify limits. Nothing is assumed to be pre-installed, which is why you can point it at a stock Ubuntu image.
nginx runs on the host, not in a container, and only at the edge. It listens on 80/443 and reverse-proxies to two loopback backends: the webapp (127.0.0.1:3000, serving / and /api/*) and the agent (127.0.0.1:8090, serving only the four /ws/* WebSocket paths - never any agent REST route). It is not a middlebox between containers: all internal service-to-service traffic (webapp ↔ agent ↔ orchestrator ↔ databases ↔ Kali) flows directly over the Docker bridge networks and never passes through nginx. That's the whole reason only port 443 needs to be public - the browser reaches the agent's WebSockets at wss://<domain>/ws/… on 443, and nginx forwards them to 127.0.0.1:8090 internally.
The prod overlay makes the loopback binds stick. The deploy ships a production compose overlay and points redamon.sh at it via a sticky COMPOSE_FILE. That overlay is what rebinds 3000/8090 to 127.0.0.1. It holds only while that overlay is active - which is exactly why a bare docker compose up (or redamon.sh up dev) on the host is forbidden: it would reload the base file and republish those ports on 0.0.0.0.
No reverse-shell port is open by default: every person's Kali sandbox runs on its own private network and publishes nothing. To catch direct reverse shells during an authorized engagement, give the sandboxes a loopback port pool (one port per running sandbox), scope it to your target's IP range, and open it only for as long as you need:
# in .env, set the pool (loopback only) and your Rules-of-Engagement target scope:
KALI_SANDBOX_PORT_POOL=4500-4509
REVSHELL_TARGET_CIDRS=198.51.100.0/24
./deploy.sh update # carries the pool to the server
./deploy.sh revshell-open # one forwarder per pool port on the public IP, ufw-scoped to those targets
# ... run your engagement ...
./deploy.sh revshell-close # close it the moment you're doneEach person's LPORT is their own sandbox's pool port, which the agent uses when it prepares a reverse payload and the Sessions panel and the terminal show; it stays theirs for 24 hours after their sandbox stops (KALI_SANDBOX_PORT_HOLD_HOURS); LHOST is the server's public IP, which the agent and the project settings suggest when HOST_IP is an IP address (init and update pass it on; with a DNS name there, type it yourself), and you start the handler inside RedAmon. Without a pool, revshell-open refuses and points to each person's own tunnel; it refuses too while the server still runs another pool, or none (run ./deploy.sh update first). revshell-close also removes the single 4444 forwarder of a server opened before per-user sandboxes, and every 4444 rule that release left. The opening is deliberately fragile - a server reboot closes it automatically - so it can never be left open by accident. See Reverse Shells for how to work with the sessions themselves.
You don't need to understand the internals, but it helps to know why the "open only three ports" rule is non-negotiable. In plain terms, the deploy gives you:
- One public door. Only the webapp login (over HTTPS) is reachable from the internet. The agent API and the databases stay bound to the server's loopback interface, and the Kali sandboxes publish no port at all (only an optional reverse-shell pool, on loopback), so none of them is reachable from outside.
-
A login gate before the app even loads. Your
OPERATOR_ALLOW_CIDRSallowlist (or optional basic-auth) sits in front of everything. - A logged-in-session requirement on the agent's live connections, on top of a signed-ticket check in the app itself.
-
A hardened edge - modern TLS only, strict security headers, brute-force rate-limiting on the login endpoint, stripping of any headers a client might use to fake its identity, and the internal-only routes (
/api/internal/, the tunnel configuration) closed to the internet. - A hardened host - firewall, fail2ban, automatic security updates, and key-only SSH.
-
A secrets check that fails the deploy if any password or key, the two plugin platform secrets (
PLUGIN_RUNNER_KEY,PLUGIN_CALL_TOKEN_SECRET) included, is unset, left at a default, or shorter than 24 characters.
The one thing the tool can't do for you is your cloud provider's firewall. Docker can sometimes bypass the host firewall, so your Security Group / NSG is the reliable outer boundary. That's why Step 1 matters: open only 443, 80, and 22.
The build aborts saying it needs ~8 GB of RAM.
Your server is too small. Move to a bigger instance, or (at your own risk) set REDAMON_SKIP_RAM_GATE=true and keep swap on with SWAP_PCT=25. The deploy now refuses an undersized target before provisioning anything, so you will see this immediately rather than after a 30-60 minute build. Expect heavy swapping.
Certificate issuance (certbot) fails.
Two things must be true: your DOMAIN must resolve to the server's IP, and port 80 must be open to the world in your cloud firewall (Let's Encrypt validates from unpredictable IPs). While you're sorting it out, set LETSENCRYPT_STAGING=true to test against Let's Encrypt's staging server without burning through the weekly rate limit - then flip it back to false for the real certificate.
GVM scans return nothing right after deploy.
If you enabled ENABLE_GVM, its vulnerability feeds take 10-20 minutes to sync on first boot. Scans won't produce results until that finishes.
I locked myself out over SSH.
If you deployed using a password (rather than a key), the hardening step deliberately leaves password login enabled so you can't be locked out. Install an SSH key, then re-run ./deploy.sh harden over the key connection to fully close password login.
A deploy step failed halfway.
First look at what happened: ./deploy.sh status shows the current state, and ./deploy.sh logs <service> tails a specific container. The non-destructive commands (status, harden, ssl-renew, update) are idempotent and safe to re-run - they detect what's already done. Note that re-running init does not resume: it wipes everything and rebuilds from zero (another 30-60 min). If the build failed and your config was fine, ./deploy.sh update is usually the faster way to retry, since it rebuilds without the full wipe.
For a complete, variable-by-variable reference (every .env key, the exact security posture, the update/rollback mechanics, and the host bootstrap matrix), see the single-host deploy README in the repository.
With RedAmon live on your server:
- Identity & Access Management - invite your team
- Creating a Project - configure your first target
- Rules of Engagement - set the scope before you scan
- Global Settings - API keys and agent configuration
Getting Started
- Getting Started
- Deploying to a Server
- Identity & Access Management
- Creating a Project
- Recon Presets
- Global Settings
Core Workflow
- Red Zone
- Recon Pipeline Workflow
- Running Reconnaissance
- Scan Timeline
- AI Agent Guide
- Fireteam — Parallel Specialists
- Exploit-Path Search (LATS)
- Agent Workspace
- Wordlist Catalog
- Reverse Shells
Scanning & OSINT
- AI in the Recon Pipeline
- Adversarial AI Recon
- AI Gauntlet
- JS Reconnaissance
- GraphQL Security Testing
- Subdomain Takeover Detection
- VHost & SNI Enumeration
- TLS Certificate Grab
- Web Cache Poisoning
- Serialized Object Detection
- Route Exposure Scan
- Origin Discovery
- GVM Vulnerability Scanning
- GitHub Secret Hunting
- Secret Multiscanner
- Supply-Chain Scanning
AI & Automation
- AI Navigator
- AI Model Providers
- MCP Tool Plugins
- MCP Server
- Knowledge Base & Web Search
- Agent Skills
- Chat Skills
- White-Box Mode
- Tradecraft Library
- CVE Intel
- Playwright Browser Automation
- CypherFix — Automated Remediation
- Priority Board
- Rules of Engagement (RoE)
Plugins
HackLab
Analysis & Reporting
- Insights Dashboard
- TrafficMind
- Authenticated Session Recording
- proxy_brain — web hacking in code
- Pentest Reports
- Attack Surface Graph
- Surface Shaper
- EvoGraph — Attack Chain Evolution
- Data Export & Import
- Logs
Contributing
Reference & Help