If you've ever tried installing theHarvester directly on Kali/Parrot OS, you've probably encountered dependency or Python version issues. Fortunately, Docker makes the process much easier by packaging everything the application needs into a container. The official theHarvester project supports running the latest version using Docker Compose.
What is theHarvester?
theHarvester is an Open Source Intelligence (OSINT) tool used to collect information about a target domain from public sources. It can help identify:
- Subdomains
- Email addresses
- Hostnames
- IP addresses
- Public infrastructure information
It is commonly used during reconnaissance and security assessments.
Why Run the Latest Version?
The latest release introduces several improvements over older installations:
- API-driven architecture
- HarvestView management interface
- Scheduled harvesting
- Persistent run storage
- Enhanced OSINT source integrations
- Modern web-based interaction through FastAPI
These capabilities are not available in many of the older apt-based installations commonly found on security distributions.
Lab Environment
This tutorial was tested on:
- Parrot Security OS/Kali or any Debian distro
- Docker 26.x
- Docker Compose 2.x
Why Use Docker?
Traditionally, theHarvester was installed using apt or pip. However, recent releases introduced newer dependency requirements, including updated Python packages and runtime versions. Docker eliminates dependency conflicts by packaging the required environment inside a container, ensuring a consistent installation experience across Linux distributions such as Kali Linux, Parrot OS, and Ubuntu.
Traditionally, theHarvester was installed using apt or pip. However, recent releases introduced newer dependency requirements, including updated Python packages and runtime versions. Docker eliminates dependency conflicts by packaging the required environment inside a container, ensuring a consistent installation experience across Linux distributions such as Kali Linux, Parrot OS, and Ubuntu.
Step 1: Verify Docker Installation
First, ensure Docker is installed and working.
Example output:
If both commands return version information, you're ready to proceed.
Step 2: Download theHarvester
Clone the official repository:
Move into the project directory:
Step 3: Create the API Key
The latest Docker version requires an API key to access the web interface and API endpoints.
Create the secrets directory:
Generate a secure API key:
Set secure permissions:
Verify the key:
Example:
Keep this value safe because you'll need it later.
Step 4: Build and Start the Container
Start the application:
The first run may take several minutes because Docker needs to:
- Download dependencies
- Build the image
- Start the service
Eventually, you'll see something similar to:
This is a good sign and means the application is starting correctly.
Step 5: Run the Service in the Background
After confirming the build is successful:
Check container status:
Example:
A status of healthy means everything is working properly.
Step 6: Verify the Port Mapping
Check which port is exposed:
You may see:
This means:
| Location | Port |
|---|---|
| Host Machine | 5000 |
| Docker Container | 8000 |
Many beginners make the mistake of opening port 8000 in the browser.
✅ Correct URL:
❌ Wrong URL:
Step 7: Test if the API is Reachable
Try:
You will probably receive:
Don't worry.
This is actually good because it proves:
- The container is running
- The API is responding
- Authentication is enabled
Step 8: Load the API Key
Display your API key:
Save it into an environment variable:
Verify:
Step 9: Authenticate to the API
Now try again using the API key:
Expected output:
or a list of previous runs.
If you see data returned instead of an error, theHarvester is working correctly.
Step 10: Open the Web Interface
Open your browser and navigate to:
This displays the interactive Swagger interface generated by FastAPI.
From here you can:
- View available endpoints
- Submit requests
- Test API functions
- Explore response formats
Viewing Logs
If you want to monitor activity:
Typical output:
This shows requests being processed successfully.
Restarting the Service
To restart:
Stopping the Service
To stop everything:
Common Problems and Solutions
Problem 1: Invalid API Key
Error:
Solution:
Then:
Problem 2: Port 8000 Doesn't Open
You try:
and get nothing.
Check:
If you see:
use:
instead.
Problem 3: Container Not Starting
Check logs:
Check status:
The service should show:
Conclusion
Using Docker is the easiest way to run the latest version of theHarvester on Parrot OS. It avoids Python dependency issues, keeps the installation clean, and provides access to the newest features. After deployment, remember that the application is protected by an API key and is typically exposed on localhost:5000, not port 8000.
Happy Hunting! 🕵️♂️🔍🛡️



