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.


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