Install LDAP Server
First you need to install these two aptitude packages
apt install dialog
apt install slapd
Configure
Second we need to configure our LDAP-Server by running this Command
dpkg-reconfigure slapd
Configure the Server how you like and give it a password

Output:
Backing up /etc/ldap/slapd.d in /var/backups/slapd-2.4.57+dfsg-3+deb11u1... done.
Moving old database directory to /var/backups:
- directory unknown... done.
Creating initial configuration... done.
Creating LDAP directory... done.
Verify that Server is running
Check with running on Port
ss -tlnp | grep :389
LISTEN 0 1024 0.0.0.0:389 0.0.0.0:* users:(("slapd",pid=46520,fd=8))
LISTEN 0 1024 [::]:389 [::]:* users:(("slapd",pid=46520,fd=9))
Check with ldapsearch
ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn
dn: cn=config
dn: cn=module{0},cn=config
dn: cn=schema,cn=config
dn: cn={0}core,cn=schema,cn=config
dn: cn={1}cosine,cn=schema,cn=config
dn: cn={2}nis,cn=schema,cn=config
dn: cn={3}inetorgperson,cn=schema,cn=config
dn: olcDatabase={-1}frontend,cn=config
dn: olcDatabase={0}config,cn=config
dn: olcDatabase={1}mdb,cn=config
Check with ldapwhoami
ldapwhoami -x
anonymous
Connect to own Server
We can now connect to our own Ldap server as admin with our admin password that we defined earlier in dpkg-reconfigure slapd

When we connect to our server from our Apache Directory Studio it should look like this:
