How to sync Microsoft OneDrive on Linux

OneDrive (previously known as SkyDrive) is a popular cloud storage offering from Microsoft. Currently OneDrive offers 7GB free storage for every new signup. As you can imagine, OneDrive is well integrated with other Microsoft software products. Microsoft also offers a standalone OneDrive client which automatically backs up pictures and videos taken by a camera to OneDrive storage. But guess what. This client is available for all major PC/mobile platforms except Linux. "OneDrive on any device, any time"? Well, it is not there, yet.

Don't get disappointed. The open-source community already has already come up with a solution for you. onedrive-d written by a Boilermaker in Lafayette can get the job done. Running as a monitoring daemon, onedrive-d can automatic sync a local folder with OneDrive cloud storage.

In this tutorial, I will describe how to sync Microsoft OneDrive on Linux by using onedrive-d.

Install onedrive-d on Linux

While onedrive-d was originally developed for Ubuntu/Debian, it now supports CentOS/Fedora/RHEL as well.

Installation is as easy as typing the following.

$ git clone
$ cd onedrive-d
$ ./inst install

First-Time Configuration

After installation, you need to go through one-time configuration which involves granting onedrive-d read/write access to your OneDrive account.

First, create a local folder which will be used to sync against a remote OneDrive account.

$ mkdir ~/onedrive

Then run the following command to start the first-time configuration.

$ onedrive-d

It will pop up a onedrive-d's Settings window as shown below. In "Location" option, choose the local folder you created earlier. In "Authentication" option, you will see "You have not authenticated OneDrive-d yet" message. Now click on "Connect to" box.

It will pop up a new window asking you to sign in to

After logging in to, you will be asked to grant access to onedrive-d. Choose "Yes".

Coming back to the Settings window, you will see that the previous status has changed to "You have connected to". Click on "OK" to finish.

Sync a Local Folder with OneDrive

There are two ways to sync a local folder with your OneDrive storage by using onedrive-d.

One way is to sync with OneDrive manually from the command line. That is, whenever you want to sync a local folder against your OneDrive account, simply run:

$ onedrive-d

onedrive-d will then scan the content of both a local folder and a OneDrive account, and make the two in sync. This means either uploading newly added files in a local folder, or downloading newly found files from a remote OneDrive account. If you remove any file from a local folder, the corresponding file will automatically be deleted from a OneDrive account after sync. The same thing will happen in the reverse direction as well.

Once sync is completed, you can kill the foreground-running onedrive-d process by pressing Ctrl+C.

Another way is to run onedrive-d as an always-on daemon which launches automatically upon start. In that case, the background daemon will monitor both the local folder and OneDrive account, to keep them in sync. For that, simply add onedrive-d to the auto-start program list of your desktop.

When onedrive-d daemon is running in the background, you will see OneDrive icon in the desktop status bar as shown below. Whenever sync update is triggered, you will see a desktop notification.

A word of caution: According to the author, onedrive-d is still under active development. It is not meant for any kind of production environment. If you encounter any bug, feel free to file a bug report. Your contribution will be appreciated by the author.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

34 thoughts on “How to sync Microsoft OneDrive on Linux

  1. Really nice article. Currently using it. works like a charm. Was waiting for something like this since so long. Just loving it bro... If any error occurs I'll let u know... :)

  2. I notice that it is hard coded for MS OneDrive. How much trouble would it be to give a choice of cloud providers, such as Google Drive?

  3. Thanks for the heads up on this. Readers might be interested that the developer of the popular DropSync for Android devices recently released another app for OneDrive called OneSync. It's getting good ratings at the app store - makes OneDrive a real cross-platform contender.

  4. Now they need to make this for Windows 8.1 too. It seems like everybody except people using the latest version of Windows can access Skydrive / OneDrive. If you didn't know, you cannot access your Skydrive/Onedrive from Windows 8.1 if you are logging into your computer with a local account as opposed to a Microsoft account.

  5. Wonderful ! Syncronize all my [Sky|One]drive easily.
    an apt-get install git, git command and just after compilation, the configuration windows popup and a wizard wants that I input my OneDrive login.

  6. What about non apt-get and yum systems? What packages are needed? Why does it need a package manager?

  7. Followed the instructions and it works. Hate to have to use Microsoft ever, however I have workmates that use Microsoft Access, (I use SQLite myself with LibraOffice Base and Python to interface with the database ) and I have to be compatible with them. This allows me to also sync any documents I create in the Microsoft 365 with my beloved xubuntu 12.04.4, THANKS A MILLION

    • 1. From the souce directory, you should run the following command
      ./inst uninstall
      2. If you start onedrive-d service when the system boot, run the following commands.
      sudo update-rc.d -f onedrive-d remove
      sudo rm /etc/init.d/onedrive-d
      3. Remove the binary files
      sudo rm /usr/local/bin/onedrive-prefs
      sudo rm /usr/local/bin/onedrive-d
      sudo rm /usr/local/bin/onedrive-cli
      4. Remove the configuration file from your home directory.
      rm -rf ~/.onedrive

  8. Thank you. This seems to athenticate to or, where I need to athenticate at I made edits to the and files, but it continues to athenticate at I would like to know how I can point athentication to where my Microsoft account resides?

  9. I truly thank you for this. I like running linux but I really like my Windows Phone 8.1 as well. Now I have access to my photos from my phone fairly quickly and with a minimal amount of effort. This is ElementaryOS-Luna. Works flawless.
    Thanks once again.
    Toby Cass

  10. This is really fantastic. I need to be able to switch between Gnome and WIndows and still access the same documents, and I would prefer to use Asus storage, but they don't seem to have a way of running on Ubuntu yet, so OneDrive wins.

    So far, one problem: the auto-start works, but the expected "cloud" icon doesn't appear on the top bar. (If everything else works, then I'm happy, but would like to fix this if possible.)

  11. This works out of the box on Linux Mint (being ubuntu based) with a small change to add linuxmint to the debian|ubuntu (line 21) so it looks like this:

    case $DISTRIB_ID in

  12. Little problem with OneDrive.
    Every system reboot it will do a full sync, create new files and renames the files in my local folder, like this:
    test.txt (OLDER_1409990135.09)
    test.txt (OLDER_1409990135.09) (OLDER_1409990135.09)
    test.txt (OLDER_1409990135.09) (OLDER_1409990135.09) (OLDER_1409990135.09)

    Every reboot it will add a new file.
    Any idea what happens?
    System Linux Mint 17

    • Same issue I had on Linux Mint 17.

      If you don't mind one-way download sync only with Onedrive as master, you can get rid of the 'older/newer' stuff by commenting out some lines of source code in /onedrive-d-master/onedrive_d/;

      Comment out Lines 201-204, 207-208 by preceding each line with #. Then restart the daemon in terminal with /etc/init.d/onedrive-d restart (or just plain stop then start)

      I don't think it's ready for 2-way yet.

    • I am likewise not seeing an "inst" command in onedrive-d on Linux Mint., yes. inst no. Following the instructions on the github site, I ran " inst" which executes and looks like it worked, but then tells me I should run onedrive-pref to do the setup (no such file or command exists anywhere on my system after install... I searched in case it was off-path), and onedrive-d to start the daemon (the only onedrive-d that exists anywhere is a folder, not a command). What am I missing here? I would love to get this working.

      • Hey,

        just trying on Fedora 20 and have the same problem - cannot lauch either onedrive-d nor onedrive-pref. Did you manage to resolve the issue ?

    • I too was having the same issue but found this following solution on another web site

      Try running sh inst

  13. Thanks for the nice writeup. Installation worked well, although I ended up downloading the zip file with the installation components, changed into directory after extraction, and the rest was the same.
    Runs fine up to the initialization step in Ubuntu.

    My problem is the nature of the login. I have onedrive storage through an institutional account. On the website for onedrive login, it will recognize the email right away and redirects to an institutional authentication interface before I even try to enter a password.
    Is there any way to access an institutional account. At present, it will state that the account does not exist, because it was not established directly by me on onedrive.

    May not be possible, but I figure I just check.


  14. Is there any way to setup and configure strictly using the command line - my connection to the server is non GUI.


  15. Nice write-up and highly useful: I installed onenote under Ubuntu via wine. It runs, but does not sync with onedrive. So now, I can have onedrive-d sync and still use onenote.

    Slight issue: I have 2 notebooks. For one, it works perfectly. For the other, I get a message: "Another OneNote program created it but has not yet uploaded the content."

    The notebook that works is MBytes in size, the one that does not gets created but is only about 3KBytes.

    Any ideas as to why one works but not the other?

Leave a comment

Your email address will not be published. Required fields are marked *