A web-based application that serves as a user-friendly wrapper for the Nmap network scanner. This application allows authenticated users to manage targets, define and execute Nmap scans, view scan reports, and schedule recurring scans through an intuitive web interface.
- User Authentication & Authorization - secure login system with role-based access
- User Management - admin interface for managing user accounts
- Target Group Management - organize and manage scan targets efficiently
- Scan Task Creation & Configuration - flexible scan configuration with custom Nmap options
- Asynchronous Background Scanning - non-blocking scan execution using a built-in scheduler
- Task Listing & Management - monitor and control running and queued scans
- Scan Report Display - comprehensive visualization of scan results
- Multiple Scan Runs & Report History - track scan history and compare results over time
- Scheduled Scanning - automated recurring scans with configurable intervals
- Python 3.8 or higher
- Nmap installed on the system
- (Optional) Gunicorn or uWSGI for production deployment
- (Optional) The User running the application should have sudo access without a password for Nmap commands requiring root privileges
git clone <repository-url>
cd nmapwebuipython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateapt-get install -y --no-install-recommends nmap libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b libpangocairo-1.0-0pip install -r requirements.txtcp .env.example .envEdit the .env file with your configuration:
# Flask configuration
FLASK_APP=run_app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key
# Database configuration (use absolute path)
DATABASE_URL=sqlite:////home/user/nmapwebui/instance/app.db
# Worker configuration
NMAP_WORKER_POOL_SIZE=4
# Nmap configuration
NMAP_REPORTS_DIR=/home/user/nmapwebui/instance/reports
# Server configuration
FLASK_HOST=0.0.0.0
FLASK_PORT=5000flask db init
flask db migrate -m "Initial migration"
flask db upgradepython create_admin.pyThe application now runs as a single process, managing the web server, background workers, and scheduler internally.
python run_app.pyThe application will be accessible at http://127.0.0.1:5000 (or the URL shown in the console).
The application includes Docker support with automated service management using Supervisor.
- Docker installed on your system
- Docker Compose (usually included with Docker Desktop)
Create and configure your .env file (you can copy from .env.docker.example):
cp .env.docker.example .envImportant Docker-specific configuration:
# Database - path inside a container with a volume mount
DATABASE_URL=sqlite:////app/instance/app.db
# Worker configuration
NMAP_WORKER_POOL_SIZE=4
# Reports directory - mounted volume path
NMAP_REPORTS_DIR=/app/instance/reports
# Optional: Auto-create admin user on first run (password minimum 8 characters)
ADMIN_USER=admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your-secure-password-min-8-chars
# Other required variables
SECRET_KEY=your-secret-key
FLASK_HOST=0.0.0.0
FLASK_PORT=51234docker compose up -dThis will:
- Build the application image
- Start the NmapWebUI application with all services managed by Supervisor
- Expose the application on
http://localhost:51234
Build the image:
docker build -t nmapwebui .Run the container:
docker run -d \
--name nmapwebui-container \
-p 51234:51234 \
--env-file .env \
nmapwebui# All logs
docker logs nmapwebui-container
# Follow logs in real-time
docker logs -f nmapwebui-container
# Using Docker Compose
docker compose logs -f# Docker Compose
docker compose down
# Manual container
docker stop nmapwebui-container# Docker Compose
docker compose restart
# Manual container
docker restart nmapwebui-container- Access the web interface at the configured URL
- Log in with your admin credentials
- Add target groups to organize your scan targets
- Create scan tasks with custom Nmap configurations
- Execute scans manually or schedule them for automatic execution
- View results in the comprehensive report interface
- Manage users through the admin interface (if you have admin privileges)
The application consists of several components:
- Flask Web Application - main web interface and API
- APScheduler - handles background scan execution and manages scheduled tasks
- SQLite Database - stores application data (users, targets, scan configurations, results)
MIT License