<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ali Benromdhane</title>
    <description>The latest articles on DEV Community by Ali Benromdhane (@alibenromdhane).</description>
    <link>https://dev.to/alibenromdhane</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1037693%2Fcb7b403c-afc6-40b0-9927-0d4c0cc383ab.jpeg</url>
      <title>DEV Community: Ali Benromdhane</title>
      <link>https://dev.to/alibenromdhane</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alibenromdhane"/>
    <language>en</language>
    <item>
      <title>How to Set Up and Configure OpenLDAP in a Docker Container with PhpLDAPadmin</title>
      <dc:creator>Ali Benromdhane</dc:creator>
      <pubDate>Tue, 16 May 2023 20:11:27 +0000</pubDate>
      <link>https://dev.to/alibenromdhane/how-to-set-up-and-configure-openldap-in-a-docker-container-with-phpldapadmin-1ido</link>
      <guid>https://dev.to/alibenromdhane/how-to-set-up-and-configure-openldap-in-a-docker-container-with-phpldapadmin-1ido</guid>
      <description>&lt;p&gt;If you are looking to set up an &lt;strong&gt;LDAP server&lt;/strong&gt; and need an easy way to manage it, installing &lt;strong&gt;OpenLDAP with phpLDAPadmin&lt;/strong&gt; using Docker can make your life a lot easier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9owgnxgbawpdo8r9m6es.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9owgnxgbawpdo8r9m6es.png" alt="image of openldap/docker/phpldapadmin" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LDAP or Lightweight Directory Access Protocol&lt;/strong&gt; is a protocol that allows users to access and maintain directory information services over the internet. It's used by many organizations for authentication, authorization, and other tasks.&lt;/p&gt;

&lt;p&gt;1-Install Docker on your machine if you haven't already. You can download Docker from their &lt;a href="https://docs.docker.com/engine/install/" rel="noopener noreferrer"&gt;website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2-Create a new directory on your machine where you want to store the configuration files for your LDAP server.&lt;/p&gt;

&lt;p&gt;3-Inside the newly created directory, create a new file called &lt;strong&gt;docker-compose.yml&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;3-Copy the following code into the docker-compose.yml file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3.7'
services:
  openldap:
    image: osixia/openldap:latest
    container_name: openldap
    hostname: openldap
    ports: 
      - "389:389"
      - "636:636"
    volumes:
      - ./data/certificates:/container/service/slapd/assets/certs
      - ./data/slapd/database:/var/lib/ldap
      - ./data/slapd/config:/etc/ldap/slapd.d
    environment: 
      - LDAP_ORGANISATION=alibnr
      - LDAP_DOMAIN=alibnr.com
      - LDAP_ADMIN_USERNAME=admin
      - LDAP_ADMIN_PASSWORD=admin_pass
      - LDAP_CONFIG_PASSWORD=config_pass
      - "LDAP_BASE_DN=dc=alibnr,dc=com"
      - LDAP_TLS_CRT_FILENAME=server.crt
      - LDAP_TLS_KEY_FILENAME=server.key
      - LDAP_TLS_CA_CRT_FILENAME=alibnr.com.ca.crt
      - LDAP_READONLY_USER=true
      - LDAP_READONLY_USER_USERNAME=user-ro
      - LDAP_READONLY_USER_PASSWORD=ro_pass
    networks:
      - openldap

  phpldapadmin:
    image: osixia/phpldapadmin:latest
    container_name: phpldapadmin
    hostname: phpldapadmin
    ports: 
      - "80:80"
    environment: 
      - PHPLDAPADMIN_LDAP_HOSTS=openldap
      - PHPLDAPADMIN_HTTPS=false
    depends_on:
      - openldap
    networks:
      - openldap

networks:
  openldap:
    driver: bridge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5-Save the file and run the following command in the terminal inside the directory where you created the docker-compose.yml file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start the OpenLDAP and phpLDAPadmin containers in the background.&lt;/p&gt;

&lt;p&gt;6-Once the containers are up and running, you can access the phpLDAPadmin web interface by opening a web browser and entering the following URL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7-To log in, enter &lt;strong&gt;cn=admin,dc=alibnr,dc=com&lt;/strong&gt; as the username and &lt;strong&gt;admin_pass&lt;/strong&gt; as the password.&lt;/p&gt;

&lt;p&gt;8-After logging in, you can start managing your LDAP server using the phpLDAPadmin interface.&lt;/p&gt;

&lt;p&gt;That's it! You now have a fully functional and easy-to-manage LDAP server using Docker and phpLDAPadmin.&lt;/p&gt;

</description>
      <category>phpldapadmin</category>
      <category>docker</category>
      <category>tutorial</category>
      <category>openldap</category>
    </item>
  </channel>
</rss>
