Chapter 15. Changing the LDAP and LDAPS port numbers


By default, Directory Server uses port 389 for the LDAP and, if you enabled, port 636 for the LDAPS protocol. You can change the port numbers, for example, to run multiple Directory Server instances on one host.

Important

Other services must not use new ports that you assigned to the protocols for an instance.

15.1. Changing the port numbers using the command line

You can change the port numbers of the LDAP and LDAPS protocol using the command line. LDAP and LDAPs port change requires update of the nsslapd-port and nsslapd-securePort parameters.

Procedure

  1. Optionally: Display the current port numbers for the instance:

    Copy to Clipboard Toggle word wrap
    # dsconf -D "cn=Directory Manager" ldap://server.example.com config get nsslapd-port nsslapd-securePort
  2. Change the LDAP port:

    1. Set the new port for the LDAP protocol. For example, to set it to 1389, run:

      Copy to Clipboard Toggle word wrap
      # dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-port=1389
    2. Set the ldap_port_t type for the LDAP port you assigned in the previous step:

      Copy to Clipboard Toggle word wrap
      # semanage port -a -t ldap_port_t -p tcp 1389
  3. Change the LDAPS port:

    1. Set the new port for the LDAPS protocol. For example, to set it to 1636, run:

      Copy to Clipboard Toggle word wrap
      # dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-securePort=1636
    2. Set the ldap_port_t type for the LDAPS port you assigned in the previous step:

      Copy to Clipboard Toggle word wrap
      # semanage port -a -t ldap_port_t -p tcp 1636
  4. Restart the instance:

    Copy to Clipboard Toggle word wrap
    # dsctl instance_name restart

Verification

  1. Verify that Directory Server now uses the new LDAP port by the command:

    Copy to Clipboard Toggle word wrap
    # dsconf instance_name config get nsslapd-port
  2. Verify that Directory Server now uses the new LDAPS port number by the command:

    Copy to Clipboard Toggle word wrap
    # dsconf instance_name config get nsslapd-securePort

Additional resources

15.2. Changing the port numbers using the web console

You can change the port numbers of the LDAP and LDAPS protocol using the web console.

Prerequisites

  • You are logged in to the instance in the web console.

Procedure

  1. Change the LDAP port:

    1. Open the Server Setting menu.
    2. On the Server Setting tab, enter the new port number into the LDAP Port field.
  2. Click Save.
  3. Change the LDAPS port:

    1. Open the Server Setting menu.
    2. On the General Settings tab, enter the new port number into the LDAPS Port field.
    3. Click Save.
  4. Restart the instance by clicking Action and selecting Restart Instance.

Verification

  1. Verify in the server setting that the changed port is reflected .

Additional resources

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.