This article provides a complete setup guide for DVWA (Damn Vulnerable Web Application), an intentionally vulnerable PHP/MySQL web application designed for ethical hackers to practice web security vulnerabilities in a controlled, local environment. The guide covers two installation methods—Docker (recommended) and manual Apache/MySQL installation—and explains DVWA's four-level security progression system that teaches both offensive attack techniques and defensive secure coding in parallel. DVWA matters because it has been the industry standard practice target for over a decade, offering infinitely resettable, source-code-visible vulnerabilities that build real exploitation muscle memory without the complications of online labs or subscriptions.
- DVWA's source code visibility accelerates learningEvery DVWA module includes a 'View Source' button that displays the vulnerable code at each security level, and crucially allows learners to compare the Low (unfiltered) version directly against the Impossible (secure) version to see what correct implementation actually looks like. This compare-and-contrast approach teaches both why vulnerabilities exist and how to fix them simultaneously, building security intuition faster than attack-only practice.
- Docker installation requires only three commandsThe Docker method eliminates manual Apache, PHP, and database configuration: one command installs Docker, one pulls and starts the DVWA container (~200MB, cached on subsequent runs), and one verification command confirms it is running. Daily workflows use simple commands like 'docker start dvwa' and 'docker stop dvwa', with complete reset via 'docker rm -f dvwa && docker run' restoring a clean state instantly.
- Four security levels represent progression toward productionLow has no filtering (exploitable with basic payloads), Medium applies simple blacklist filtering (representing a developer who tried but used wrong techniques), High uses stronger filtering (representing research but with subtle flaws), and Impossible implements correct secure patterns like parameterised queries, Content Security Policy, token validation, and strict whitelists. This progression teaches both how attacks work and why each naive defence fails.
- Brute force attack demonstrates real unprotected designThe article walks through using Hydra to credential-brute-force the DVWA login form at Low security, which has no rate limiting, account lockout, or CAPTCHA—revealing the entire admin password ('password') in seconds. Switching to Medium adds only a sleep(2) delay between attempts, which is trivially bypassed by reducing thread count, demonstrating how common ineffective defences are on real production systems.
- Manual install enables source code modificationInstalling DVWA directly on Kali's Apache and MariaDB stack (rather than via Docker) allows direct modification of PHP source files for advanced exercises, though it requires more configuration steps including creating database users, updating credentials in config files, and enabling allow_url_include in php.ini (which is a security risk on internet-facing systems but safe on localhost).
- Isolation is mandatory for safe vulnerable practiceThe article repeatedly emphasizes that DVWA must run exclusively on localhost, in a VM with host-only networking, or on an offline machine and must never be exposed to the internet or shared networks, because its vulnerabilities are real and exploitable by other network users. All 30 labs in the series target only the local instance.
- Automated verification prevents configuration debuggingThe article provides a curl-based verification script that confirms DVWA is accessible, login works, all key modules return HTTP 200 status codes, and security level settings persist. Running this check before each lab session prevents wasted time troubleshooting misconfigured environments instead of practicing the actual vulnerabilities.
- Reset mechanisms enable unlimited repetitionDVWA can be reset to a completely clean state via the browser (/dvwa/setup.php 'Create / Reset Database' button), via Docker full container reset, or via manual database commands, allowing learners to practice the same vulnerability multiple times until techniques become instinctive muscle memory.
Bottom line: DVWA is a foundational, always-available practice environment where learners can attack freely and fail without consequences, and the Docker installation method gets a fully functional setup in minutes with no manual configuration. The four-level security progression system is the core learning mechanism—start at Low to master the attack, progress through Medium and High to understand bypass techniques, then study Impossible to see what production secure code actually looks like.
Foundation: Dvwa Lab Setup 2026 & Configuration
Next: Brute Force Lab →
📋 What This Guide Covers
- What Is DVWA and What the 30-Lab Series Covers
- Method 1 — Docker Install (Recommended, 3 Commands)
- Method 2 — Manual Install on Kali Linux (Apache + MySQL)
- Post-Install Configuration and the Security Level System
- Your First DVWA Attack — Exploring the Lab Environment
- Resetting DVWA and Troubleshooting Common Issues
DVWA has been the go-to practice target for web application security since 2008. Unlike online labs that go offline or require subscriptions, a local DVWA installation is always available, infinitely resettable, and gives you a genuine web application to probe — not a simulated quiz. This guide covers the 2026 setup using Docker for a clean, repeatable install, plus the traditional Apache/MySQL method if you prefer a persistent installation. Either setup works identically with all 30 labs in this series.
What Is DVWA and What the 30-Lab Series Covers
DVWA is a PHP/MySQL web application built to contain every major web vulnerability class in a controlled, sandboxed environment. What makes it uniquely valuable for learning is the source code viewer — at every security level you can click “View Source” to see exactly what the vulnerable code looks like, then switch to Impossible security to see the correct secure implementation side by side. This compare-and-contrast approach builds security intuition faster than any other method.
Method 1 — Docker Install (Recommended, 3 Commands)
Docker is the cleanest way to run DVWA in 2026. No manual PHP configuration, no Apache setup, no database user creation — the entire stack runs inside a pre-configured container. You can start it, stop it, and completely reset it with single commands, making it ideal for a practice lab you use repeatedly.
⏱️ Time: 5 minutes · Target: http://127.0.0.1 (your local DVWA)
Step 2: Scroll to bottom of setup page → click “Create / Reset Database”
Step 3: You are redirected to /login.php
Step 4: Login: username=admin, password=password
Step 5: Explore the left menu — confirm all modules are listed:
Brute Force, Command Injection, CSRF, File Inclusion,
File Upload, SQL Injection (×2), XSS (×3), DVWA Security
Step 6: Click “DVWA Security” → set to “Low” → Submit
Step 7: Click “View Source” on any module page to see vulnerable code
📸 Screenshot DVWA menu with all modules visible and share in #dvwa-lab-series on Discord.
🧠 QUICK CHECK
Method 2 — Manual Install on Kali Linux (Apache + MySQL)
If you prefer a persistent installation that survives reboots without a running container, use this method to install DVWA directly on Kali’s Apache and MariaDB stack. This also lets you modify the PHP source files directly, which is useful for more advanced lab exercises.
Post-Install Configuration and the Security Level System
The security level system is the heart of how DVWA teaches web security. Every vulnerability module has four versions of the same page, each with progressively stronger (and ultimately correct) defences. Progressing through all four levels on each module is the fastest way to build both offensive and defensive intuition simultaneously.
Your First DVWA Attack — Exploring the Lab Environment
With DVWA running at Low security, you are ready to run your first attack. The Brute Force module is the best starting point — it requires no special tools, works directly from a browser or Burp Suite, and demonstrates instantly what an unprotected login form looks like from an attacker’s perspective.
⏱️ Time: 10 minutes · Target: DVWA Brute Force module on 127.0.0.1 (YOUR LAB ONLY)
Navigate to DVWA → Brute Force. Your goal is to find the correct password for the “admin” account using Hydra against this locally running lab application.
The password is “password” — Hydra finds it in seconds. After Hydra succeeds, switch DVWA to Medium security and notice what changes: a simple sleep(2) delay is added between attempts. This is the developer’s attempt at rate limiting — and it is trivially bypassed by reducing Hydra’s thread count.
📸 Screenshot your Hydra success output (password: password found) and share in #dvwa-lab-series on Discord.
Resetting DVWA and Troubleshooting Common Issues
One of DVWA’s greatest advantages for learning is the ability to reset the entire application between sessions — restoring all data to a clean state so you can practise the same vulnerability fresh. Here is how to reset and how to fix the most common setup problems.
⏱️ Time: 10 minutes · Target: Your DVWA localhost instance
Run this verification sequence to confirm your lab is ready for the entire 30-lab series. Test that every module loads and the security level change persists.
📸 Screenshot all module status codes showing 200 and share in #dvwa-lab-series on Discord. Tag #dvwasetup2026
📋 DVWA Lab Commands — Reference Card
🏆 Lab 1 Complete — DVWA Lab Setup 2026 Ready
Your lab is ready for all 29 remaining DVWA labs in this series
❓ Frequently Asked Questions – DVWA Lab Setup 2026
What is DVWA and why is it the standard practice target?
Should I use Docker or the manual install method?
What are the four DVWA security levels?
How do I reset DVWA between practice sessions?
Is DVWA safe to run on my computer?
What comes after this setup lab?
DVWA Labs Hub
Lab 2: Brute Force — Hydra & Burp Intruder
📚 Further Reading
- DVWA Lab 2: Brute Force 2026 — Use Hydra and Burp Suite Intruder against DVWA’s login form across all four security levels, including CSRF token bypass at High.
- SQL Injection Tutorial for Beginners 2026 — Complete SQL injection guide that pairs directly with DVWA’s SQL Injection modules (Labs 7 and 8 in this series).
- DVWA Labs Hub — The complete category page for all 30 DVWA lab articles in this series, organised by vulnerability type and difficulty.
- DVWA Official GitHub Repository — Official DVWA source code, latest version, PHP 8.x compatibility notes, and installation documentation maintained by the original authors.
- OWASP WebGoat Project — An alternative intentionally vulnerable application from OWASP, complementary to DVWA for covering additional vulnerability classes not in DVWA.

