# How to install Soffid LDAP?

## Installation with docker

### Prerequisites

To install **Soffid LDAP**, you must install [Docker](https://hub.docker.com/search?q=&type=edition&offering=community). Despite Docker desktop can be used for testing purposes, Docker container runtime usage is recommended.

### Installation

To start Soffid LDAP, execute:

```shell
docker volume create ldapconf
docker volume create ldapdata
docker run --name soffidldap -p 1389:389 -v ldapconf:/etc/ldap/slapd.d -v ldapdata:/var/lib/ldap -d -e SOFFID_SERVER=https://<SYNCSERVERNAME>:760 -e SOFFID_AGENT=<SOFFID_AGENT> -e USER=<ADMIN_USERNAME> -e PASSWORD=<ADMIN_PASSWORD> -e DN=<YOUR_BASE_DN> soffid/soffidldap:latest
```

<details id="bkmrk-%F0%9F%92%BB-image"><summary>💻 Image</summary>

[![image-1654601131618.png](https://bookstack.soffid.com/uploads/images/gallery/2022-06/scaled-1680-/image-1654601131618.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-06/image-1654601131618.png)

</details>Now, you can connect to the LDAP Server using the user name and password used to create the docker instance.

#### Docker commands

##### Stop the service

```
docker stop soffidldap
```

##### Start the service

```
docker start soffidldap
```

##### Remove the service

```
docker rm soffidldap
```

#### Docker Volumes

- The initial configuration files are located in the **ldapconf volume**, usually in /var/lib/docker/volumes/ldapconf/\_data
- The initial data files are located in the **ldapdata volume**, usually in /var/lib/docker/volumes/ldapdata/\_data

## Installation with docker compose

### Prerequisites

To install **Soffid LDAP** using **Docker Compose**, you must first have installed it.

### Installation

Create a new **folder** or use the one in your current environment; you need to add the following service to the **docker-compose.yaml** file.

<p class="callout warning">Remember to enter the correct values for variables of type **&lt;VALUE&gt;**.</p>

```shell
services:

  soffidldap:
    image: soffid/soffidldap:latest
    environment:
      SOFFID_SERVER: https://<SYNCSERVERNAME>:<PORT>
      SOFFID_AGENT: <SOFFID_AGENT>
      USER: <ADMIN_USERNAME>
      PASSWORD: <ADMIN_PASSWORD>
      DN: <YOUR_BASE_DN>
    networks:
      - network
    ports:
      - 1389:389
    volumes:
      - ldapconf:/etc/ldap/slapd.d 
      - ldapdata:/var/lib/ldap

networks:

  network:
    name: netversion4
    driver: bridge

volumes:

  ldapconf:
    name: soffidldap_ldapconf
  ldapdata:
    name: soffidldap_ldapdata
```

This is an example of a configuration.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2026-08/scaled-1680-/ySQMlkiR4UPkFnko-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2026-08/ySQMlkiR4UPkFnko-image.png)

We deploy the service.

```shell
docker compose up -d
```

### Testing

Now, you can connect to the **LDAP** Server using the **user** and **password** used to create the docker service.

<p class="callout info">You can use a free tool such as **Apache Directory Studio**.</p>

### Docker compose commands

<p class="callout info">If you need further information about Docker Compose, you can visit the [Docker Compose commands](https://bookstack.soffid.com/books/utilities/page/docker-compose-commands "Docker compose commands") page</p>

### Docker Volumes

- The initial configuration files are located in the **ldapconf volume**, usually in /var/lib/docker/volumes/ldapconf/\_data
- The initial data files are located in the **ldapdata volume**, usually in /var/lib/docker/volumes/ldapdata/\_data