Set up Sync as an automatically mounted drive on Linux

This guide configures Sync WebDAV and Rclone so your Sync files appear in a local folder and mount automatically when Linux starts. You can use the automated setup script or complete the same setup manually. The automated setup is recommended for most users.

Before you begin:

  • The automated installer supports Ubuntu, Debian, Linux Mint, Zorin OS, Fedora, and Arch Linux. 
  • If you prefer to set it up manually, the steps outlined further below (Option 2) should also work on other systemd-based Linux distributions, but package names and commands may differ. 
  • In general You'll need a Linux computer that uses systemd and a Linux account with `sudo` access.

This setup:

  • Makes your Sync Folder available at `~/sync-drive`
  • Runs Sync WebDAV and Rclone automatically, including before login
  • Keeps WebDAV available only to applications on the local computer

Option 1: Use the automated installer

Download the Sync WebDAV Linux setup script, then open Terminal and change to the folder where you saved it. For example:

cd ~/Downloads
chmod +x sync-webdav-setup
./sync-webdav-setup

The installer checks the computer, installs any missing requirements, signs in to Sync, configures Rclone, creates the startup services, and verifies the mounted drive. It only displays preflight warnings or problems that require attention.

Follow the prompts. If the computer does not have a graphical browser, the installer displays a sign-in URL. Open the URL in a browser, complete sign-in, and paste the resulting authorization code into Terminal. 

Note: Save the generated WebDAV password shown when setup finishes. It is separate from your Sync account password.

The default setup mounts your Sync Folder at ~/sync-drive.
 

Installer options: 

To mount Vault instead of the Sync Folder:

./sync-webdav-setup --content vault

To choose a different local mount folder, provide an absolute path:

./sync-webdav-setup --mount-point /home/your-name/my-sync-drive

To preview the setup without making changes:

./sync-webdav-setup --dry-run

To remove the two automatic-startup services:

./sync-webdav-setup uninstall

Note: Removing the two automatic-startup services does not remove Sync WebDAV, its saved profile, the Rclone configuration, the local mount folder, or files stored in Sync.

The installer can be run again safely. It reuses a working existing profile and Rclone configuration when possible.


Option 2: Configure everything manually

Use all commands in this section from the same Linux account. Do not use a root shell or run the entire setup with `sudo`. 

Note: the instructions below mimic what the automated installer sets up.

1. Install the required packages

For Ubuntu, Debian, Linux Mint, or Zorin OS:

sudo apt-get update
sudo apt-get install -y curl rclone fuse3 util-linux kmod

For Fedora:

sudo dnf install -y curl rclone fuse3 util-linux kmod

For Arch Linux:

sudo pacman -Syu --needed curl rclone fuse3 util-linux kmod

Confirm that FUSE is available:

test -r /dev/fuse && test -w /dev/fuse && echo "FUSE is ready"

If the command does not display `FUSE is ready`, try loading the FUSE kernel module and then run the check again:

sudo modprobe fuse

2. Install Sync WebDAV

Run the official Sync WebDAV installer:

curl -LsSf https://www10.sync.com/download/webdav/install.sh | sh

Make the command available in the current Terminal window:

export PATH="$HOME/.sync-webdav/bin:$PATH"

3. Sign in to Sync

Run:

sync-webdav login

Complete sign-in in your browser. On a remote or headless computer, use: sync-webdav login --headless

Important:

  • After sign-in, Sync WebDAV displays a separate WebDAV username and password.
  • The username is `sync`. 
  • Save the generated password now; it is not your Sync account password and cannot be displayed again.

4. Create the Sync WebDAV startup service

Stop any copy of Sync WebDAV that you started manually:

pkill -TERM -u "$USER" -x sync-webdav 2>/dev/null || true

Create the user service:

mkdir -p ~/.config/systemd/user

cat > ~/.config/systemd/user/sync-webdav.service <<'EOF'
[Unit]
Description=Sync WebDAV Server

[Service]
Type=forking
WorkingDirectory=%h
ExecStart=%h/.sync-webdav/bin/sync-webdav --daemon --allow-from none
Restart=on-failure
RestartSec=15

[Install]
WantedBy=default.target
EOF

This exposes your Sync Folder. To expose Vault instead, add `--mount vault/` to the end of the `ExecStart` line before continuing. One service can expose either the Sync Folder or Vault, not both.

Allow your user services to run before login, then start Sync WebDAV:

sudo loginctl enable-linger "$USER"
systemctl --user daemon-reload
systemctl --user enable --now sync-webdav.service

Confirm that the local WebDAV server responds:

curl -I http://127.0.0.1:4918/

An HTTP response such as `401 Unauthorized` is expected and confirms that the server is running.

5. Configure Rclone

Use the generated WebDAV password you saved during sign-in. The following commands prompt for it without placing it in your shell history:

read -r -s -p "WebDAV password: " WEBDAV_PASSWORD
printf '\n'
rclone config create sync-webdav webdav \
 url=http://127.0.0.1:4918 \
 vendor=other \
 user=sync \
 pass="$WEBDAV_PASSWORD" \
 --obscure
unset WEBDAV_PASSWORD

Test the connection:

rclone lsd sync-webdav:/

If the command lists folders without an error, the connection is working.

6. Create the automatic Rclone mount

Create the mount folder and Rclone user service:

mkdir -p ~/sync-drive ~/.config/systemd/user

cat > ~/.config/systemd/user/sync-rclone.service <<'EOF'
[Unit]
Description=Sync.com Rclone mount
Requires=sync-webdav.service
After=sync-webdav.service
PartOf=sync-webdav.service

[Service]
Type=notify
WorkingDirectory=%h
ExecStartPre=/bin/sh -c 'until /usr/bin/curl -s -o /dev/null --connect-timeout 1 http://127.0.0.1:4918/; do sleep 1; done'
ExecStartPre=/usr/bin/rclone lsd sync-webdav:/ --config=%h/.config/rclone/rclone.conf --quiet --retries=1 --low-level-retries=1 --contimeout=10s --timeout=30s
ExecStart=/usr/bin/rclone mount sync-webdav:/ %h/sync-drive --config=%h/.config/rclone/rclone.conf --dir-cache-time=1m --vfs-cache-mode=writes
Restart=on-failure
RestartSec=15
TimeoutStartSec=120

[Install]
WantedBy=default.target
EOF

These commands assume `curl` and `rclone` are installed in `/usr/bin`. Confirm their locations with the following commands and adjust the service if needed:

command -v curl
command -v rclone
rclone config file

The Rclone configuration should normally be ~/.config/rclone/rclone.conf.

Enable and start the mount:

systemctl --user daemon-reload
systemctl --user enable --now sync-rclone.service

Confirm that Sync is mounted:

mountpoint ~/sync-drive

Your Sync files are now available in `~/sync-drive`.

7. Confirm automatic startup

Restart the computer. After it starts, run:

systemctl --user is-active sync-webdav.service sync-rclone.service
mountpoint ~/sync-drive

Both services should report `active`, and the mount-point command should report that `~/sync-drive` is mounted.

Manage or troubleshoot the setup

Check both services:

systemctl --user status sync-webdav.service sync-rclone.service --no-pager

Restart both services:

systemctl --user restart sync-webdav.service sync-rclone.service

View logs from the current boot:

journalctl --user -u sync-webdav.service -u sync-rclone.service -b -n 50 --no-pager

Stop the mounted drive and WebDAV server:

systemctl --user stop sync-rclone.service sync-webdav.service

Disable automatic startup:

systemctl --user disable --now sync-rclone.service sync-webdav.service

If port 4918 is already in use, identify the process before stopping anything:

ss -ltnp 'sport = :4918'

Do not run a manually started Sync WebDAV process at the same time as the systemd service.

Removing or disabling these services does not delete files from Sync. The local mount only works while Sync WebDAV and Rclone are running.

Was this article helpful?
0 out of 0 found this helpful