Skip to main content
Applies to BloodHound CE only BloodHound Community Edition is already compatible with PostgreSQL 18. Use this guide to get a head start on the latest PostgreSQL release before it becomes the default bundled version, and to benefit from its new capabilities and performance improvements. However, the upgrade introduces a breaking change to the Docker volume mount path that prevents a simple image tag update.
The PostgreSQL 18 Docker image uses a different volume mount path than version 16. Starting a PostgreSQL 18 container against an existing PostgreSQL 16 volume will fail. You must migrate your data using the scripts provided on this page.
The upgrade scripts on this page automate the migration by dumping your existing data, backing up the Docker volume, updating your docker-compose.yml, and restoring the data into a fresh PostgreSQL 18 container.

Prerequisites

  • Docker with the Compose V2 plugin (docker compose, not docker-compose)
  • Sufficient free disk space for the database dump file and a volume backup
  • PowerShell 5.1 or later (all platforms), or bash (Linux/macOS)
  • Your BloodHound CE installation must be accessible and running before you begin

Before you begin

Back up your data before running the upgrade script. The scripts automatically create a copy of your PostgreSQL Docker volume, but you should verify that your data is intact independently before and after the migration.
The upgrade scripts perform the following steps in order:

Run the upgrade script

Save the following script to a file and run it.
Save the script as upgrade-pg.ps1 and run it with .\upgrade-pg.ps1.

Verify the upgrade

After the script finishes running, confirm that the database is healthy and your data is intact.
1

Check the container status

Confirm all containers are running:
The app-db container should show a status of healthy.
2

Confirm the PostgreSQL version

Confirm that PostgreSQL 18 is running:
The output should include PostgreSQL 18.
3

Log in to BloodHound CE

Open your browser and navigate to BloodHound CE (default: http://127.0.0.1:8080). Log in and confirm that your data is accessible.

Clean up

After you have verified that the upgrade was successful and your data is intact, remove the temporary files and backup volume created during the migration. Replace the placeholder values with the actual paths and volume name printed by the script.