rclone mount presents an S3-compatible bucket as a directory on a Linux host, which is exactly what you want when an application only knows how to write files and you would rather not teach it an object storage SDK. Run it by hand and it works until the first network blip, the first reboot, or the first user who is not you tries to read the path. This guide configures a generic S3 remote, walks through the four VFS cache modes and which one your workload actually needs, and then wraps the mount in a systemd unit with Type=notify, a real ExecStop, a non-root user, and bounded cache growth — the parts that separate a demo from something you can leave running. It also spells out where the abstraction leaks, because it leaks in ways that will corrupt data if you ignore them.
What you’ll accomplish
- Install rclone and create an S3-compatible remote with
rclone config, verified by listing the bucket. - Choose a
--vfs-cache-modedeliberately from your workload’s write pattern instead of copying a flag off a forum post. - Bound the on-disk cache with
--vfs-cache-max-sizeand--vfs-cache-max-ageso it cannot fill the root filesystem. - Ship a
systemdunit that starts as a non-root user, reports readiness only once the mountpoint is live, and unmounts cleanly on stop. - Know the consistency and performance limits well enough to say no when someone proposes putting a database on it.
Prerequisites
- A Linux host with systemd 235 or newer and root access via
sudo. Examples use Debian/Ubuntu package names; on RHEL-family hosts substitutednfand thefuse3package. - FUSE must actually be available. This is the prerequisite people skip. You need the
fuse3userspace tools and a kernel that exposes/dev/fuse. Most cloud VMs and bare metal are fine. Containers are not, unless the container runs with--device /dev/fuseand--cap-add SYS_ADMIN(or--privileged), which many platforms forbid. Some hardened kernels and managed PaaS environments disable unprivileged FUSE entirely. Check before you plan around it. - An S3-compatible endpoint and a credential pair with read/write on one bucket. Anything speaking the S3 API works — MinIO, Backblaze B2’s S3 endpoint, Ceph RGW, Wasabi, AWS S3 itself. If you are standing up the backend too, deploying MinIO object storage covers that side.
- A dedicated unprivileged system user for the mount. Do not run this as root; a FUSE process running as root that exposes a writable network filesystem to every local account is a bad trade.
- Free disk space on whatever partition holds the cache directory. Plan for at least the size of the largest file any writer will produce, and considerably more if you land on
full.
How it works
There is no kernel driver here. rclone mount registers a FUSE mountpoint and then is the filesystem: a single userspace process that receives every open, read, write, stat and readdir the kernel forwards to it, and translates them into S3 requests.
The mismatch that shapes everything: object storage has no partial writes and no seeks. You PUT a whole object or you don’t. A POSIX application, meanwhile, expects to open a file, seek to byte 4096, write eight bytes, and close it. Bridging those two models is what the VFS layer inside rclone does, and how much bridging it does is exactly what --vfs-cache-mode selects.
Two caches sit in that layer. The directory cache holds listings and metadata in memory for --dir-cache-time (default 5m0s), which is why a file another host wrote can be invisible to your mount for several minutes. The file cache is a directory on local disk under --cache-dir (default $HOME/.cache/rclone) holding whole or partial file bodies. Above them, the kernel keeps its own short attribute cache, governed by --attr-timeout (default 1s).
Writes with a cache mode of writes or full land in the local cache directory first. The file is uploaded after the application closes it, delayed by --vfs-write-back (default 5s). That delay is a real window: close() returning success means the bytes are on local disk, not that they are in the bucket. Reads with full are stored on disk in chunks so a second read of the same range is local; with off, minimal, or writes, every read is an HTTP range request, buffered ahead by --buffer-size (default 16Mi) per open file.
The remaining flags are about pressure and concurrency. --transfers (default 4) caps parallel uploads. --vfs-cache-max-size and --vfs-cache-max-age (default 1h0m0s) let the cache cleaner evict; without a size bound the cache grows until the disk is full, and a full cache disk wedges the mount for every writer on the host.
Step-by-step
1. Install rclone from upstream, not the distribution repository. Distribution packages lag badly, and several VFS flags used below did not exist in older releases.
sudo -v ; curl https://rclone.org/install.sh | sudo bash
rclone version
rclone v1.71.0
- os/version: debian 12.11 (64 bit)
- os/kernel: 6.1.0-40-amd64 (x86_64)
- go/version: go1.24.6
If you would rather not pipe a script to a shell, download the release zip from rclone.org and copy the binary to /usr/local/bin yourself. Confirm the FUSE tooling is present too:
sudo apt-get install -y fuse3
test -e /dev/fuse && echo "fuse device present"
fuse device present
2. Create the service user and its directories. The mount process, the config file, the cache and the mountpoint all belong to this user.
sudo useradd --system --create-home --home-dir /var/lib/rclone --shell /usr/sbin/nologin rclone
sudo -u rclone mkdir -p /var/lib/rclone/.config/rclone /var/lib/rclone/cache
sudo mkdir -p /srv/objectstore
sudo chown rclone:rclone /srv/objectstore
No output means success. /srv/objectstore is the mountpoint; keep it empty and owned by the service user.
3. Configure the S3 remote. Run the interactive configurator as the service user so the credentials land in the right home directory.
sudo -u rclone HOME=/var/lib/rclone rclone config
Choose n for a new remote, name it objstore, pick the s3 backend, then select your provider (Minio, AWS, Other for a generic endpoint). Supply the access key, secret key, region, and — for anything other than AWS — the endpoint URL. When it finishes, the config file exists:
sudo -u rclone cat /var/lib/rclone/.config/rclone/rclone.conf
[objstore]
type = s3
provider = Minio
access_key_id = AKIAIOSFODNN7EXAMPLE
secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
endpoint = https://s3.example.com
region = us-east-1
Lock it down — it holds a secret key in cleartext:
sudo chmod 600 /var/lib/rclone/.config/rclone/rclone.conf
4. Verify the remote before you ever mount it. A mount that fails because of a bad credential is much harder to read than a failed lsd.
sudo -u rclone HOME=/var/lib/rclone rclone lsd objstore:
-1 2026-08-05 09:14:22 -1 app-data
-1 2026-07-19 11:02:47 -1 backups
5. Pick a VFS cache mode deliberately. This single flag decides whether the mount is usable for your workload. The four modes trade correctness for cost in a strict order.
off— no file cache. Reads stream; writes must be sequential and are uploaded as they arrive. Any application that seeks while writing, appends, or reopens a file for modification gets an I/O error. Suitable for streaming reads only.minimal— files opened read-only stream as withoff; files opened for write are cached on disk. Fixes the most common write failures at a small cost.writes— all writes go through the disk cache and upload on close. This is the correct default for general use, and the one to pick if you are unsure.full— reads are cached on disk as well, in chunks. Choose this when the same objects are read repeatedly, and only if you have the disk for it.
For a general-purpose mount, writes is the answer. The rest of this guide uses it.
6. Test the mount in the foreground. Never debug a mount for the first time through systemd.
sudo -u rclone HOME=/var/lib/rclone rclone mount objstore:app-data /srv/objectstore \
--vfs-cache-mode writes \
--cache-dir /var/lib/rclone/cache \
--vfs-cache-max-size 5G \
--vfs-cache-max-age 24h \
--dir-cache-time 5m \
--transfers 4 \
--log-level INFO
INFO : Starting transaction limiter: max 4 transactions/s with burst 1
INFO : S3 bucket app-data: poll-interval is not supported by this remote
INFO : S3 bucket app-data: Mounting on "/srv/objectstore"
From a second shell, confirm it reads and writes, then stop it with Ctrl-C in the first shell.
ls -l /srv/objectstore
echo hello | sudo -u rclone tee /srv/objectstore/probe.txt
hello
7. Write the systemd unit. Create /etc/systemd/system/rclone-objectstore.service:
[Unit]
Description=rclone VFS mount for objstore:app-data
Documentation=https://rclone.org/commands/rclone_mount/
After=network-online.target
Wants=network-online.target
AssertPathIsDirectory=/srv/objectstore
[Service]
Type=notify
User=rclone
Group=rclone
Environment=HOME=/var/lib/rclone
ExecStart=/usr/local/bin/rclone mount objstore:app-data /srv/objectstore \
--config /var/lib/rclone/.config/rclone/rclone.conf \
--vfs-cache-mode writes \
--cache-dir /var/lib/rclone/cache \
--vfs-cache-max-size 5G \
--vfs-cache-max-age 24h \
--dir-cache-time 5m \
--transfers 4 \
--umask 022 \
--log-level INFO
ExecStop=/bin/fusermount3 -u /srv/objectstore
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Type=notify matters: rclone signals readiness to systemd only once the mountpoint is actually live, so units ordered After= this one do not start against an empty directory. ExecStop with fusermount3 -u is what makes a stop leave a clean mountpoint instead of a stale one. Note the explicit --config path — a service started by systemd does not inherit your shell’s environment, and this is the single most common cause of a unit that dies immediately with “didn’t find section in config file”.
8. Enable and start it.
sudo systemctl daemon-reload
sudo systemctl enable --now rclone-objectstore.service
sudo systemctl status rclone-objectstore.service --no-pager
● rclone-objectstore.service - rclone VFS mount for objstore:app-data
Loaded: loaded (/etc/systemd/system/rclone-objectstore.service; enabled)
Active: active (running) since Wed 2026-08-05 09:31:07 UTC; 4s ago
Main PID: 18244 (rclone)
Tasks: 11 (limit: 9451)
Memory: 28.4M
9. Let other users reach the mount, if they need to. By default a FUSE mount is visible only to the user that created it — your web server running as www-data will get “Permission denied” on a path root can list. Fixing this needs two changes. First, permit it globally in /etc/fuse.conf:
echo "user_allow_other" | sudo tee -a /etc/fuse.conf
user_allow_other
Then add --allow-other to the ExecStart line, and set --uid/--gid to the account that should own the files if it is not rclone. Reload and restart:
sudo systemctl daemon-reload && sudo systemctl restart rclone-objectstore.service
Skip this step entirely if only the service user reads the mount. --allow-other exposes the bucket to every local account, so grant it only when something actually needs it.
Validate it works
Confirm the kernel sees a FUSE mount at the expected path:
findmnt --target /srv/objectstore
TARGET SOURCE FSTYPE OPTIONS
/srv/objectstore objstore:app-data fuse.rclone rw,nosuid,nodev,relatime,user_id=997,group_id=997
Write through the mount, then confirm the object exists on the remote side — this is the end-to-end check that proves the upload path, not just the local cache:
sudo -u rclone dd if=/dev/urandom of=/srv/objectstore/verify.bin bs=1M count=8 status=none
sleep 10
sudo -u rclone HOME=/var/lib/rclone rclone ls objstore:app-data --include verify.bin
8388608 verify.bin
The sleep is deliberate — it covers the --vfs-write-back delay. Now confirm the unit survives a restart cycle and unmounts cleanly:
sudo systemctl restart rclone-objectstore.service
systemctl is-active rclone-objectstore.service
active
Finally check the cache is being bounded rather than growing without limit:
du -sh /var/lib/rclone/cache
41M /var/lib/rclone/cache
Troubleshooting
“Transport endpoint is not connected”. The rclone process died while the kernel still holds the FUSE mount. Every ls on the path now returns this error, and a plain restart fails because the mountpoint is occupied. Clear it, then start:
sudo fusermount3 -u /srv/objectstore || sudo umount -l /srv/objectstore
sudo systemctl start rclone-objectstore.service
Then find out why it died — journalctl -u rclone-objectstore.service -n 50 almost always shows an authentication failure, an endpoint that stopped resolving, or an out-of-memory kill.
Permission denied for other users. Root can list the mount; www-data cannot. This is the --allow-other case in step 9. Both halves are required: user_allow_other in /etc/fuse.conf and --allow-other in ExecStart. Adding only the flag makes the mount fail to start with “option allow_other only allowed if ‘user_allow_other’ is set in /etc/fuse.conf”.
The unit starts, then exits immediately with a config error. The service user’s HOME is not what you assume under systemd, so rclone looks for rclone.conf somewhere it does not exist. Pass --config with an absolute path, as the unit above does, rather than relying on Environment=HOME.
The cache filled the disk. --vfs-cache-max-size is a target the cleaner works toward, not a hard ceiling — a single file larger than the limit is still cached in full, and heavy concurrent writes can overshoot it. Put the cache on its own filesystem when the workload is write-heavy, and monitor it. If the disk is already full, stop the unit and clear the cache directory before restarting.
Files another host wrote are missing. This is --dir-cache-time doing what you told it to. The mount will show them when the listing expires. Lower it if you need fresher listings, at the cost of more LIST requests, or force a refresh:
sudo -u rclone HOME=/var/lib/rclone rclone rc vfs/refresh recursive=true
That requires --rc on the ExecStart line. Do not lower --dir-cache-time to seconds on a large bucket; the listing cost will dominate.
When this is the wrong approach
A FUSE mount over object storage is not a POSIX filesystem wearing a different hat, and the gaps matter:
- Databases, ever. No
fsyncguarantees you can rely on, no byte-range locking, and a write-back window. SQLite, MySQL, PostgreSQL and anything else with a write-ahead log will corrupt data here. Give the database a block device. - Anything needing file locking between hosts. There is none. Two mounts writing the same object produce a last-writer-wins result with no error on either side.
- High-IOPS or small-file workloads. Every metadata operation is an HTTP request. A
findover a deep tree that takes a second on ext4 can take minutes here. - Rename-heavy workloads. S3 has no rename. Each one is a server-side copy plus a delete, priced and timed accordingly.
If the application can speak S3 directly, have it do that — the SDK path is faster and its failure modes are explicit. If you only need periodic movement of files rather than live access, rclone sync on a timer is simpler and safer than a mount; restic with the rclone backend covers the backup-shaped version of that. Reach for rclone mount when an application genuinely cannot be changed and its access pattern is read-mostly or write-once.
If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.