A comprehensive Docker-based setup for running jBPM (Business Process Management) with Keycloak authentication and PostgreSQL database.
This project provides a fully containerized jBPM environment with:
- jBPM Server - Business process management platform based on Wildfly
- Keycloak - Identity and access management (IAM) for authentication
- PostgreSQL - Database backend for both jBPM and Keycloak
The system consists of three main services orchestrated via Docker Compose:
┌─────────────────┐
│ jBPM Server │
│ Port: 8080 │ ──┐
│ Port: 9990 │ │
└─────────────────┘ │
│
┌─────────────────┐ │ ┌──────────────┐
│ Keycloak │ ├───▶│ PostgreSQL │
│ Port: 9080 │ │ │ Port: 5432 │
│ Port: 9443 │ │ └──────────────┘
└─────────────────┘ │
│
Network: jbpm-network
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- 4GB+ RAM available for containers
- Ports available: 5432, 8080, 8001, 9080, 9443, 9990
-
Clone the repository
git clone <repository-url> cd jbpm
-
Configure hosts file for Keycloak SSO
Add the following entry to your hosts file to enable Keycloak SSO:
Linux/Mac:
sudo bash -c 'echo "127.0.0.1 keycloak.internal" >> /etc/hosts'Windows (as Administrator):
Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "127.0.0.1 keycloak.internal"
Or manually edit:
- Linux/Mac:
/etc/hosts - Windows:
C:\Windows\System32\drivers\etc\hosts
Add this line:
127.0.0.1 keycloak.internal - Linux/Mac:
-
Start all services
docker-compose up -d
-
Wait for services to initialize The first startup may take 2-3 minutes. Monitor with:
docker-compose logs -f
-
Access the applications
- jBPM Business Central: http://localhost:8080/business-central
- jBPM Case Management: http://localhost:8080/jbpm-casemgmt
- KIE Server: http://localhost:8080/kie-server
- Keycloak Admin: http://localhost:9080
Access: http://localhost:9080
| Username | Password | Description |
|---|---|---|
| admin | admin | Keycloak administrator |
Access: http://localhost:8080/business-central
All jBPM users authenticate through Keycloak. The following pre-configured users are available:
| Username | Password | Roles | Description |
|---|---|---|---|
| wbadmin | wbadmin | admin, kiemgmt, rest-all, kie-server, realm-admin | Workbench administrator with full permissions |
| gio | gio | admin, kiemgmt, rest-all, kie-server | General administrator user |
| kieserver | kieserver1! | admin, kiemgmt, rest-all, kie-server | Service account for KIE Server operations |
Note: Passwords are hashed in the Keycloak export. To reset passwords:
- Log into Keycloak Admin Console (http://localhost:9080)
- Navigate to: Realm: jbpm → Users
- Select user → Credentials tab
- Set new password
| Service | Username | Password | Database |
|---|---|---|---|
| jBPM | jbpm | jbpm | jbpm |
| Keycloak | keycloak | keycloak | keycloak |
| PostgreSQL Admin | jbpm | jbpm | postgres |
- Base Image:
quay.io/kiegroup/jbpm-server-full:latest - Port 8080: Web applications (Business Central, Case Management, KIE Server)
- Port 9990: Wildfly management console
- Port 8001: SSH Git access (localhost only)
Applications:
- Business Central: Process authoring and management UI
- Case Management: Case-based process management
- KIE Server: Execution server with REST API
Persistent Volumes:
./data/wb_git- Git repository for business assets./data/jbpm_m2_repository- Maven repository cache./data/jbpm_data- Runtime data
- Base Image:
quay.io/keycloak/keycloak:18.0 - Port 9080: HTTP interface
- Port 9443: HTTPS interface (self-signed certificate)
- Realm: jbpm
Security Features:
- JWT token-based authentication
- Basic auth support via Direct Access Grant
- Resource-based role mappings
- Self-signed SSL certificate for internal communication
Client Applications:
kie- Business Central clientkie-execution-server- KIE Server clientkie-git- Git SSH authentication client
- Image:
postgres:15-alpine - Port: 5432
- Databases: jbpm, keycloak
docker-compose.yml- Service orchestrationDockerfile- jBPM server custom buildkeycloak.Dockerfile- Keycloak custom build with SSL.dockerignore- Docker build exclusions
jbpm-config/kie-git.json- Keycloak client config for Git SSHscripts/start_jbpm-wb.sh- Startup script with Keycloak integrationscripts/jbpm-keycloak-setup.cli- Wildfly CLI for Keycloak adapterscripts/custom.cli- Custom Wildfly configurationscripts/setup-wildfly.sh- Wildfly setup helper
keycloak-config/realms-export/jbpm-realm.json- Realm definitionkeycloak-config/realms-export/jbpm-users-0.json- Pre-configured userskeycloak-config/keycloak.keystore- SSL certificate (self-signed)
postgres-config/init-db.sql- Database initialization script
JBPM_DB_DRIVER: postgres
JBPM_DB_HOST: postgres
JBPM_DB_PORT: 5432
JBPM_DB_NAME: jbpm
JBPM_DB_USER: jbpm
JBPM_DB_PASSWORD: jbpm
KIE_SERVER_ID: jbpm-server
KEYCLOAK_URL: https://keycloak.internal:9443
JAVA_OPTS: -Xms1024m -Xmx2048mKC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HOSTNAME: localhostAll services communicate on the jbpm-network bridge network:
-
Hostname Resolution:
postgres→ PostgreSQL databasekeycloak,keycloak.internal→ Keycloak serverjbpm→ jBPM server
-
SSL/TLS: Keycloak uses self-signed certificates. jBPM trusts these via a custom keystore at
/opt/jboss/keycloak.keystore
# Start all services
docker-compose up -d
# Start specific service
docker-compose up -d postgres
docker-compose up -d keycloak
docker-compose up -d jbpm
# View logs
docker-compose logs -f jbpm# Stop all services
docker-compose down
# Stop and remove volumes (WARNING: deletes all data)
docker-compose down -v# Rebuild jBPM server
docker-compose build jbpm
# Rebuild Keycloak
docker-compose build keycloak
# Rebuild and restart
docker-compose up -d --build# Access jBPM container
docker exec -it jbpm-server bash
# Access Keycloak container
docker exec -it jbpm-keycloak bash
# Access PostgreSQL
docker exec -it jbpm-postgres psql -U jbpm -d jbpm- Check port availability:
netstat -an | grep -E "(5432|8080|9080|9443|9990)" - Ensure Docker daemon is running
- Check logs:
docker-compose logs
- Verify Keycloak is healthy:
docker-compose ps - Check certificate trust:
docker logs jbpm-server | grep -i ssl - Ensure hostname resolution:
docker exec jbpm-server ping keycloak.internal
- Check PostgreSQL health:
docker-compose ps postgres - Verify credentials in docker-compose.yml
- Check database logs:
docker-compose logs postgres
- Verify Keycloak realm is imported:
docker-compose logs keycloak | grep "jbpm" - Check client secrets match in:
scripts/jbpm-keycloak-setup.clijbpm-config/kie-git.json- Keycloak Admin Console → Clients
# Stop and remove all containers and volumes
docker-compose down -v
# Remove local data directories (optional)
rm -rf data/jbpm_data/* data/wb_git/* data/jbpm_m2_repository/*
# Restart
docker-compose up -d- jBPM: Business Process Management platform (KIE group)
- Wildfly: Java EE application server
- Keycloak 18.0: Identity and Access Management
- PostgreSQL 15: Relational database
- Docker & Docker Compose: Containerization
- Java: Runtime environment
admin- Full administrative accesskiemgmt- KIE management permissionsrest-all- Full REST API accesskie-server- KIE Server execution permissionsrealm-admin- Keycloak realm administration (wbadmin only)
Roles are mapped at both realm and client levels in Keycloak. The configuration uses resource-level role mappings for fine-grained access control.
Please refer to the upstream project licenses:
- jBPM: Apache License 2.0
- Keycloak: Apache License 2.0
- PostgreSQL: PostgreSQL License
- jBPM Documentation: https://docs.jbpm.org/
- Keycloak Documentation: https://www.keycloak.org/documentation
- Docker Compose: https://docs.docker.com/compose/
Version: 1.0 Last Updated: 2025-01-20 Maintained by: Development Team