To add an existing SMB share to Nextcloud, enable External Storage Support and add an SMB/CIFS mount in the admin settings. Enter the SMB host, share and credentials, then use Available for to choose the users or groups who should see the folder in Files. Admin mount settings · SMB/CIFS fields · External storage in Files
Check SMB support and reachability
Sign in as a Nextcloud administrator and enable External Storage Support under Apps. Enable External Storage Support
The Nextcloud server needs the PHP smbclient module or the smbclient binary. Nextcloud recommends the PHP module and falls back to the binary when the module is absent. SMB/CIFS requirements
On a manual Debian or Ubuntu installation, run OCC from the Nextcloud directory as www-data, using the same PHP version as the web server. OCC runtime
files_external:dependencies reports missing PHP extensions or system packages for configured external storage backends. OCC dependency check
sudo -E -u www-data php occ files_external:dependencies
On Nextcloud All-in-One (AIO), run the check inside the Nextcloud container. AIO OCC wrapper · OCC dependency check
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files_external:dependencies
If the Samba CLI is available on the Nextcloud server, use it to check the share directly. In the example, replace SERVER with the SMB server’s NetBIOS name, SHARE with the share name and SMB_USER with your SMB account. Samba connection syntax
smbclient '//SERVER/SHARE' -U 'SMB_USER'
Enter the password if prompted, then type dir * in the SMB session to list files. Samba password prompt and directory listing
Fill in the SMB/CIFS mount form
Open the profile menu and choose Settings. Under Administration, select External Storage, then choose SMB/CIFS from Add storage. Admin mount form
In Authentication, choose Username and password for this example. That method sends the credentials entered for the mount to the storage backend. Authentication selector · Password-based authentication
An unrestricted admin mount is available to all users by default. Nextcloud saves the mount once all required fields are filled. Mount scope and automatic saving
Set Available for to the users or groups who need the mount. This example uses the Nextcloud group Team.
| Field | Example | What to enter |
|---|---|---|
| Folder name | Team Files | The label users will see in Files. Use a name without slashes. Folder name |
| Host | files.example.test | The SMB server address. SMB/CIFS fields |
| Share | team | The name of the existing share on that server. SMB/CIFS fields |
| Remote Subfolder | projects | A folder inside the share. Leave the field blank to mount the share root. Remote Subfolder |
| Domain | Blank in this example | Use this optional field if the server requires a domain and the chosen authentication method supplies a username you cannot edit. SMB domain |
| Username | SMB_USER | The SMB account name. Use DOMAIN\SMB_USER if the server requires a domain-qualified username and you enter the username directly. SMB username |
| Password | The SMB account password | Enter the password for that SMB account. SMB password |
Match Case sensitive file system to the filesystem behind the share. This SMB option controls how Nextcloud looks up file names and validates paths. SMB case sensitivity
Choose how users authenticate
| Authentication method | When to use it |
|---|---|
| Username and password | Use one SMB account for the mount, as in the example above. Mount credentials |
| User entered, store in database | Let each user enter their own SMB credentials before their first access to the mount. User-entered credentials |
| Log-in credentials, save in session | Use this when the user’s Nextcloud login credentials also work on SMB. This mode disables sharing and background file scanning. Desktop and mobile clients that authenticate with tokens cannot access the mount, and the mode is unavailable with SAML/SSO. Session credentials and limits |
For a photo archive on the Nextcloud server itself, see the Nextcloud and Immich pairing guide.
Verify access in Files
- Look for a green dot beside the mount in Administration → External Storage. Green means the mount is ready for use. Admin connection status
- Sign in as a member of
Team, open Team Files in Files, and download a file. If users need write access, upload a file to the writable mount. External storage in Files - If you sign in with an account outside the selected scope, Team Files should be absent. User and group permissions
Verify the connection with OCC
For the Username and password example on a manual Debian or Ubuntu install, start in the Nextcloud directory. Find the row for Team Files in the first command’s output and replace MOUNT_ID in the second command with the ID from that row. OCC runtime · List and verify mounts
sudo -E -u www-data php occ files_external:list
sudo -E -u www-data php occ files_external:verify MOUNT_ID
For AIO, run the same subcommands through the container. Replace MOUNT_ID with the ID returned by the first command. AIO OCC wrapper · List and verify mounts
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files_external:list
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files_external:verify MOUNT_ID
The verify command reports whether Nextcloud can connect using the mount configuration. Use the signed-in Files check to confirm access for the intended user. OCC mount verification · External storage in Files
For help identifying your installation type, see Nextcloud AIO vs Docker Compose vs Snap.
Fix an unavailable or missing mount
| What you see | What to check |
|---|---|
| Red or yellow icon in the admin mount row | Recheck the SMB/CIFS configuration fields and network availability. Click the colored icon to retry. SMB/CIFS fields · Retry an external mount |
| Green in admin settings, missing from a user’s Files | If the mount is restricted, check that Available for includes the user directly or through a group. User and group permissions · External storage in Files |
Evidence and limits. The Nextcloud 35 administration and user manuals, Samba client manual and Nextcloud All-in-One README were checked on November 27, 2026. No hands-on testing was performed for this guide. The procedure covers adding an existing SMB share as secondary storage.