OneDrive is a cloud storage service made by Microsoft that lets you save any type of file in the cloud, so you can access them from anywhere. With OneDrive, you can sync movies, photos, and documents, and access them from any platform, no matter it’s Windows PCs or smartphones. OneDrive offers 5GBs for free and several paid plans to extend that storage space.
At the moment of this writing, Microsoft hasn’t announced a plan to officially support Linux. In case you wants to sync OneDrive files on a Linux machine, you would have to rely on an unofficial, community-maintained client. We has rounded up a list of the best OneDrive clients for Linux for you to choose. But if you simply wants to sync OneDrive, we recommend abaunegg’s OneDrive Client for Linux.
In this article, we will show you how to install OneDrive on Ubuntu. The guide is applicable to older versions of Ubuntu and many as well as Linux distros based on Ubuntu, such as Linux Mint or Pop! OS.
OneDrive Client for Linux features
- Supports OneDrive Personal, OneDrive for Business, OneDrive for Office365 and SharePoint.
- Fully supports Azure National Cloud Deployments (Microsoft Cloud for US Government, Microsoft Cloud Germany, Azure and Office 365 operated by 21Vianet in China).
- Powerful and highly configurable, yet simple to use.
- Runs on all major Linux distributions, including as Debian, Ubuntu, Mint, Manjaro, SuSE, OpenSuSE, Fedora, CentOS, Red Hat, Arch and Slackware.
- Can be installed either from the operating system repository, build from source or run inside a Docker container.
- Designed to ensure data integrity for your data – local state caching, file upload / download validation, resumable uploads.
- Dry run allows for “test sync” before actually running the operation with new settings applied. This is great to prevent major accidental data deletion after changing configuration.
Update the system
Before installing any new package or application, it is recommended that you update your system, GNOME Deksktop is no exception. To do this, run the commands below which invoke
apt package manager to fetch a fresh package list from Ubuntu repository.
sudo apt update
Install OneDrive Client for Linux
There are several ways that you can install OneDrive Client for Linux :
- From the official Ubuntu repositories using
apt. This is by far the easiest way but you would get old versions. Since this OneDrive client is unofficial, old version may become obsolete if there’s an API change from Microsoft.
From a community-maintained PPA which also(Update: The method is outdated)
aptcommand. This way, you would have an updated and tested build.
- Build from source using instructions made by the developer (requires deep knowledge about Linux).
- Run the client inside a Docker container. There are three different container type based on CentOS, Debian and Alpine Linux for you to choose. Instructions available here.
In this article, we will demonstrate installing OneDrive Client for Linux using the OpenSuSE Build Service repository on Ubuntu 20.04. For other versions of Ubuntu and Debian, consult abraunegg’s official instructions.
Run the following command to add the OpenSuSE Build Service repository to your system:
Code language: PHP (php)
echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list
Then, you need to add the public key of the OpenSuSE Build Service repository so that
apt can securely connect and fetch binaries from them. Run the following commands to do that:
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/Release.key | sudo apt-key add -
Once the process completes, you can install the OneDrive Client for Linux build from the newly-added PPA by running the following commands:
sudo apt-get update sudo apt install onedrive
Once complete installation, run the OneDrive application using the following command below:
You will see a message that asks you to authorize the application using your account. Copy the link shown in the terminal and paste it into a web browser.
After logging in to your Microsoft account, you should see a page asking you if you want to let this application access your information – click Accept or Yes.
After clicking Accept, you will be taken to another page, copy that page URL and paste it back to the terminal window and press Enter to complete the authorization process.
After authorization, you can perform a sync of your cloud OneDrive files to your local disk. Run the following command:
For advanced usage of OneDrive Client for Linux, such as one-way/two-way sync, dry run, file exclusion, etc., we recommend you checking out its own documentation.
We hope that the information above helped you successfully install OneDrive on your Ubuntu system. You may be interested in our other Linux software roundups, including 8 Best Open Source CMDB software, Best Linux Video Converters or Best Python Graphics Libraries. If you have any suggestion, please feel free to leave a comment below.