OWASP Security Shepherd Install Guide: Docker, Linux, Windows & Login
OWASP Security Shepherd Install Guide (2026)
Updated August 2026 · Local training lab

OWASP Security Shepherd Install Guide: Docker, Linux, Windows & Login

This guide shows how to build the current OWASP Security Shepherd source with Docker, keep the deliberately vulnerable environment on localhost, complete the first-run database wizard when it appears, sign in safely, and troubleshoot the most common Linux and Windows setup problems.

OWASP Security Shepherd is a configurable web and mobile application security training platform. It teaches concepts through lessons and deliberately vulnerable challenges, supports single-user practice and classroom modes, and includes scoring, user management, CTF, Open Floor, and Tournament layouts. The project is useful, but the installation needs careful isolation because the software is intentionally insecure.

What Is OWASP Security Shepherd?

Security Shepherd is an OWASP training project for learning manual application-security testing. A lesson introduces a weakness in accessible language; a challenge then asks the learner to recognize the trust failure, reproduce it inside the lab, and submit a user-specific result. The platform covers classic web and mobile security topics such as injection, authentication, access control, cross-site scripting, cross-site request forgery, insecure storage, and data leakage.

Individual learning

Use Open Floor mode to explore lessons in your own order, keep notes, and repeat a module after resetting the lab.

Classroom delivery

Administrators can manage users and classes, choose modules, control registration, and use scoreboards or competition modes.

AppSec practice

The platform helps learners connect a visible application behavior to the broken trust assumption and the defensive control that should replace it.

Not a production system

It is intentionally vulnerable. Treat every container, credential, database, and browser session as disposable training data.

OWASP Security Shepherd local application security training environment

Blog Review: What Needed Improvement

The original guide had a useful structure and sensible safety warnings, but several points needed refinement for accuracy and search intent:

First-run flow: the active source can show a database setup wizard before the login page, so a direct jump to admin / password is incomplete.
Source versus release: GitHub Releases still labels version 3.1 as the latest formal release, while the default repository branch contains newer development changes. Those are different installation choices.
Java wording: contributors target Java 8 compatibility, but the official build workflow uses OpenJDK 17. A user guide should tell installers to use JDK 17 without implying that the application uses Java 17 language features.
Docker safety: published ports should be bound to loopback or protected by a host-only network, rather than assuming that “localhost” in the browser means the service is not reachable from the LAN.
SEO focus: unrelated runtime API-security terms diluted the install-guide intent. The refined keyword set now prioritizes installation, setup, login, operating systems, troubleshooting, and reset questions.
Training guidance: the revised walkthrough teaches observation, root cause, remediation, and regression testing without publishing challenge answers or exploit payloads.

Quick Start: Build Security Shepherd with Docker

Safety first: perform these steps only on a personal lab machine or an isolated training VM. Do not run the platform on a public server or a production workstation containing sensitive data.

1. Verify the required tools

git --version
java -version
mvn -version
docker --version
docker compose version

Use OpenJDK 17 for the documented build workflow. The repository’s contributor notes explain that the code still targets Java 8 compatibility, while CI and local builds use Java 17.

2. Clone the active source and record the commit

git clone --depth 1 --branch dev https://github.com/OWASP/SecurityShepherd.git
cd SecurityShepherd
git rev-parse HEAD

Recording the commit gives a class or team a repeatable baseline. The dev branch is active source and may change; do not silently update it halfway through a workshop.

3. Restrict the published ports to loopback

Review docker-compose.yml. If the HTTP and HTTPS mappings publish as $HTTP_PORT:8080 and $HTTPS_PORT:8443, prefix the host side with 127.0.0.1:. The following script changes those two patterns and stops if it cannot verify them:

cp docker-compose.yml docker-compose.yml.original
python3 - <<'SHEPHERD_PORTS'
from pathlib import Path
import re

path = Path("docker-compose.yml")
original = path.read_text()
updated = original

patterns = [
    (r'(?<!127\.0\.0\.1:)(\$HTTP_PORT|\${HTTP_PORT}):8080', r'127.0.0.1::8080', 'HTTP_PORT'),
    (r'(?<!127\.0\.0\.1:)(\$HTTPS_PORT|\${HTTPS_PORT}):8443', r'127.0.0.1::8443', 'HTTPS_PORT'),
]
for pattern, replacement, label in patterns:
    updated, count = re.subn(pattern, replacement, updated)
    if count == 0:
        raise SystemExit('Could not find the ' + label + ' port mapping. Review docker-compose.yml manually.')

path.write_text(updated)
print("Updated HTTP and HTTPS mappings to bind on 127.0.0.1")
SHEPHERD_PORTS

docker compose config

Inspect the rendered Compose configuration before continuing. If your project revision uses a different structure, restore the original file and edit the published web ports manually. Do not guess.

4. Generate the application assets and start the stack

mvn -Pdocker clean install -DskipTests -B
docker compose up -d --build
docker compose ps

The Maven Docker profile runs before the Compose build because it generates the WAR, database initialization material, and TLS assets required by the containers. A first build can take longer because Maven and Docker must download dependencies and images.

Security Shepherd Requirements

RequirementWhy it is neededPractical note
GitClones and updates the official sourceRecord the commit used for a workshop
OpenJDK 17Runs the documented Maven buildConfirm java -version before building
MavenBuilds the WAR and generates Docker assetsRun the docker profile before Compose
Docker Engine or DesktopRuns Tomcat, MariaDB, and MongoDBUse a maintained release and Linux containers
Docker ComposeBuilds and coordinates the multi-container environmentModern installations use docker compose
Python 3Used by this guide’s loopback-binding helperNot a core application runtime requirement
Memory and diskSupports the Maven cache, images, build layers, and databasesLeave several GB free and close unnecessary workloads

Use a disposable VM when possible. This reduces conflicts with ports 80 and 443, makes cleanup easier, and keeps training traffic separate from personal or company data.

Install Security Shepherd on Ubuntu

Use Docker’s official Ubuntu repository rather than relying on an old distribution package. The commands below install the build tools and current Docker Engine packages:

sudo apt-get update
sudo apt-get install -y ca-certificates curl git maven openjdk-17-jdk python3
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
. /etc/os-release
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu ${UBUNTU_CODENAME:-$VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker run --rm hello-world

You can either keep using sudo docker or deliberately add your account to the Docker group. Membership in that group is effectively root-level access, so do not treat it as an ordinary convenience permission on a shared system.

Install Security Shepherd on Red Hat Enterprise Linux

On a maintained RHEL release, install the build tools and Docker Engine from Docker’s official RHEL repository:

sudo dnf -y install dnf-plugins-core git maven java-17-openjdk-devel python3
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker run --rm hello-world

SELinux should remain enabled. If a custom bind mount fails, inspect the denial and correct the volume labeling rather than disabling SELinux for the host.

Install Security Shepherd on Windows with Docker Desktop and WSL 2

The cleanest Windows workflow is Docker Desktop using Linux containers and an Ubuntu WSL distribution. Run the first two commands in an elevated PowerShell terminal:

wsl --install -d Ubuntu
winget install -e --id Docker.DockerDesktop

Restart if Windows requests it. Open Docker Desktop, enable the WSL 2 engine and integration for Ubuntu, then open the Ubuntu terminal and install the Linux-side build tools:

sudo apt-get update
sudo apt-get install -y git maven openjdk-17-jdk python3
java -version
mvn -version
docker version
docker compose version

Keep the repository inside the WSL Linux filesystem, such as ~/SecurityShepherd, rather than under /mnt/c/. Builds and file operations are generally more reliable there.

First Run: Database Setup Wizard

After the containers start, open https://localhost/. A self-signed certificate warning is normal for this local lab. Current source builds can redirect to /setup.jsp before showing the login page. That is expected on an uninitialized database.

1. Confirm containers: run docker compose ps and wait for Tomcat, MariaDB, and MongoDB to remain running.
2. Read the setup token: obtain the one-time authorization value from the Tomcat container.
3. Complete the wizard: use the Docker network names for both databases because the web container cannot reach them through its own localhost.
4. Continue to login: once initialization succeeds, the normal sign-in page becomes available.
docker exec secshep_tomcat cat /usr/local/tomcat/conf/SecurityShepherd.auth
Wizard fieldCurrent Docker valueReason
MariaDB hostsecshep_mariadbContainer name on the Compose network
MariaDB port3306Internal database port
MariaDB userrootInitial schema setup account
MariaDB passwordCowSaysMooCurrent Docker setup default; verify against your checked-out source
MongoDB hostsecshep_mongoContainer name on the Compose network
MongoDB port27017Internal MongoDB port
Authorization tokenValue read from the Tomcat containerProtects the initialization operation
Verify your revision: development branches change. Check the repository’s .env, Compose file, and setup screen before submitting values. Do not expose these database defaults outside the isolated lab.

Security Shepherd Login and First Session

After setup, use the initial administrator credentials documented by the official README:

URL:      https://localhost/
Username: admin
Password: password

Change the password immediately when prompted. Use a unique lab-only value. Then review registration, module availability, hints, scoreboard, class settings, and layout mode before allowing other learners to connect.

Disable open registration unless the class requires it.
Create separate learner accounts; do not share the administrator account.
Open only the modules needed for the exercise.
Use synthetic names and data.
Close or delete the lab after the session.

A Safer Security Shepherd Learning Workflow

The guide intentionally does not publish challenge answers or exploit strings. A better learning process is to reproduce one controlled behavior, explain the broken trust assumption, identify the preventive control, and confirm the fix with a regression test.

Establish a baseline: perform the normal action and record the expected request, response, and application state.
Change one variable: alter only the input or browser condition that the lesson asks you to study.
Observe safely: compare status, response body, state change, logs, and user-visible result without targeting any system outside your lab.
Explain the root cause: describe the missing validation, authorization, browser trust control, or query-handling boundary.
Define the fix: name the server-side control that should prevent the behavior.
Retest: confirm that the intended action still works and the prohibited action fails.
Security Shepherd request analysis and defensive learning workflow

SQL injection lessons

Use the lesson path to understand why untrusted values must not be concatenated into SQL statements. Focus on parameterized queries, allowlisted input shapes, least-privilege database accounts, predictable error handling, and regression tests. The goal is not to collect payloads; it is to recognize unsafe query construction and replace it with a safe data-access pattern.

CSRF lessons

Use the CSRF modules to study how an authenticated browser can be induced to send an unwanted state-changing request. The defensive review should cover unpredictable anti-CSRF tokens, appropriate SameSite cookie settings, Origin or Referer validation where suitable, avoidance of state changes through safe HTTP methods, and reauthentication for high-impact actions.

Use hints without turning them into answer keys

Attempt the module first, write down what you observed, and then use built-in hints progressively. Many result keys are user-specific. A copied static answer does not demonstrate that the learner can reproduce the behavior, identify its root cause, or verify remediation.

Module:
Learning objective:
Normal behavior:
Controlled change:
Observed result:
Broken trust assumption:
Preventive control:
Detection or logging signal:
Regression test:
Result key submitted:

GitHub Source, Formal Releases, and the Legacy VM

OptionBest useImportant limitation
Current GitHub sourceLocal labs that need recent repository changesThe active development branch can change; pin a commit
GitHub release 3.1Reproducing the last formal packaged releaseReleased in 2018 and older than current source activity
Legacy VM/manual assetsOffline demonstrations or historical trainingPatch the host, isolate the network, and expect older dependencies

Primary sources:

Security Shepherd Command Toolkit

# Show services
docker compose ps

# Follow Tomcat logs
docker compose logs -f web

# Stop and restart without deleting data
docker compose stop
docker compose start

# Remove containers but keep named volumes
docker compose down

# Rebuild the pinned source revision
mvn -Pdocker clean install -DskipTests -B
docker compose up -d --build

# DESTRUCTIVE RESET: removes databases, users, and progress
docker compose down -v
docker compose up -d --build

OWASP Security Shepherd Troubleshooting

docker compose is not recognized

Install the Docker Compose plugin or use the legacy docker-compose command documented by the project. Do not mix two different Docker installations in the same environment.

Maven reports an unsupported Java release

Run java -version and mvn -version. Both should point to OpenJDK 17 for the documented build. On systems with multiple JDKs, correct JAVA_HOME and the active alternatives.

Port 80 or 443 is already in use

Find the existing listener before changing anything. Stop the conflicting local service or change the host-side port values in the project’s .env and Compose configuration. Keep the binding on 127.0.0.1.

# Linux or WSL
sudo ss -ltnp | grep -E ':(80|443)\b'

# Windows PowerShell
Get-NetTCPConnection -State Listen | Where-Object LocalPort -in 80,443

The setup wizard cannot connect to the database

Use secshep_mariadb and secshep_mongo, not localhost. Confirm the database containers are running, inspect their logs, and verify the password in the checked-out .env file.

MariaDB exits with a stored-procedure syntax error

The repository contributor notes identify a stale image cache as one possible cause. Rebuild the database image without cache after rerunning the Maven Docker profile:

mvn -Pdocker clean install -DskipTests -B
docker compose build --no-cache db
docker compose up -d db

If your Compose revision uses a different service name, obtain it from docker compose config --services before running the command.

The browser opens before Tomcat is ready

Wait for the web container to finish startup and follow its logs. A container marked “running” does not necessarily mean that the application has completed initialization.

I need a completely clean instance

Use docker compose down -v only after confirming that you no longer need users, scores, configuration, or lab progress. Then rebuild and repeat the first-run wizard.

What to Carry from the Lab into Real Applications

Security Shepherd is a training platform, not a model for production deployment. The durable value comes from translating each exercise into engineering and operational controls:

Prevent in design and code

Define trust boundaries, validate input, parameterize database access, enforce authorization server-side, and add testable security requirements.

Verify before release

Use controlled negative tests, code review, dependency checks, configuration review, and regression coverage for each fixed weakness.

Observe production safely

Log security-relevant context without copying secrets or full sensitive payloads into tickets, email, or SIEM events.

Prepare response

Assign ownership, preserve minimal evidence, contain affected paths, fix root causes, and verify that the same weakness cannot reappear through another endpoint.

Application and API protection controls applied after Security Shepherd training

Related guides: OWASP Top 10 vulnerabilities with examples, API security testing versus runtime monitoring, and API security incident response playbook.

Security Shepherd Setup Checklist

Use the official OWASP repository or formal release page.
Record the branch and commit used for the lab.
Use OpenJDK 17 and run the Maven Docker profile before Compose.
Bind published ports to loopback or use a host-only network.
Inspect docker compose config before startup.
Complete the database setup wizard when it appears.
Change the default administrator password immediately.
Use separate learner accounts and synthetic data.
Keep the environment away from public and production networks.
Pin a source revision for workshops and classes.
Back up only when you truly need to preserve progress.
Remove containers and volumes after the training period.

Conclusion

The best 2026 Security Shepherd setup is a deliberately isolated, reproducible lab: use the official source, record the commit, build with Maven and OpenJDK 17, keep Docker’s web ports on loopback, complete first-time database initialization when required, change the documented default administrator password, and destroy the environment when training ends. This approach preserves the project’s learning value without turning an intentionally vulnerable application into an unmanaged network risk.

OWASP Security Shepherd FAQ

What is OWASP Security Shepherd?

OWASP Security Shepherd is an OWASP web and mobile application security training platform. It combines explanatory lessons with deliberately vulnerable challenges and can be configured for individual practice, classrooms, CTFs, and tournaments.

What is the recommended way to install Security Shepherd in 2026?

For a local lab, the most practical route is the current official GitHub source with Docker Compose. Install Git, Maven, OpenJDK 17, Docker Engine or Docker Desktop, clone the repository, run the Maven Docker profile, and then start the Compose stack.

Which branch should I use for Security Shepherd?

The official GitHub repository currently presents the dev branch as its default active source branch. For repeatable training, record the commit hash you tested. The latest formal GitHub release is version 3.1, which is much older than the active repository source.

Why does Security Shepherd show a database setup page?

Recent source builds can redirect first-time users to a setup wizard before the login page. The Tomcat container must connect to the MariaDB and MongoDB containers by their Docker network names, not by localhost. Complete the wizard once, then continue to the administrator login.

What is the initial Security Shepherd login?

The official project README documents the initial administrator credentials as username admin and password password. Change that password immediately after the first successful login and never reuse a real password in the lab.

What URL opens Security Shepherd?

The default project configuration publishes HTTP and HTTPS on the host, usually at http://localhost/ and https://localhost/. The HTTPS certificate is generated locally, so a browser warning is expected in an isolated training environment.

How do I install Security Shepherd on Ubuntu?

Install Git, Maven, OpenJDK 17, Python 3, and Docker Engine from Docker’s official Ubuntu repository. Clone the official OWASP repository, bind the published web ports to 127.0.0.1, run the Maven Docker build, and start the stack with Docker Compose.

How do I install Security Shepherd on RHEL?

Install Git, Maven, Java 17, Python 3, and Docker Engine from Docker’s official RHEL repository. Then use the same repository, loopback-binding, Maven build, and Docker Compose workflow as Ubuntu.

How do I install Security Shepherd on Windows?

Use Docker Desktop with the WSL 2 backend and an Ubuntu WSL distribution. Enable Docker Desktop integration for that distribution, install Git, Maven, Java 17, and Python 3 inside WSL, and run the Linux build workflow there.

Is the Security Shepherd VM still available?

Yes. GitHub Releases lists version 3.1 and older downloadable assets, including legacy VM or manual-install packages. Use the VM only on a host-only or otherwise isolated network, and prefer the current source build when you need newer repository changes.

Is Security Shepherd safe to expose to the internet?

No. It is intentionally vulnerable training software. Keep it on localhost, a host-only virtual network, or a tightly isolated classroom segment. Do not publish it through a public IP, router port forward, production reverse proxy, or shared corporate environment.

How do I reset Security Shepherd?

Run docker compose down to remove containers while retaining named volumes. Run docker compose down -v only when you intentionally want to delete the databases, configuration, users, and progress, then rebuild and complete first-time setup again.

Turn Lab Lessons into Better Application and API Security

Use Security Shepherd to build practical testing skills, then convert each finding into secure design requirements, regression tests, production visibility, and evidence that engineering and security teams can act on.

© 2026 Ammune Security. Run intentionally vulnerable applications only in authorized, isolated training environments.