Skip to main content
Version: 3.6.2-rc.2

Connect an SMB file share

Use an SMB source to sync files from a Windows or Samba file share. The endpoint connects to the file server directly, so the server can sit on a private network as long as the platform can reach it. For the steps around the fields on this page, see Add a data source.

An SMB source also records who can read each file on the file server. You can use that to enforce file permissions, so each user only finds the files they could open on the share.

Before you begin​

  • An account on the file server that can list the share, read its files and read their permissions.
  • The platform can resolve the server's address and reach its SMB port, 445 by default.
  • The file server supports SMB signing. The endpoint always requires it.

Choose the server address​

Enter an address the endpoint can reach from inside the cluster:

Where the file server isExample Server
A Kubernetes service in the same namespacesamba
A Kubernetes service in another namespacesamba.storage.svc.cluster.local
The host of a Docker Desktop clusterhost.docker.internal
A private network or VPNfileserver.corp.local or 10.20.30.40
The internetfileserver.example.com

Note: In Kubernetes, localhost refers to the RAG pod itself. Use another address unless the SMB server runs in that pod.

Fill in the fields​

On the Add data source page, choose SMB as the Provider, then fill in:

FieldWhat to enterExample
ServerThe host name or IP address only, without smb://, the share or the port.fileserver.example.com
ShareThe share name. For \\fileserver\documents, enter documents.documents
PortThe port the file server listens on. Keep 445 unless yours differs.445
Require SMB encryptionSelect it to encrypt the connection. Only select it if the file server supports SMB encryption.
Enforce source permissionsSelect it to limit each user to the files they can read on the file server. See Enforce SMB file permissions.
Prefix (optional)A folder inside the share, with no slash at the start or end. Leave blank to sync the whole share.docs/2026
UsernameThe account that reads the share. Enter the name only, without the domain: CORP\rag-reader is rejected.rag-reader
PasswordThe password for that account.
Domain (optional)The Windows or Active Directory domain of the account. Leave blank for an account local to the file server.CORP

The port must be a whole number from 1 to 65535. After the source is created, its details show SMB encryption as Required or Not required.

Then choose a sync interval and create the source.

Reuse the account of another source​

If the endpoint already has an SMB source with the same account, you can copy its credentials instead of typing them again. The Credentials list appears above Username when at least one source qualifies. Choose Copy from that source, and the account fields disappear.

A source qualifies when all of these are true:

  • It is an active SMB source on this endpoint, with its credentials stored.
  • It has the same Server and Port as the new source. The share and prefix may differ.
  • It has the same Active Directory URL and Active Directory CA certificate. For a new source without enforcement, both are empty, so the donor must have none stored either.
  • It enforces source permissions, if the new source does.

If you change one of these fields after choosing a source, the list goes back to Enter new credentials.

When you copy credentials, the connection isn't tested, so you won't see Connection succeeded. Select Create once the other fields are filled in. Each source keeps its own copy, so changing the credentials of one source later doesn't change the other.

How the share is synced​

A change to a file's permissions counts as a change to the file. The next sync indexes it again, even when the content, the size and the modification time stay the same. The endpoint detects permission changes from the file's change time, which the file server updates when the permissions change.

Only new and changed files are opened to read their permissions. Files that failed are checked again on every sync.

Troubleshooting​

  • The connection test fails: check that the platform can reach the server and port, and that the account, password and domain are right.
  • No objects were read: check the share name, the prefix and the account's read permissions.
  • Files fail with unsupported_acl: the file's permissions can't be turned into a list of readers. See When a file can't be indexed.