Skip to content

SMB shares: files from your own file server

Applications on your server can read files from a file share on your own network: the data folder of an accounting package, a folder of exports, scanned documents. The share stays where it is, on your file server. Your server mounts it into the containers of a stack, and the application reads the files there as ordinary files.

You find this under SMB shares in the portal menu.

  • Your server reaches the file server over a private connection: ZeroTier or a VPN. SMB never goes over the internet: an address that is not private is refused. HD Services sets up the connection with you.
  • You add the share with an account that may read it. Preferably make an account for this purpose that only has read rights on that share.
  • You mount the share into a service of a stack, at a folder inside the container, for example /mnt/accountview. The stack’s next deploy mounts it.
  • A share is mounted read-only. Writing is only possible when the share allows it (Allow writing) and the mount asks for it.
  • The password is stored on your server only. It is never shown again: not on the page, not through the API, the command-line tool or an assistant.
  1. Click Add a share.
  2. Id: a short name, such as accountview. Stacks refer to the share by it; it cannot be changed afterwards.
  3. Server: the address of the file server on the private network, for example its ZeroTier address 10.211.167.2. You can also paste the whole path, such as \\10.211.167.2\AccountView\admins: the portal splits it into server, share and folder.
  4. Share and Folder: for \\PDC\AccountView\admins the share is AccountView and the folder admins. With a folder, only that folder is mounted.
  5. User name and Password: write DOMAIN\user for a domain account. Leave both empty for guest access. A comma cannot be used in these fields.
  6. Under More settings: the SMB version (automatic is fine for nearly every server), encryption (ZeroTier and most VPNs encrypt already) and Allow writing.

Then click Test: the server mounts the share for a moment, read-only, and lists it. The state then reads Works, or Failed with the reason: the file server does not answer, the account is wrong, or the share does not exist.

Browse shows the folders and files of the share, so you can check that you have the right folder before an application uses it.

Under Mounted in stacks, click Mount a share and choose:

  • the share;
  • the stack and the service (the part of the stack that reads the files, for example app);
  • the path in the container, for example /mnt/accountview. System folders such as /etc or /usr are not allowed, nor a path the stack already uses for something else.

Then deploy the stack. The deploy shows a line such as SMB share accountview (\\10.211.167.2\AccountView) on service app at /mnt/accountview, read-only.

You do not need to change the compose file for this: your server adds the share at deploy time. A share defined in the compose file itself (driver_opts) is refused by the compose rules.

  • An application that is running keeps working once the share is back: the connection is restored by itself. While the share is away, reading a file gives an error.
  • A container that starts while the share cannot be reached (for example right after a restart of your server, before the ZeroTier connection is up) waits. Your server starts it as soon as the share answers again.
  • A share that a stack mounts and that does not answer for three checks in a row gives the alert File share not reachable, to HD Services and to your own alert channels. It is resolved by itself when the share answers again.
  • A changed share (another password, server or setting) reaches the stacks that mount it at their next deploy. The page says which stacks.
  • A share that a stack still mounts cannot be removed: remove the mount first.
  • Removing a share or a mount never touches the files on the file server.
Task Who
The private connection (ZeroTier, VPN) between your network and the server HD Services, with you
The account on your file server you (or your IT supplier)
Adding shares, testing, mounting into stacks you (or HD Services)
The application that reads the files your developer

The share is a folder in the container, read-only by default. Read it as files; do not lock files you only read. The API has GET /smb, PUT /smb/shares/{id}, POST /smb/shares/{id}/test, GET /smb/shares/{id}/files and PUT /stacks/{name}/smb (REST API); the command-line tool has hddeploy smb (CLI). An assistant can list, test and browse shares and mount them into a stack (MCP server), but never add a share: that needs the password, which does not belong in a conversation.