ldaps support for Nextcloud snap

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
  • Operating system and version (e.g., Ubuntu 24.04):
    • Oracle Linux 9.6
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • initial ldaps bind
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • snap on vm
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I am having trouble getting my nextcloud install to bind to my AD server using ldaps

I can bind on the command line using ldapsearch

I have placed my AD CA cert in the snap’s certs folder and even made a hashed link to it

I have looked at nextcloud log with the logging turned up to 255, but the errors are very generic.

I am using SELinux, but I have allowed LDAP from httpd and I am not seeing any blocks in the audit log.

Is there something I need to do to point the snap at the cert.

Is is maybe a DNS issue where the sandbox is not resolving my local domain correctly.

Is there a way for me to manually test this beyond trying different combinations of values on the configuration page?

I am pretty stuck, so any help would be appreciated.

Please let me know if you need any more information.

Thanks!

Steps to replicate it (hint: details matter!):

  1. Install nextcloud as snap
  2. Enable user_ldap app
  3. Set ldaps host to AD controller, port to 636 (manually),
  4. Set DN to service account and provide password
  5. set known good base dn
  6. test the base DN and get the following errors:

The base dn appears to be wrong
Lost connection to the ldap server

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"30iwIHYQIpdx1IBuOl6v","level":2,"time":"2025-08-16T02:11:51+00:00","remoteAddr":"redacted","user":"admin","app":"PHP","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"ldap_bind(): Unable to bind to server: Can't contact LDAP server at /snap/nextcloud/49338/htdocs/apps/user_ldap/lib/LDAP.php#285","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 OPR/120.0.0.0","version":"31.0.7.1","data":{"app":"PHP"}}

{"reqId":"lJaqhQhExXjJsMlWWze4","level":2,"time":"2025-08-16T02:18:50+00:00","remoteAddr":"redacted","user":"admin","app":"PHP","method":"POST","url":"/index.php/apps/user_ldap/ajax/wizard.php","message":"ldap_bind(): Unable to bind to server: Invalid credentials at /snap/nextcloud/49338/htdocs/apps/user_ldap/lib/LDAP.php#285","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 OPR/120.0.0.0","version":"31.0.7.1","data":{"app":"PHP"}}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

nextcloud.occ config:list 
{
    "system": {
        "apps_paths": [
            {
                "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "supportedDatabases": [
            "mysql"
        ],
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "log_type": "file",
        "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",
        "logfilemode": 416,
        "maintenance_window_start": 1,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.my.edu"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "25",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false
    },
    "apps": {
        "activity": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": "filesystem"
        },
        "app_api": {
            "enabled": "yes",
            "installed_version": "5.0.2",
            "types": ""
        },
        "backgroundjob": {
            "lastjob": "18"
        },
        "bruteforcesettings": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "circles": {
            "enabled": "yes",
            "installed_version": "31.0.0",
            "loopback_tmp_scheme": "http",
            "maintenance_run": "0",
            "maintenance_update": "{\"3\":1755308877,\"2\":1755312379,\"1\":1755312379}",
            "migration_22": "1",
            "migration_run": "0",
            "types": "filesystem,dav"
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "1.14.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "logging"
        },
        "contactsinteraction": {
            "enabled": "yes",
            "installed_version": "1.12.0",
            "types": "dav"
        },
        "core": {
            "backgroundjobs_mode": "cron",
            "emailTestSuccessful": "1",
            "installedat": "1755117534.5603",
            "lastcron": 1755312379,
            "lastupdatedat": 1755117534,
            "mail_providers_enabled": false,
            "metadataGenerationDone": true,
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "vendor": "nextcloud",
            "files_metadata": {
                "photos-original_date_time": {
                    "value": null,
                    "type": "int",
                    "etag": "",
                    "indexed": true,
                    "editPermission": 0
                },
                "photos-size": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-exif": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-ifd0": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "blurhash": {
                    "value": null,
                    "type": "string",
                    "etag": "07bbc39aec077bbc55181100d08d918b",
                    "indexed": false,
                    "editPermission": 0
                }
            },
            "oc.integritycheck.checker": []
        },
        "dashboard": {
            "enabled": "yes",
            "installed_version": "7.11.0",
            "types": ""
        },
        "dav": {
            "buildCalendarReminderIndex": "yes",
            "buildCalendarSearchIndex": "yes",
            "builtSocialSearchIndex": "yes",
            "enabled": "yes",
            "installed_version": "1.33.0",
            "regeneratedBirthdayCalendarsForYearFix": "yes",
            "types": "filesystem"
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "authentication"
        },
        "files": {
            "enabled": "yes",
            "installed_version": "2.3.1",
            "mimetype_version": "31.0.7.1",
            "types": "filesystem"
        },
        "files_downloadlimit": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "files_reminders": {
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.23.1",
            "types": "filesystem"
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "filesystem,dav"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.24.0",
            "types": "filesystem,dav"
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": "logging"
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "authentication"
        },
        "nextcloud_announcements": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200",
            "types": "logging"
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.19.1",
            "types": "authentication"
        },
        "password_policy": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": "authentication"
        },
        "photos": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "lastPlaceMappedUser": "admin",
            "lastPlaceMappingDone": "true",
            "types": "dav,authentication"
        },
        "privacy": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": ""
        },
        "profile": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "prevent_group_restriction"
        },
        "recommendations": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "related_resources": {
            "enabled": "yes",
            "installed_version": "2.0.0",
            "types": ""
        },
        "serverinfo": {
            "cached_count_appdata_files": 151,
            "cached_count_filecache": 210,
            "cached_count_storages": 2,
            "enabled": "yes",
            "installed_version": "3.0.0",
            "size_appdata_storage": 0,
            "types": ""
        },
        "settings": {
            "enabled": "yes",
            "installed_version": "1.14.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "filesystem"
        },
        "support": {
            "SwitchUpdaterServerHasRun": "yes",
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": "session"
        },
        "survey_client": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": ""
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "1.21.1",
            "types": "logging"
        },
        "text": {
            "enabled": "yes",
            "installed_version": "5.0.0",
            "types": "dav"
        },
        "theming": {
            "enabled": "yes",
            "installed_version": "2.6.1",
            "types": "logging"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.20.0",
            "types": ""
        },
        "user_ldap": {
            "background_sync_interval": "1800",
            "background_sync_offset": "0",
            "background_sync_prefix": "s01",
            "cleanUpJobOffset": "0",
            "enabled": "yes",
            "installed_version": "1.22.0",
            "s01_lastChange": "1755312182",
            "s01has_memberof_filter_support": "0",
            "s01home_folder_naming_rule": "",
            "s01last_jpegPhoto_lookup": "0",
            "s01ldap_admin_group": "",
            "s01ldap_agent_password": "***REMOVED SENSITIVE VALUE***",
            "s01ldap_attr_address": "",
            "s01ldap_attr_anniversarydate": "",
            "s01ldap_attr_biography": "",
            "s01ldap_attr_birthdate": "",
            "s01ldap_attr_fediverse": "",
            "s01ldap_attr_headline": "",
            "s01ldap_attr_organisation": "",
            "s01ldap_attr_phone": "",
            "s01ldap_attr_pronouns": "",
            "s01ldap_attr_role": "",
            "s01ldap_attr_twitter": "",
            "s01ldap_attr_website": "",
            "s01ldap_attributes_for_group_search": "cn\ndescription\nname",
            "s01ldap_attributes_for_user_search": "cn",
            "s01ldap_background_host": "",
            "s01ldap_background_port": "",
            "s01ldap_backup_host": "",
            "s01ldap_backup_port": "",
            "s01ldap_base": "DC=my,DC=local",
            "s01ldap_base_groups": "OU=groups,OU=accounts,DC=my,DC=local",
            "s01ldap_base_users": "OU=faculty,OU=users,OU=accounts,DC=my,DC=local",
            "s01ldap_cache_ttl": "600",
            "s01ldap_configuration_active": "1",
            "s01ldap_connection_timeout": "15",
            "s01ldap_default_ppolicy_dn": "",
            "s01ldap_display_name": "displayName",
            "s01ldap_dn": "cn=NextCloud Service,ou=Users,DC=my,DC=local",
            "s01ldap_dynamic_group_member_url": "",
            "s01ldap_email_attr": "",
            "s01ldap_experienced_admin": "1",
            "s01ldap_expert_username_attr": "",
            "s01ldap_expert_uuid_group_attr": "",
            "s01ldap_expert_uuid_user_attr": "objectguid",
            "s01ldap_ext_storage_home_attribute": "",
            "s01ldap_gid_number": "gidNumber",
            "s01ldap_group_display_name": "cn",
            "s01ldap_group_filter": "objectClass=posixGroup",
            "s01ldap_group_filter_mode": "0",
            "s01ldap_group_member_assoc_attribute": "member",
            "s01ldap_groupfilter_groups": "",
            "s01ldap_groupfilter_objectclass": "",
            "s01ldap_host": "ldaps:\/\/adwin1.my.local",
            "s01ldap_login_filter": "(& (sAMAccountName=%uid)(memberOf=CN=faculty,OU=groups,OU=accounts,DC=my,DC=local))",
            "s01ldap_login_filter_mode": "0",
            "s01ldap_loginfilter_attributes": "",
            "s01ldap_loginfilter_email": "0",
            "s01ldap_loginfilter_username": "1",
            "s01ldap_mark_remnants_as_disabled": "0",
            "s01ldap_matching_rule_in_chain_state": "unknown",
            "s01ldap_nested_groups": "0",
            "s01ldap_override_main_server": "",
            "s01ldap_paging_size": "500",
            "s01ldap_port": "636",
            "s01ldap_quota_attr": "",
            "s01ldap_quota_def": "",
            "s01ldap_tls": "",
            "s01ldap_turn_off_cert_check": "0",
            "s01ldap_turn_on_pwd_change": "0",
            "s01ldap_user_avatar_rule": "default",
            "s01ldap_user_display_name_2": "",
            "s01ldap_user_filter_mode": "0",
            "s01ldap_userfilter_groups": "",
            "s01ldap_userfilter_objectclass": "",
            "s01ldap_userlist_filter": "objectClass=posixAccount",
            "s01use_memberof_to_detect_membership": "1",
            "types": "authentication"
        },
        "user_status": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": ""
        },
        "viewer": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "weather_status": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": ""
        },
        "webhook_listeners": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "filesystem"
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "2.13.0",
            "types": "filesystem"
        }
    }
}

Apps

The output of occ app:list (if possible).
nextcloud.occ app:list
Enabled:

  • activity: 4.0.0
  • app_api: 5.0.2
  • bruteforcesettings: 4.0.0
  • circles: 31.0.0
  • cloud_federation_api: 1.14.0
  • comments: 1.21.0
  • contactsinteraction: 1.12.0
  • dashboard: 7.11.0
  • dav: 1.33.0
  • federatedfilesharing: 1.21.0
  • federation: 1.21.0
  • files: 2.3.1
  • files_downloadlimit: 4.0.0
  • files_pdfviewer: 4.0.0
  • files_reminders: 1.4.0
  • files_sharing: 1.23.1
  • files_trashbin: 1.21.0
  • files_versions: 1.24.0
  • firstrunwizard: 4.0.0
  • logreader: 4.0.0
  • lookup_server_connector: 1.19.0
  • nextcloud_announcements: 3.0.0
  • notifications: 4.0.0
  • oauth2: 1.19.1
  • password_policy: 3.0.0
  • photos: 4.0.0
  • privacy: 3.0.0
  • profile: 1.0.0
  • provisioning_api: 1.21.0
  • recommendations: 4.0.0
  • related_resources: 2.0.0
  • serverinfo: 3.0.0
  • settings: 1.14.0
  • sharebymail: 1.21.0
  • support: 3.0.0
  • survey_client: 3.0.0
  • systemtags: 1.21.1
  • text: 5.0.0
  • theming: 2.6.1
  • twofactor_backupcodes: 1.20.0
  • user_ldap: 1.22.0
  • user_status: 1.11.0
  • viewer: 4.0.0
  • weather_status: 1.11.0
  • webhook_listeners: 1.2.0
  • workflowengine: 2.13.0
    Disabled:
  • admin_audit: 1.21.0
  • encryption: 2.19.0
  • files_external: 1.23.0
  • suspicious_login: 9.0.1
  • twofactor_nextcloud_notification: 5.0.0
  • twofactor_totp: 13.0.0-dev.0

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.
1 Like

Thanks! I’ll just do it the old fashioned way, then. I appreciate the link. I guess the search engines hadn’t indexed that one yet. (or I wasn’t thorough enough) Thanks again.