Samba File Server Configuration (SMB/CIFS)

ownCloud can connect to Windows file servers, and other SMB-compatible servers (e.g., Samba), by using the SMB/CIFS backend.

ownCloud requires at least Samba version 4.7.8 or Samba 4.8.1 on the ownCloud server, when:

  1. The Windows Network Drive Listener is used; and

  2. The remote Windows/Samba file server requires at least version 2.0 of the SMB protocol.

The Windows Network Drive Listener only supports version 1 of the SMB protocol with earlier Samba versions.

Here’s Why

A Samba server, often a Microsoft Windows Server, can enforce the minimum and maximum protocol versions used by connecting clients. However, in light of the WannaCry ransomware attack, Microsoft patched Windows Server to only allow SMB2 protocol by default (as SMB1 is insecure).

The ownCloud windows network drive listener utilizes the SMB notification feature which works well with SMB1 in conjunction with most Samba versions. However, when the minimum protocol a server accepts is SMB2, ownCloud require Samba 4.7.8+ (4.8+ etc.) to be able to properly work, as prior versions of Samba had a bug that break this feature.


There are two dependencies to connect to your ownCloud installation to Windows file servers,

libsmbclient-php or smbclient

ownCloud’s SMB/CIFS backend requires either the libsmbclient-php module (version 0.8.0+) or the smbclient command (and its dependencies) to be installed on the ownCloud server. We highly recommend libsmbclient-php, but it isn’t required. If it is installed smbclient won’t be needed. Most Linux distributions provide libsmbclient-php and typically name it php-smbclient.

The Samba Client

The Samba client must be installed on your Linux system. It is included in all Linux distributions; on Debian, Ubuntu, and other Debian derivatives this is smbclient. On SUSE, Red Hat, CentOS, and other Red Hat derivatives it is samba-client. You also need which and stdbuf, which should be included in most Linux distributions.


When configuring it, you will need the following information:

  • The folder name, which will be your local mount point.

  • The URL of the Samba server.

  • The username or domain/username used to login to the Samba server.

  • The password to login to the Samba server.

  • The share name to mount on the remote Samba server.

  • The remote subfolder inside the remote Samba share to mount. This is optional, as it defaults to /.

    To assign the ownCloud logon username automatically to the subfolder, use $user instead of a subfolder name.
  • The ownCloud users and groups who get access to the share.

Optionally, you can specify a Domain. This is useful in cases where the SMB server requires a domain and a username, and an advanced authentication mechanism like Active Directory (AD), or when using session credentials where the username cannot be modified. This is concatenated with the username, so the backend gets domain\username

Samba external storage configuration.

Further Information