How to Sync OneDrive on Linux using Rclone?

How to Sync OneDrive on Linux using Rclone?

On Linux, OneDrive cannot be downloaded and synchronized as seamlessly as it is in a Windows environment. Today, I will provide a step-by-step guide on how to install and sync OneDrive on your Linux PC.

1) Set up a new remote connection.

First, let’s open the terminal using the shortcut Ctrl + Alt + T

and type rclone config

kimjk@agron:~$ rclone config

Current remotes:
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> 

Once the output appears, type n for a ‘New remote’ connection.

Next, you’ll need to name your new remote. For this guide, I’ll use onedrive.

Find ‘Microsoft OneDrive’ in the list by scrolling down. Enter its associated number (which is 30 in this example) and press Enter.

Keep pressing Enter through the next prompts until the following message appears.

Now, choose your region. I will select 1 for the global Microsoft Cloud.

Continue selecting the default options by pressing Enter until you reach the next section. Then, log in to your OneDrive account to connect your cloud.

When the prompt above appears, select 1 for ‘OneDrive Personal or Business’.

At this prompt, select 5 for ‘OneDrive (personal)’. Then, continue pressing Enter to accept the default options. You will soon see a message confirming that OneDrive is connected as a remote.

2) Create local OneDrive folder in PC

The next step is to create a local OneDrive folder on your Linux PC where your files will be stored. First, let’s create a folder called ‘OneDrive’.

mkdir -p ~/OneDrive

3) Create a Systemd User Service for Rclone Mount

Please type the below code to the terminal.

cat <<EOF > ~/.config/systemd/user/rclone-onedrive.service
[Unit]
Description=Rclone OneDrive Mount
After=network-online.target

[Service]
Type=simple
ExecStart=$(which rclone) mount onedrive: %h/OneDrive --vfs-cache-mode writes
ExecStop=/bin/fusermount -u %h/OneDrive
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target
EOF

4) Enable and Start the Rclone Service

Please type the following code.

systemctl --user daemon-reload
systemctl --user enable rclone-onedrive.service
systemctl --user start rclone-onedrive.service

To avoid typing errors, I recommend copying and pasting this single-line command.

systemctl --user daemon-reload && systemctl --user enable rclone-onedrive.service && systemctl --user start rclone-onedrive.service

5) Verify the Mount Status

Run the command below to verify the connection.”

systemctl --user status rclone-onedrive.service

If you see ‘active (running)’ in the message below, your local OneDrive folders have successfully synced with the Cloud.


We aim to develop open-source code for agronomy ([email protected])

© 2022 – 2025 https://agronomy4future.com – All Rights Reserved.

Last Updated: 03/05/2026

Comments are closed.