- Switch between PostgreSQL and Neo4j backends
- Run multiple BHCE instances on a single machine
Prerequisites
BloodHound CE deploys in a traditional multi-tier container architecture consisting of database, application, and UI layers. To complete installation, ensure your system meets the following requirements:During startup, BloodHound CE runs initial graph analysis that may continue for about the first minute after launch. On low-memory hosts, sending API requests immediately after container startup can cause the
bloodhound container to terminate with exit code 137 (out of memory).To avoid this behavior, allocate at least 8GB of RAM or wait for startup processing to complete before running API automation tasks such as user creation.Install with Docker Compose
This installation method provides more control over each configuration file and works well for running multiple BHCE instances on a single machine.1
Install Docker Desktop
Follow the instructions in the Docker documentation to install Docker Desktop for your operating system.
Docker Desktop must be running to build and test BHCE. Start Docker Desktop on your machine.
2
Create installation directory
Create a new directory on your machine to hold the BHCE configuration files.
3
Download configuration files
Download the following configuration files:
4
Add configuration files
Move the configuration files into the directory you created.
5
Start BloodHound
Now that your files are ready, you can bring the containers up using the following command:
You only need to perform this step once. In the future, you can use the Docker Desktop application to start and turn off BloodHound. You can still use the CLI to bring the containers
up or down if you prefer.Build from source
You can also build the BHCE code from source if you plan on contributing to the project or customizing the application beyond what is possible with configuration files.Prerequisite
The following table lists the minimum requirements to build BHCE from source:These requirements are higher than the minimum specifications needed to run BHCE.
Set up your environment
The code repository contains all the necessary files to build BHCE. Follow these steps to set up your development environment:1
Clone the repository
Clone the BloodHound repository from GitHub:
2
Start Docker Desktop
Docker Desktop must be running to build and test BHCE. Start Docker Desktop on your machine.
3
Navigate to repository directory
Change to the cloned BloodHound repository directory:
4
Install dependencies
Use the following command to install project dependencies and initialize the environment:
5
Start development environment
Use the following command to start the development environment:
6
Compile BHCE
The BloodHound team maintains a Python tool called The build process generates all artifacts in the
stbernard for building and testing the project.To build locally, run the following command:dist/ directory.Customizations
This section describes common customizations you can make to your BHCE installation.Change backend database
PostgreSQL provides significant advantages over Neo4j as a backend database, particularly in terms of query performance and speed.For information on supported Cypher syntax in PostgreSQL, see Supported Cypher Syntax.
PostgreSQL
If you are currently using a Neo4j backend database and want to change to PostgreSQL, follow these steps.1
Add the PostgreSQL graph driver
Modify the This is an example of adding the line between
bloodhound.config.json file and add a line in the main section to use PostgreSQL as the graph driver:default_password and log_level, but it can be anywhere at the top level.2
Remove the Neo4j service
Modify the
docker-compose.yml file to remove the Neo4j service and its dependencies.-
Delete the
graph_dbsection: -
Delete the two lines at the end of the
bloodhoundsection: -
Delete the following line from the
volumessection:The following is the complete modifieddocker-compose.ymlfile for PostgreSQL:
Neo4j
If you are currently using a PostgreSQL backend database and want to change to Neo4j, follow these steps.1
Add the Neo4j service
Replace your
docker-compose.yml file with the following:2
Remove the PostgreSQL graph driver
Delete the following line from the
bloodhound.config.json file:Run multiple instances simultaneously
You might want to run multiple BHCE instances to:- Test a Neo4j backend alongside a PostgreSQL backend
- Evaluate a new version of BHCE without affecting your current installation
- Isolate data for different engagements
You must bind each instance to a different port on your machine. The steps below show you which settings to edit.
1
Change default BHCE port
In the
docker-compose.yml file, update the BloodHound service port binding to use a different port.The following example uses port 8585 instead of the default 8080 port:2
Change Neo4j web console port
If you are running multiple Neo4j databases, update the Neo4j web console port binding in the You must also update the health check to use the new port:
docker-compose.yml file to use a different port.The following example uses port 7575 instead of the default 7474 port:The Neo4j database port
7687 runs only inside the Docker container, so you do not need to change it.Expose BHCE outside of localhost
You might need to access your BHCE instance from another computer than the one it is installed on. The default installation does not
expose the port outside of localhost. To do it, you will need to change the IP Address the BloodHound UI.
In the docker-compose.yml file, update the BloodHound service port binding to use a different IP Address.
The following example uses IP 0.0.0.0 to bind the port 8080 to all interfaces and IP Addresses on the machine. If the machine has multiple IP Addresses, you can set that specific IP Address.