Prereq is OpenDJ installed in /opt/opendj
$ sudo su - opendj $ /opt/opendj/setup \ --cli \ --no-prompt \ --doNotStart \ --baseDN "dc=example,dc=com" \ --addBaseEntry \ --ldapPort 1389 \ --adminConnectorPort 4444 \ --enableStartTLS \ --ldapsPort 1636 \ --generateSelfSignedCertificate \ --acceptLicense \ --rootUserDN "cn=Directory Manager" \ --rootUserPassword [password] \ --hostname [hostname]
Start OpenDJ at boot
$ sudo /opt/opendj/bin/create-rc-script \ --outputFile /etc/init.d/opendj \ --userName opendj $ sudo update-rc.d opendj defaults