Skip to main content

Overview

DVWA can be installed using several methods depending on your platform and preferences. This guide covers all installation options. The fastest and easiest way to get DVWA running is with Docker:
1

Prerequisites

Install Docker and Docker Compose:Verify installation:
docker version
docker compose version
```bash
</Step>

<Step title="Clone DVWA">
```bash
git clone https://github.com/digininja/DVWA.git
cd DVWA
Or download the ZIP file and extract it.
2

Start Containers

docker compose up -d
This starts both the DVWA web application and MariaDB database.
3

Access DVWA

Open your browser to: http://localhost:4280Default credentials:
  • Username: admin
  • Password: password
Docker handles all dependencies automatically including PHP, Apache, and MariaDB. No manual configuration required!
For detailed Docker configuration, see the Docker Deployment Guide.

Installation Methods by Platform

Choose the installation method that best fits your environment:

Docker

Recommended for all platforms. Automated setup with containers.

XAMPP

Cross-platform stack for Windows, Mac, and Linux.

Linux Manual

Full control with Apache and MariaDB on Linux.

System Requirements

For Docker Installation

  • Docker 20.10 or later
  • Docker Compose v2.0 or later
  • 2GB RAM minimum
  • 1GB free disk space

For Manual Installation

  • PHP 7.3 or later (8.x recommended)
  • Apache 2.4 or later
  • MariaDB 10.3+ or MySQL 5.7+ (MariaDB strongly recommended)
  • 1GB RAM minimum
Support will not be given for PHP 5.x. PHP versions less than 7.3 have known issues.

Required PHP Modules

For manual installations, ensure these PHP modules are installed:
  • php-mysqli - MySQL database support
  • php-gd - Image processing (required for file upload module)
  • libapache2-mod-php - PHP integration with Apache
On Debian/Ubuntu systems:
sudo apt install php php-mysqli php-gd libapache2-mod-php

Database Considerations

MariaDB vs MySQL

We strongly recommend MariaDB over MySQL. MariaDB works out of the box, while MySQL requires additional configuration for PHP compatibility.

Why MariaDB?

  • Drop-in replacement for MySQL
  • Better PHP compatibility
  • Actively maintained
  • Used by default in most Linux distributions
If using MySQL and encountering authentication errors, see Database Troubleshooting.

Post-Installation Steps

After installing DVWA through any method:
1

Configure DVWA

Copy the configuration template:
cp config/config.inc.php.dist config/config.inc.php
Edit config/config.inc.php with your database credentials.
2

Set up the Database

  1. Access DVWA in your web browser
  2. Click Setup DVWA in the main menu
  3. Click Create / Reset Database
  4. Wait for the database initialization to complete
3

Login

Use the default credentials:
  • Username: admin
  • Password: password
4

Choose Security Level

Navigate to DVWA Security and select your starting level. We recommend starting with Low to learn each vulnerability.

Optional: API Module Setup

The API vulnerability module requires additional setup:

Install Composer

Download and install Composer:
curl -sS https://getcomposer.org/installer | php

Install API Dependencies

cd vulnerabilities/api
php composer.phar install
```bash

### Enable Apache mod_rewrite

The API module requires URL rewriting:

```bash
sudo a2enmod rewrite
sudo systemctl restart apache2

Automated Installation Script

An unofficial automated installation script is available for Debian-based systems. Review the script before running it.

One-liner Installation

sudo bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/IamCarron/DVWA-Script/main/Install-DVWA.sh)"
```bash

### Manual Script Download

```bash
wget https://raw.githubusercontent.com/IamCarron/DVWA-Script/main/Install-DVWA.sh
chmod +x Install-DVWA.sh
sudo ./Install-DVWA.sh
This script automates package installation, database setup, and DVWA configuration.

Verification

After installation, verify DVWA is working:
  1. Access the login page at your configured URL
  2. Log in with admin/password
  3. Run database setup if not already done
  4. Access a vulnerability module like SQL Injection
  5. View source code to confirm installation is complete
If you encounter issues, see our Troubleshooting Guide.

Security Reminder

Never install DVWA on a production server or Internet-facing machine.Always use:
  • Virtual machines (VirtualBox, VMware, UTM)
  • NAT networking mode (not bridged)
  • Isolated lab networks
  • Local development only

Next Steps

Once installed, configure DVWA for your needs:

Configuration Guide

Configure database, security levels, and optional features

Quick Start

Learn how to use DVWA effectively

Security Levels

Understand the four security levels

Troubleshooting

Solve common installation problems

Installation Videos

Visual learners can follow these video guides:

Build docs developers (and LLMs) love