onedrive
OneDrive Client for Linux
A free Linux and FreeBSD command-line client for Microsoft OneDrive that syncs files two-way with filtering rules, real-time change detection, and headless server support.
This project is a free OneDrive client that runs on Linux and FreeBSD. It lets you sync files between your local computer and your Microsoft OneDrive account, including personal accounts, OneDrive for Business, Microsoft 365, and SharePoint document libraries. It is actively maintained and has been the primary community alternative since the original OneDrive Linux client project was abandoned around 2018 and formally archived in 2024.
The client supports several sync modes. By default it runs a two-way sync, keeping local and remote files in agreement. You can also set it to upload-only (so it never pulls changes down) or download-only (so it never pushes local changes up). There is also a dry-run mode that lets you test your configuration without actually moving any files, which is useful when you are setting up filtering rules and want to confirm what will and will not be synced.
Filtering is one of the more detailed features. You can write rules to include or exclude specific files, folders, or patterns, so only the parts of your OneDrive you care about get synced locally. The client tracks sync state in a local cache so it can make fast decisions even when you have a large number of files. Changes on the cloud side are detected using a WebSocket connection for near real-time updates, and local changes are picked up through the Linux inotify system.
For authentication, the client uses the standard OAuth2 login flow, which means you sign in through a browser and it handles the token management from there. On servers or headless machines where there is no browser available, it offers a device-authorization flow instead. Enterprise users can also configure single sign-on through Microsoft Intune if their organization requires it.
The client handles interrupted transfers by resuming them automatically, validates file integrity after each transfer, and creates local backups when it detects a conflict it cannot resolve safely. Desktop notifications and file-manager sidebar integration are available for users running a graphical environment, but every core feature works fine on servers with no graphical interface at all.
Where it fits
- Sync your Microsoft OneDrive files on a Linux server or desktop without a graphical Microsoft client
- Run upload-only or download-only sync with filtering rules to selectively mirror specific folders
- Use dry-run mode to test your sync configuration and filtering rules before any files are moved
- Authenticate headlessly on a server using the device-authorization OAuth2 flow instead of a browser