How to Start OpenAM and OpenDJ in Separate Docker Contaners
To reproduce steps in the following article, Docker and Docker Compose should be installed.
The sample configuration used in the following article could be found here
docker-compose.yml file and add OpenAM service:
version: '3.9' services: openam: image: openidentityplatform/openam:latest ports: - "8080:8080" hostname: openam.example.com volumes: - ./persistence/openam:/usr/openam/config
Add OpenAM FQDN to your
hosts file on your machine, for example
persistence/openam folder OpenAM will store its configuration data
Add OpenDJ service to
opendj: image: openidentityplatform/opendj:latest hostname: opendj.example.com ports: - "1389:1389" - "1636:1636" - "4444:4444" volumes: - ./opendj/bootstrap/data/:/opt/opendj/bootstrap/data #initial data - ./opendj/bootstrap/schema/:/opt/opendj/bootstrap/schema #schema - ./persistence/opendj:/opt/opendj/data #opendj data environment: - BASE_DN=dc=openam,dc=openidentityplatform,dc=org #should be yours base DN
opendj/boststrap directory should exist on the host machine and contain two subfolders:
data - for initial data и
schema - schema files.
The files could be found here
If base DN id different from
dc=openam,dc=openidentityplatform,dc=org it should be changed in
opendj/boststrap/data/samlple.ldif file as well
Start and Configuration
Start OpenAM and OpenDJ with the following command:
You shoudl see the following lines in the logs:
openidentityplatform-docker-openam-1 | 15-Jun-2022 10:09:46.063 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] openidentityplatform-docker-openam-1 | 15-Jun-2022 10:09:46.133 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in  milliseconds openidentityplatform-docker-opendj-1 | OpenDJ is started
After OpenAM and OpenDJ are started, open OpenAM URL in the browser, for example http://auth.example.com:8080/openam
OpenAM configuration window should appear:
Select Custom Configuration and press Create New Configuration. Read and accept the license agreement.
Enter and confirm amAdmin password, then press the Next button.
Leave server settings unchanged and press the Next button.
On the Configuration Data Store Settings step set the following settings:
- Configuration Data Store radiobutton to OpenDJ,
- Set Host Name to opendj, as OpenDJ Docker internal hostname
- Set Port to 1389 as specified for OpenDJ Docker container
- Set OpenDJ password as specified for OpenDJ Docker container as well (
If you changed base DN for OpenDJ, set the required Root Suffix as well.
Then press the Next button.
On the User datastore settings set OpenDJ password as it has been set in the previous step and press the Next button.
If this instance is behind a load balancer, set the site configuration settings. If it’s not, just press the Next button.
On the Step 6: Default Policy Agent User, enter and confirm default policy agent password and press the Next button.
Review configuration summary and press the Create Configuration button.
If everything is ok, proceed to login page.
If you have any additional questions, feel free to ask us!