Microsoft OneDrive is a popular cloud storage service that allows you to store and access your important files from any device. However, it’s worth noting that OneDrive doesn’t offer official support for Linux. Luckily, there are several ways for you to access and synchronize your OneDrive files on a Linux system.
This article guides you through various methods to integrate OneDrive with your Linux environment. With these methods, you can access and manage your OneDrive files seamlessly within your Linux file systems.
Can You Use OneDrive on Linux?
Yes, you can access and use OneDrive on Linux in a few different ways. While there isn’t an official OneDrive client for Linux, several unofficial alternatives are available.
For instance, you can use an open-source, unofficial OneDrive client for Linux or a command-line tool like rclone instead. You can also access your OneDrive files quickly from your web browser.
Remember that these are unofficial solutions; your experience might vary depending on the tool and your Linux distribution. Regardless, these options allow you to integrate OneDrive into your Linux workflow.
Using the Unofficial OneDrive Client for Linux
The unofficial OneDrive client for Linux allows you to access and use OneDrive on Linux systems. Please note that this unofficial client isn’t supported by Microsoft in any way—you’ll need to use it at your own risk.
While it’s not officially supported, the OneDrive client for Linux is a free, open-source, and well-maintained option for Linux users to use.
Installing the Unofficial OneDrive Client for Linux
Follow these steps to download and install the Unofficial OneDrive client for Linux on a Debian or Ubuntu-based Linux system. Other distributions may need to follow different instructions.
- Open the terminal on your Linux PC.
- Type the following into the terminal to add the correct repository and repository keys to install the necessary packages:
wget -qO – https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.10/Release.key | gpg –dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null
- Once that command successfully runs, run this command: echo “deb [arch=$(dpkg –print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.10/ ./” | sudo tee /etc/apt/sources.list.d/onedrive.list
- Update your package manager by typing sudo apt update and wait for it to complete.
- Once your package manager is updated, run sudo apt install —no-install-recommends —no-install-suggests ldc onedrive in the terminal and wait for it to complete.
- If you run into a libphobos2-ldc-shared100 dependency error during installation, run wget http://launchpadlibrarian.net/619487666/libphobos2-ldc-shared100_1.30.0-1_amd64.deb && sudo dpkg -i /libphobos2-ldc-shared100_1.30.0-1_amd64.deb to resolve it first, then repeat the sudo apt install command.
Configuring and Using the Client
At this point, you should have successfully installed the unofficial Linux OneDrive client. You’ll need to configure it next to access your files.
- To run the client for the first time and generate the default configuration file, type onedrive into the terminal.
- You’ll be prompted to visit a Microsoft URL to authenticate and grant access to your OneDrive account. Open the URL in a web browser, sign in with your Microsoft credentials, and grant the necessary permissions.
- After granting permissions, you’ll see a blank page—copy the URL, paste it back into the terminal, and press the Enter key.
- The client will alert you if you were successful. To start synchronisation, type onedrive –synchronize into the terminal. This should start synchronizing your OneDrive files to a local folder (~/OneDrive by default). You’ll need to allow time for this process to complete.
- If you want the client to run in the background, type and run onedrive –monitor from your terminal.
For more information on the client’s features and settings, you can refer to the official documentation for the client on GitHub.
How to Access OneDrive on Linux Using Rclone
rclone is a powerful, open-source terminal tool for synchronizing and transferring files across local or remote systems on a Linux PC. By using rclone, you can set up your Linux PC to allow access to your OneDrive storage.
To use rclone with OneDrive on Linux, follow these steps.
- To get started, download and install Rclone on your Linux system. You can find the installation instructions for your specific distribution on the rclone website or type sudo -v ; curl https://rclone.org/install.sh | sudo bash into the terminal to quickly install it instead.
- Once Rclone is installed, type rclone config into the terminal to initiate the configuration process.
- When prompted, select the n key to create a new remote, and then enter a name for your OneDrive remote (such as onedrive).
- Next, locate the number for Microsoft OneDrive as the storage provider (typically 31), type it in, and press Enter to confirm.
- For client id and client secret, leave blank and press Enter.
- Choose your authentication region for OneDrive (typically by pressing 1 and hitting enter), then choose n to use the typical setup process to authenticate.
- When prompted, press Y to open a web browser to sign in. Enter your OneDrive account details and authorize Rclone to access your OneDrive account and storage by following the on-screen instructions.
- After the configuration is complete, close the browser and return to the terminal.
- Choose your OneDrive configuration—typically 1 for standard OneDrive access. Press the Enter key to continue.
- Choose your OneDrive ID from the options provided, typically by pressing 1 and hitting the Enter key.
- Press y again to confirm.
- At this point, the configuration should be complete. Press Y to confirm again and make it your default configuration.
- Press q to exit the configuration tool. You can use the rclone command to interact with your OneDrive files. For instance, to list the contents of your OneDrive account, run the command rclone ls onedrive: in your terminal.
- To download a file from your OneDrive account, run the command rclone copy onedrive:/path/to/file /path/to/local/directory in the terminal. Replace the /path/to paths with the file location and the location where you’d like to save the file on your local PC.
- To upload a file to your OneDrive account, run the command rclone copy /path/to/local/file onedrive:/path/to/remote/directory. Replace the /path/to paths with the file location and location in your OneDrive storage that you’d like to upload the file to.
- You can also use the rclone sync command to synchronize all of the files between your OneDrive account and your local Linux filesystem. For example, to synchronize all files in your OneDrive account to a local directory called ~/onedrive, run the command rclone sync onedrive: ~/onedrive.
- To synchronize a specific directory in your OneDrive account to a local directory, run the command rclone sync onedrive:/path/to/remote/directory /path/to/local/directory and replace the /path/to paths with the correct remote and local directories.
How to Access OneDrive on Linux Using Your Web Browser
Don’t want to install any additional software? You can quickly access your OneDrive files from a Linux PC using your web browser.
To do this, visit the OneDrive website and sign in with your Microsoft account. Once you sign in, you’ll see your OneDrive storage with folders and files. You’ll be able to download files, upload new ones, remove entire files or folders, or create new Office files directly and add them to your OneDrive storage.
You can also share your files with others by selecting the file and pressing the Share button.
Remember that changes made to files and documents on the OneDrive website will be synchronized with any other devices connected to your Microsoft account.
Managing Your Linux Files
Using OneDrive on Linux can be achieved using one of the tools above (or by using the OneDrive website). Although Microsoft doesn’t offer a native OneDrive application for Linux, these alternatives provide a similar experience.
Worried about your files? Remember to keep your file backups automated, ensuring your data stays secure and up to date. Be mindful of potential OneDrive sync issues that could arise, and always double-check your settings if you run into problems.