Since Ghidra 11.4, we have entrypoints to use Ghidra from official docker scripts.
But it's lacking a beginning-friendly tutorial to setup a bsim server using PostreSQL. Here's how to make it step by step:
-
Go to the Ghidra root folder
-
Build the docker images:
./docker/build-docker-image.sh
- Create an empty folder to store the postgres database files:
mkdir db
- Start the container using
bsim-server
mode:
docker run \
--env MODE=bsim-server \
--rm \
-it \
--volume ./db:/ghidra/bsim_datadir \
-p 5432:5432 \
ghidra/ghidra:_ \
/ghidra/bsim_datadir
- In a new terminal tab, start a bash session on the above container:
docker exec -it $(docker ps -q --filter "ancestor=ghidra/ghidra:_" | head -n 1) bash
- Create a new database on postgres
cd support
./bsim createdatabase postgresql://ghidra@localhost:5432/mydb medium_32
- On Ghidra UI, go to
BSim -> Manage Servers
. If you can't see this menu, make sure you've enabled BSim.

- Click on + and fill out the form with the following values:
- DB Name: mydb
- User: ghidra
- Host: localhost

Done! 🎉