# Cannot mount SFTP volume with Docker Compose

**URL:** <https://forum.rclone.org/t/cannot-mount-sftp-volume-with-docker-compose/53016>\
**Category:** Help and Support\
**Created:** [November 20, 2025, 8:55pm UTC](https://forum.rclone.org/t/cannot-mount-sftp-volume-with-docker-compose/53016 "2025-11-20T20:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ratibus11](https://forum.rclone.org/user_avatar/forum.rclone.org/ratibus11/32/20751_2.png) [@Ratibus11](https://forum.rclone.org/u/Ratibus11)\
**Post date:** [November 20, 2025, 8:55pm UTC](https://forum.rclone.org/t/cannot-mount-sftp-volume-with-docker-compose/53016/1 "2025-11-20T20:55:15Z")

</div>

## What is the problem you are having with rclone?

I'm using a RS422+ Synology NAS to store persistent data from my Docker Swarm nodes. I store the connection data (host, username, pass, ...) in a `.env` file I inject during the deployment with Docker Compose.

It works perfectly with Samba but I need SFTP volume for some of my services. So I'm trying to mount this kind of volume with rclone.

An example of my Docker Compose volume section.

```yaml
volumes:
  my_awesome_volume:
    driver: rclone
    driver_opts:
      type: sftp
      path: "/path/to/my/node/folder"
      sftp_host: "${HOST}"
      sftp_port: "${SSH_PORT}"
      sftp_user: "${SERVICE_ACCOUNT_USERNAME}"
      sftp_pass: "${SERVICE_ACCOUNT_PASSWORD}"

```

Also tried with variants like:

- `sftp-xxx` instead of `sftp_xxx`,
- `xxx` instead of `sftp_xxx`,
- Unquoted variables,
- Combining `path` and `type` into `remote` as mentionned in the [docker plugin "Connection string" documentation section](https://rclone.org/docker/#connection-strings).

But after all my attemps, my service is stuck into the preparation state _and so cannot start_ because it's not able to mount the volume.

Also, please consider:

- I base64 encoded my NAS account password in the `.env` file as mentionned in [password obscuration](https://rclone.org/commands/rclone_obscure/) _(even if I also tried first without any kind of transformation)_,
- By using `docker service inspect my-awsesome-service`, I confirm my credentials are correctly injected during the deployment of the service,
- I also installed `fuse` with the following command: `apt-get -y install fuse3`,
- I can connect to the NAS through SFTP from the same node I'm trying to mount the volume on with password authentication,

## Run the command 'rclone version' and share the full output of the command.

Not using rclone executable, but the `rclone/docker-volume-rclone:arm-v6-1.71.2` Docker plugin.

## Which cloud storage system are you using? (eg Google Drive)

SFTP on a RS422+ Synology NAS server, using `DSM 7.3-81180` version.

## The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

_I don't know if I'm able to execute such command with the Docker plugin. If so, could you please tell my how?_

## Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

_I don't know if I'm able to execute such command with the Docker plugin. If so, could you please tell my how?_

## A log from the command that you were trying to run with the `-vv` flag

While executing my deploy command:

```bash
set -a; . my-service.env; set +a; docker stack deploy -c /path/to/my/compose/file.yml my_awesome_stack

```

```log
Nov 20 20:21:30 <swarm_node> dockerd[512]: time="2025-11-20T20:21:30.658833146Z" level=info msg="initialized VXLAN UDP port to 4789 " module=node node.id=dx1q2x5q9ttskoof9frt70kl6
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 DEBUG : /VolumeDriver.Get: Request returned error: volume not found" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 DEBUG : Create volume \"<volume_name>\"" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 DEBUG : Setup volume \"<volume_name>\" as \":sftp,host='<nas_ip_address>',pass='<nas_base64_encoded_password>',port='<nas_ssh_port>',user='<nas_username>':<nas_folder_path>\" at path /mnt/<volume_name>" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 DEBUG : Creating backend with remote \":sftp,host='<nas_ip_address>',pass='<nas_base64_encoded_password>',port='<nas_ssh_port>',user='<nas_username>':<nas_folder_path>\"" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 NOTICE: Config file \"/data/config/rclone.conf\" not found - using defaults" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:31 <swarm_node> dockerd[512]: time="2025-11-20T20:21:31Z" level=error msg="2025/11/20 20:21:31 DEBUG : :sftp: detected overridden config - adding \"{rfx88}\" suffix to name" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:40 <swarm_node> dockerd[512]: time="2025-11-20T20:21:40Z" level=error msg="2025/11/20 20:21:40 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:40 <swarm_node> dockerd[512]: time="2025-11-20T20:21:40Z" level=error msg="2025/11/20 20:21:40 DEBUG : pacer: Rate limited, increasing sleep to 200ms" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:49 <swarm_node> dockerd[512]: time="2025-11-20T20:21:49Z" level=error msg="2025/11/20 20:21:49 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:49 <swarm_node> dockerd[512]: time="2025-11-20T20:21:49Z" level=error msg="2025/11/20 20:21:49 DEBUG : pacer: Rate limited, increasing sleep to 400ms" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:59 <swarm_node> dockerd[512]: time="2025-11-20T20:21:59Z" level=error msg="2025/11/20 20:21:59 DEBUG : pacer: low level retry 3/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:21:59 <swarm_node> dockerd[512]: time="2025-11-20T20:21:59Z" level=error msg="2025/11/20 20:21:59 DEBUG : pacer: Rate limited, increasing sleep to 800ms" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:03 <swarm_node> dockerd[512]: time="2025-11-20T20:22:03Z" level=error msg="2025/11/20 20:22:03 DEBUG : pacer: low level retry 4/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:03 <swarm_node> dockerd[512]: time="2025-11-20T20:22:03Z" level=error msg="2025/11/20 20:22:03 DEBUG : pacer: Rate limited, increasing sleep to 1.6s" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:13 <swarm_node> dockerd[512]: time="2025-11-20T20:22:13Z" level=error msg="2025/11/20 20:22:13 DEBUG : pacer: low level retry 5/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:13 <swarm_node> dockerd[512]: time="2025-11-20T20:22:13Z" level=error msg="2025/11/20 20:22:13 DEBUG : pacer: Rate limited, increasing sleep to 2s" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:22 <swarm_node> dockerd[512]: time="2025-11-20T20:22:22Z" level=error msg="2025/11/20 20:22:22 DEBUG : pacer: low level retry 6/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:24 <swarm_node> dockerd[512]: time="2025-11-20T20:22:24.008768096Z" level=info msg="NetworkDB stats <swarm_node>(0cdcf916f728) - netID:0ca1ktyc1fswdgnc6cv0nu3n0 leaving:false netPeers:3 entries:20 Queue qLen:0 netMsg/s:0"
Nov 20 20:22:24 <swarm_node> dockerd[512]: time="2025-11-20T20:22:24.009130614Z" level=info msg="NetworkDB stats <swarm_node>(0cdcf916f728) - netID:b7eyrso22l1grlhsvq1kskdsk leaving:false netPeers:3 entries:3 Queue qLen:0 netMsg/s:0"
Nov 20 20:22:27 <swarm_node> dockerd[512]: time="2025-11-20T20:22:27Z" level=error msg="2025/11/20 20:22:27 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:36 <swarm_node> dockerd[512]: time="2025-11-20T20:22:36Z" level=error msg="2025/11/20 20:22:36 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:41 <swarm_node> dockerd[512]: time="2025-11-20T20:22:41Z" level=error msg="2025/11/20 20:22:41 DEBUG : pacer: low level retry 9/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:45 <swarm_node> dockerd[512]: time="2025-11-20T20:22:45Z" level=error msg="2025/11/20 20:22:45 DEBUG : pacer: low level retry 10/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain)" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150
Nov 20 20:22:45 <swarm_node> dockerd[512]: time="2025-11-20T20:22:45Z" level=error msg="2025/11/20 20:22:45 DEBUG : /VolumeDriver.Create: Request returned error: NewFs: couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain" plugin=332ccabf5700861309509295b7f4ac6369d2728fea4ee10c7db576c70618d150

```

The log above is an extract during the service preparation stop. It loops multiple times from `/VolumeDriver.Get: Request returned error: volume not found` to `/VolumeDriver.Create: Request returned error: NewFs: ...`

* * *

Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [November 21, 2025, 8:02am UTC](https://forum.rclone.org/t/cannot-mount-sftp-volume-with-docker-compose/53016/2 "2025-11-21T08:02:33Z")

</div>

> [@Ratibus11](#):
>
> I base64 encoded my NAS account password in the `.env` file as mentionned in [password obscuration](https://rclone.org/commands/rclone_obscure/) _(even if I also tried first without any kind of transformation)_,

You need to run

```
rclone obscure my password

```

And use the output of that

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [November 24, 2025, 6:44pm UTC](https://forum.rclone.org/t/cannot-mount-sftp-volume-with-docker-compose/53016/3 "2025-11-24T18:44:31Z")

</div>

Closed on November 24, 2025, 6:44pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
