Back to articles
Security & Anti-DDoS

Guide to Configuring BunkerWeb WAF on VPS with Maximum Automation Using Docker

A detailed guide to configuring BunkerWeb WAF on VPS using Docker to protect websites from web attacks. This solution automates deployment, updates, and monitoring, ideal for...

DPTCloud Engineering4 min read
Guide to Configuring BunkerWeb WAF on VPS with Maximum Automation Using Docker

Introduction to BunkerWeb WAF and Benefits of Deployment on VPS

BunkerWeb is an open-source, lightweight, and effective Web Application Firewall (WAF) designed to protect web applications from threats such as SQL injection, XSS, and other common attacks. With its Docker-native operation, BunkerWeb becomes an ideal solution for deploying on VPS with high automation, minimizing risks from misconfiguration and enhancing stability.

Deploying BunkerWeb on a VPS via Docker enables users to automate the entire process: from installation and configuration to security rule updates and activity monitoring. This is especially useful for businesses that require optimal web security without significant operational overhead.

Learn more about the security infrastructure at Network Security & 99.98% SLA Infrastructure at DPTCloud to understand the broader security ecosystem.

Requirements and Preparation Steps

To deploy BunkerWeb WAF on a VPS using Docker, you will need:

  • VPS running Linux (Ubuntu 20.04+ or Debian 10+)
  • Docker and Docker Compose installed
  • Public IP address of the VPS
  • Domain or subdomain pointed to the VPS (optional)

Deploying BunkerWeb WAF with Docker

Use Docker Compose to deploy BunkerWeb automatically and manage it easily. Create a docker-compose.yml file with the following content:

version: '3.8'
services:
  bunkerweb:
    image: bunkerweb/bunkerweb:latest
    container_name: bunkerweb
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./config:/config
      - ./logs:/logs
    environment:
      - BW_MODE=reverse_proxy
      - BW_DOMAINS=yourdomain.com
      - [email protected]
      - BW_API_KEY=your_api_key_here
    restart: unless-stopped

Replace yourdomain.com with your actual domain and your_api_key_here with an optional API key. Create the config and logs directories to store configuration and logs.

Run the following command to start the service:

docker-compose up -d

To update BunkerWeb to the latest version, simply run:

docker-compose pull
docker-compose up -d

Setting Up and Customizing Security

After deployment, access the administration interface at http://your-vps-ip:8080 (default). You can:

  • Configure security rules based on your needs (SQLi, XSS, bot, etc.)
  • Set up alerts via email or webhook
  • Analyze activity logs to detect attacks

BunkerWeb supports automatic security rule updates from sources such as BunkerWeb GitHub, ensuring protection against the latest threats.

Verification and Troubleshooting

To verify that BunkerWeb is running:

  • Access your website via a browser and check if it is blocked
  • Visit http://your-vps-ip:8080 to check service status
  • Run: docker logs bunkerweb to view error logs

If access fails, check the following:

  • Ports 80 and 443 are open on the VPS
  • Firewall (ufw, iptables) is not blocking the ports
  • Docker Compose is running correctly with docker-compose ps

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478