How to Use Microsoft OneDrive on Linux?

Microsoft OneDrive was developed by Microsoft and is pre-installed on the Windows operating system. It does not provide an app for Linux OS. If you have decided to migrate from Windows / macOS to Linux and want to set up OneDrive, read this article to learn how to install it on your Linux machine using both the GUI and CLI methods.

Introduction to OneDrive

OneDrive is a cloud storage solution that enables users to store, sync, and share files over multiple different devices online. It is a part of Microsoft's Office Suite, which provides an easy way to access documents, spreadsheets, presentations, docs and various other files from anywhere at any time using an internet connection. OneDrive comes up with both personal and business versions, provides a number of features like automatic backup version history and allows the sharing of files and folders with others.

How to Use Microsoft OneDrive on Linux?

Why OneDrive on Linux?

OneDrive provides important features such as real-time editing and file sharing, which can be done easily through web browsers on Linux. It helps Linux users collaborate with team projects and share documents with colleagues using Windows or macOS. Microsoft does not provide an official OneDrive application for Linux, but several third-party tools such as rclone, OneDrive-d, and insync allow Linux users to use OneDrive on Linux. Another reason to go with a OneDrive account on Linux is that the free plan offers 5 GB of storage, making it an easy and cost-effective option for cloud storage.

Method 1: Using OneDrive Client for Linux

Various OneDrive clients were released for Linux, but most are outdated. One project that is still in use and continues to be in the development process is the OneDrive Client for Linux. If you wish to get OneDrive on Linux--short-term or long-term--you can go with OneDrive Client for Linux.

You can download this software directly from GitHub and can install it on any Linux distribution. On the GitHub page, you can find all the steps to install on your Linux distro. To demonstrate how straightforward it is, the section below will demonstrate how to install OneDrive Client for Linux on Ubuntu 24.04 LTS.

OneDrive Client for Linux can be installed on most distros of Debian-based. But we are using here Ubuntu 24.04 LTS to install. The following steps describe installation procedures.

First, ensure that your Linux system is fully updated by running the below commands one by one in a terminal:

Commands

Then, install the necessary dependencies:


How to Use Microsoft OneDrive on Linux?

Now, clone the OneDrive client repository:


How to Use Microsoft OneDrive on Linux?

After that, navigate to the onedrive cloned directory:

Now, install the OneDrive client:


How to Use Microsoft OneDrive on Linux?

Note: It may happen that the above command will not work without a compatible D compiler. So, you may need to install it first using the given command:


How to Use Microsoft OneDrive on Linux?

Now, again, navigate to the onedrive cloned directory and try to install the onedrive client. It should be working the command now.

After installing, configure your OneDrive account:


How to Use Microsoft OneDrive on Linux?

After running the command, you can see a link to configure the account. Just copy this link and paste it into the browser, then provide the credentials to log in with your Microsoft account. After signing in, copy the url and paste it into the terminal in the section: Enter the response uri from your browser:

How to Use Microsoft OneDrive on Linux?

After signing in, click on the Accept button to give the OneDrive client for Linux permission to access all your OneDrive files.

How to Use Microsoft OneDrive on Linux?

Note: The steps can be different on other Linux distributions. For example, in Ubuntu, different key and repository commands needed to be performed.

Installation Commands for Other Linux Distributions

If you are not using Ubuntu, don't worry. Here, we are providing those commands if you are using other Linus distros like Fedora, Arch, Manjaro, OpenSUSE, Rocky Linux, Alma Linux, and CentOS.

On Fedora

1. First, update your system:

2. Now, install the dependencies:

3. Then, clone the OneDrive client repository:

4. Then, navigate to the cloned directory:

5. Finally, build and install the client:

6. Now, run the OneDrive client

On Arch Linux-Based Distros

1. For Arch Linux-based systems, you can install the OneDrive client using yay:

2. In addition, you can manually install it from AUR using the following commands:

3. Now, run the OneDrive client

On openSUSE

1. Update your system:

2. Then, install the dependencies:

3. Next, clone the OneDrive client repository:

4. After that, navigate to the cloned directory:

5. Finally, build and install the client:

6. Finally, run OneDrive

On RHEL-Based Distributions

1. Update your Linux system:

2. Then, install these tools and libraries:

3. Now, clone the OneDrive client repository:

4. Next, navigate to the cloned directory:

5. Then, build and install the client:

6. Lastly, run the OneDrive client:

How to Sync OneDrive to Linux?

To sync OneDrive to Linux, run the command:

In the above command, include the path by replacing [FILEPATH] to synchronize the data. On your Linux system, there should be enough storage space to sync data from your OneDrive account.

To begin the synchronization process, provide your Microsoft account credentials. For this process, OneDrive Client for Linux app will provide you with a link to open in your browser after running the onedrive command in the terminal. After signing in to your Microsoft account, copy the URL and paste it into the terminal.

How to Use Microsoft OneDrive on Linux?

You can see the sync status with the following command:


How to Use Microsoft OneDrive on Linux?

Method 2: Get the OneDrive on Linux Using Rclone

Rclone is a command-line tool that allow you to easily install OneDrive on your Linux machine. It easily supports several cloud services, including Google Drive, OneDrive, and many more. You can sync files between your computer and cloud storage and copy or move files between different cloud storage providers.

How to Install Rclone on Ubuntu?

1. Install Rclone:

2. To configure Rclone:

3. To create a new remote, type n and give a name to your remote. Select the cloud provider from the given list. Follow the authentication steps provided. Check configurations.

4. To list all your remote configurations:

5. To see your OneDrive files:

6. To copy all the files from your Linux local storage to OneDrive:

7. To sync files, use:

8. To mount cloud storage, use the command:

9. To check the Rclone Status, run the command:

Method 3: Use OneDrive on Linux Using OneDriver

OneDriver is a Command-Line Interpreter-Based tool that allows Linux users to install OneDrive on Linux easily. You can install OneDriver using the following steps:

1. Start by adding the PPA using the following code:

2. Then, update the package list:

3. Now, install OneDriver:

4. After installing the tool, configure it to link it to your Microsoft OneDrive account.

5. Now, create a directory to mount OneDrive:

6. Run OneDriver using the given command:

7. In the last step, authenticate to your Microsoft account. Next, log in and allow OneDriver access to your OneDrive files.

Method 4: Getting OneDrive on Linux Using OneDriveGUI

OneDriveGUI is a Graphical User Interface-based tool. You can easily get OneDrive on your Linux distro like Ubuntu using this. Before installing OneDriveGUI, include the necessary dependencies on your system using the below commands:

1. Install the dependencies:

2. Now, download and install OneDriveGUI by cloning the GitHub repository:

3. Change to the directory where you cloned OneDriveGUI:

4. Install required Python packages:

5. Run OneDriveGUI:

Method 5: Install OneDrive on Linux Using Insync

Insync is also a GUI-based tool to get the OneDrive on Linux. To install Insync, follow the steps given below.

1. Download the repository key using the given command:

2. Add the Insync repository to your sources list:

3. Update your system's package list:

4. Install Insync

5. Launch Insync After the installation is complete, launch Insync:

6. After launching, sign in with your OneDrive account. Next, follow the on-screen instructions to authenticate and link your account.

Note: Insync is not a free tool. However, it offers a free trial version for users who want first explore its features.

Conclusion

This article covered every method of setting up OneDrive on your Linux distribution (Ubuntu). In the methods section, we have covered CLI-based tools such as OneDrive Client for Linux, OneDriver, and Rclone. However, also described those tools that included graphical user interfaces like OneDriveGUI and Insync. We have provided each and every procedure in a stepwise manner so that any Linux user with a little knowledge of Linux CLI and GUI can perform the task easily. After getting OneDrive on Linux, you can access all the files online, which enables you to sync OneDrive to your Linux machine's local storage to back up local files automatically on OneDrive storage.