This guide covers the installation requirements and steps for setting up the Web Application Firewall.
- Node.js: Version 22 or higher
- npm: Usually comes bundled with Node.js
Check your Node.js version:
node --version
# Should output v22.x.x or higherCheck your npm version:
npm --versionThe WAF requires MaxMind GeoLite2 databases for geolocation features:
GeoLite2-Country.mmdbGeoLite2-City.mmdb
You can obtain these databases from:
-
MaxMind - Free GeoLite2 databases (requires account)
- Visit https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
- Create a free account
- Download the databases
-
Alternative source - Pre-built databases
- P3TERX/GeoLite.mmdb
- Download the latest release
Minimum:
- RAM: 512MB
- CPU: 1 core
- Disk: 100MB
Recommended for production:
- RAM: 2GB or more
- CPU: 2 cores or more
- Disk: 1GB (for logs and ban storage)
git clone https://github.com/SomeBlackMagic/WebApplicationFirewall.git
cd WebApplicationFirewallnpm installThis will install all required dependencies listed in package.json.
Place the GeoIP database files in the project root or in a dedicated directory:
# Example: Create a geoip_data directory
mkdir geoip_data
cd geoip_data
# Download the databases (example using P3TERX repo)
wget https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-Country.mmdb
wget https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-City.mmdb
cd ..Copy the example configuration and customize it:
cp config.example.yaml config.yamlEdit config.yaml to match your environment. At minimum, ensure the GeoIP database paths are correct:
geoip:
countryPath: './geoip_data/GeoLite2-Country.mmdb'
cityPath: './geoip_data/GeoLite2-City.mmdb'For more details on configuration, see the Configuration Guide.
Test that everything is installed correctly:
# Check that dependencies are installed
npm list --depth=0
# Verify GeoIP databases exist
ls -lh geoip_data/*.mmdb- Continue to Quick Start to run the WAF
- Or learn about First Configuration for detailed setup
- For Docker installation, see Running with Docker
If you have an older version of Node.js, consider using nvm to manage multiple versions:
# Install nvm (Linux/macOS)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install and use Node.js 22
nvm install 22
nvm use 22If you can't download databases directly:
- Download manually from the browser
- Place files in the appropriate directory
- Ensure file permissions are readable:
chmod 644 geoip_data/*.mmdb
If you encounter errors during npm install:
# Clear npm cache
npm cache clean --force
# Remove node_modules and package-lock.json
rm -rf node_modules package-lock.json
# Reinstall
npm installFor more troubleshooting help, see the Troubleshooting Guide.