Get DVWA Running in 5 Minutes
This guide will get you from zero to practicing web vulnerabilities in under 5 minutes using Docker.Prerequisites
You’ll need Docker and Docker Compose installed:- Docker Desktop (Windows/Mac): Download here
- Docker Engine (Linux): Installation guide
Step-by-Step Setup
Download DVWA
Start Docker Containers
Run Docker Compose to start both the web application and database:This command:
- Downloads the DVWA image (or builds it locally)
- Starts MariaDB database with pre-configured credentials
- Exposes DVWA on port 4280
The
-d flag runs containers in detached mode (background). Omit it to see logs in real-time.Access DVWA
Open your web browser to:You should see the DVWA login page.
Why port 4280? This avoids conflicts with other services on port 80 and doesn’t require elevated privileges on Linux.
Set Up the Database
Before logging in, you must initialize the database:
- On the login page, click Setup DVWA in the main menu
- Scroll down and click Create / Reset Database
- Wait for the database initialization to complete
- You’ll be redirected to the login page
Log In
Use the default credentials:
- Username:
admin - Password:
password
Choose Your Security Level
After logging in:
- Click DVWA Security in the left sidebar
- Select your starting security level
- Click Submit
- Start with Low to understand each vulnerability
- Progress to Medium after successfully exploiting Low
- Try High for more realistic security controls
- Study Impossible to learn proper defenses
You can change the security level at any time. Each vulnerability behaves differently at each level.
Your First Vulnerability
Let’s try SQL Injection as your first exercise:Read the Objective
Click View Help (question mark icon) to see:
- What the vulnerability is
- Your objective (extract user passwords)
- Hints for each security level
Try a Basic Injection
At Low security level, try entering this in the User ID field:This should display all users in the database, not just user ID 1.
Quick Reference
Default Credentials
| Field | Value |
|---|---|
| URL | http://localhost:4280 |
| Username | admin |
| Password | password |
| Database User | dvwa |
| Database Password | p@ssw0rd |
Docker Commands
Security Levels
| Level | Description | When to Use |
|---|---|---|
| Low | No security | Learning vulnerability mechanics |
| Medium | Basic protections | Understanding common defenses |
| High | Strong protections | Realistic attack scenarios |
| Impossible | Properly secured | Learning correct implementations |
Next Steps
Explore Vulnerabilities
Start with SQL Injection and work through all 18+ modules
Configuration Guide
Customize DVWA settings and enable optional features
Security Levels
Understand how each level changes vulnerability behavior
Troubleshooting
Solve common issues and errors
Alternative Installation Methods
If Docker doesn’t work for your environment:- XAMPP Installation - Cross-platform Apache, MySQL, PHP stack
- Manual Linux Installation - Full control with native packages
- Complete Installation Guide - All options and detailed instructions
Getting Help
If you encounter issues:- Check Common Issues - most problems are documented
- Review Database Errors if database setup fails
- Check GitHub Issues for similar problems
- Ensure you’re running the latest code from master branch
