---
title: "Deploy Kali Linux (Web Terminal for Pentesting & CTF)"
description: "Kali Linux in your browser: nmap, sqlmap, nikto, gobuster, ffuf & hydra"
category: "Other"
url: https://railway.com/deploy/kali-linux-web-terminal-for-pentesting-a
---

# Deploy Kali Linux (Web Terminal for Pentesting & CTF)

Kali Linux in your browser: nmap, sqlmap, nikto, gobuster, ffuf & hydra

**[Deploy Kali Linux (Web Terminal for Pentesting & CTF) on Railway](https://railway.com/template/kali-linux-web-terminal-for-pentesting-a)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/kali-linux-web-terminal-for-pentesting-a/manifest.json

- **Creator:** Nick K's Projects
- **Category:** Other
- **Total deploys:** 2

## Template content

### Kali Linux https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/kali-linux.svg

- **Image:** kalilinux/kali-rolling:latest
- **Start command:** `bash -c 'set +e
export DEBIAN_FRONTEND=noninteractive
BIN=/root/.local/bin; mkdir -p "$BIN" /root/workspace
export PATH="$BIN:$PATH"
if [ ! -x "$BIN/ttyd" ]; then
  echo "[boot] fetching web terminal..."
  (command -v curl >/dev/null 2>&1 || (apt-get update -qq && apt-get install -y -qq curl ca-certificates)) >/dev/null 2>&1
  ARCH=$(uname -m); case "$ARCH" in aarch64|arm64) TA=aarch64;; *) TA=x86_64;; esac
  curl -fsSL -o "$BIN/ttyd" "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.$TA" && chmod +x "$BIN/ttyd" || echo "[boot] ttyd download failed"
fi
if [ ! -f /root/.tools-installed ]; then
  echo "[boot] installing tools (first boot only, may take a few minutes)..."
  (apt-get update -qq && apt-get install -y -qq curl wget git vim nano tmux jq unzip ca-certificates python3 python3-pip nmap sqlmap nikto whatweb dnsutils whois netcat-traditional gobuster ffuf hydra wordlists) >/tmp/apt.log 2>&1 && touch /root/.tools-installed || { echo "[boot] some packages failed; see /tmp/apt.log"; tail -n 5 /tmp/apt.log; }
fi
if [ -n "$EXTRA_PACKAGES" ] && [ ! -f /root/.extra-installed ]; then
  echo "[boot] installing EXTRA_PACKAGES..."
  apt-get install -y -qq $EXTRA_PACKAGES >/tmp/extra.log 2>&1 && touch /root/.extra-installed || { echo "[boot] extra packages failed; see /tmp/extra.log"; tail -n 5 /tmp/extra.log; }
fi
touch /root/.bashrc
grep -q "railway-box" /root/.bashrc || cat >> /root/.bashrc <<"BASHRC"
# railway-box
export PATH="/root/.local/bin:$PATH"
export PS1="\[\e[1;31m\]kali@railway\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]# "
cd /root/workspace
echo "Kali Linux | nmap, sqlmap, nikto, gobuster, ffuf, hydra, whatweb ready"
BASHRC
if [ ! -x "$BIN/ttyd" ]; then echo "[boot] FATAL: web terminal binary missing; idling so you can inspect logs"; sleep infinity; fi
echo "[boot] terminal ready on port $PORT"
exec "$BIN/ttyd" -p "$PORT" -W -c "$USERNAME:$PASSWORD" -t fontSize=14 -t titleFixed="Kali Linux" bash -l'`
- **Public domain:** Yes

## Documentation

# Deploy and Host Kali Linux on Railway

Kali Linux is the industry-standard penetration-testing distribution. This template gives you an always-on Kali (rolling) box in your browser: a password-protected web terminal with the most-used recon and web-testing tools already installed — nmap, sqlmap, nikto, whatweb, gobuster, ffuf, hydra, dnsutils, whois, netcat and the standard wordlists — plus Python 3, git and tmux. Perfect for CTFs, bug-bounty recon, security courses and lab work from any device.

## About Hosting Kali Linux

The template deploys the official `kalilinux/kali-rolling` image. On boot it installs `ttyd` and the tool set (first deploy takes ~2–4 minutes), then serves a terminal on your Railway public domain protected by HTTP basic auth (`USERNAME` and a generated `PASSWORD`). `/root` is mounted on a Railway volume, so your scripts, wordlists, notes and shell history persist across restarts. Add any Kali metapackage or extra tools via `EXTRA_PACKAGES` (e.g. `kali-tools-web` or `metasploit-framework`) — they're installed on every boot. 1–2 GB RAM is plenty for recon tooling. Only test systems you are authorised to test; Railway's terms apply.

## Common Use Cases

- CTF and HackTheBox / TryHackMe practice without a local VM
- Bug-bounty recon (subdomain, port, directory and tech-stack enumeration)
- Teaching and security workshops — one URL per student
- Quick vulnerability checks with sqlmap, nikto and hydra from a cloud IP

## Dependencies for Kali Linux Hosting

- Docker image `kalilinux/kali-rolling` (tools installed on boot via apt)
- A Railway volume mounted at `/root`
- `USERNAME` + `PASSWORD` for the web terminal (password is generated — copy it from Variables)

### Implementation Details

```bash
nmap -sV -T4 target.example.com
gobuster dir -u https://target.example.com -w /usr/share/wordlists/dirb/common.txt
sqlmap -u "https://target.example.com/item?id=1" --batch
```

Install a full toolset with `EXTRA_PACKAGES=kali-linux-headless` (large; expect a longer boot). Use `tmux` to keep long scans running after closing the tab.

## Why Deploy Kali Linux on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Kali Linux on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/kali-linux-web-terminal-for-pentesting-a
