Install OneDrive on Linux Mint: Setup and Sync Guide
In this article
You can use Microsoft OneDrive on Linux Mint with the community-maintained onedrive command-line client. It connects to your Microsoft account and synchronizes files with a folder on your computer; it is not Microsoft’s official Linux desktop app. Before you begin, make sure you can sign in to your Microsoft account in a browser and have a reliable internet connection. The steps below use Mint’s Terminal and package manager.
What You'll Need
- A supported, up-to-date Linux Mint installation and an account with permission to install software.
- A Microsoft personal, work, or school account with OneDrive access.
- An internet connection and enough free disk space for the files you choose to sync.
- Basic familiarity with opening Terminal. You can find it in the Mint menu or press
Ctrl+Alt+T.
Step-by-Step
- Update Mint's package information. Open Terminal and run
sudo apt update. Enter your Linux password when prompted; it will not appear as you type. This refreshes the list of packages available from your configured repositories. - Install the client. Run
sudo apt install onedriveand confirm the prompt if asked. The package is available in many Mint and Ubuntu-based software repositories, but availability and version can differ between Mint releases. If apt says the package cannot be located, see Troubleshooting rather than downloading an unknown installer. - Check that it installed. Run
onedrive --version. If Terminal prints a version, the command-line client is ready. If it says the command is not found, check the installation message and the troubleshooting steps below. - Start account authorization. Run
onedrivewithout options. The client should display a Microsoft sign-in URL and ask you to authorize it. Copy the complete URL into a web browser, sign in to the account you want to sync, and approve access. Microsoft may show an organization’s consent or security checks for work and school accounts. - Return the authorization response to Terminal. After approval, the browser may show a blank page or a message that the page cannot be reached. This can be normal for the client’s authorization flow. Copy the full address from the browser’s address bar and paste it into Terminal when prompted, then press Enter. Treat that address as sensitive while it contains an authorization response; do not post or share it. The client should confirm that authentication succeeded.
- Run the first synchronization. Run
onedrive --synchronize. By default, the client uses a folder namedOneDrivein your home directory, usually~/OneDrive. The first run can take a while, depending on how many files are in your cloud account and your connection speed. Keep Terminal open until it finishes, and review any errors it reports. - Check your files. Open the file manager and look in your home folder for
OneDrive. Files downloaded by the client should appear there. To test upload and download, create a small test file in that folder, synchronize, and check whether it appears in OneDrive on the web. Delete the test file afterward if you do not need it. - Choose how to sync in the future. For a one-time manual update, run
onedrive --synchronizeagain. To keep files synchronized continuously while you are logged in, enable the client’s user service withsystemctl --user enable --now onedrive. Check its status withsystemctl --user status onedrive; pressqto leave the status screen. The user service normally runs for your logged-in account, not as root.
Common Mistakes
- Expecting a graphical app: The package installs a command-line client, not a OneDrive window or file-manager integration. Use Terminal for setup and status checks.
- Running the client with sudo: Do not use
sudo onedrive. It can create root-owned configuration or files and interfere with your normal account’s sync. - Missing part of the authorization URL: Copy the entire address-bar URL after approving access. A partial response can make sign-in fail.
- Assuming every cloud file is local immediately: Initial sync takes time and requires disk space. Check the client’s output before assuming a file is available offline.
- Using a command from an unrelated guide: Options and configuration can change between client versions. Check
onedrive --helpand the documentation for the version installed on your system.
Tips
- Use the same Linux account for setup, manual sync, and the user service. This keeps the configuration and local files in the right home directory.
- Before enabling automatic sync, run a manual synchronization and confirm the expected folder and account. This helps catch an incorrect account or an unsuitable setup early.
- If you want to sync only selected folders or change the local directory, consult the installed client’s documentation and configuration options first. Back up important local files before changing sync rules.
- Keep Mint and the client updated through trusted software sources. Avoid sharing configuration files, logs, or authorization responses publicly if they include account or access details.
Troubleshooting
Unable to locate package onedrive: Runsudo apt updateagain and check that Mint’s Software Sources are enabled and working. Search Software Manager foronedrive. If your release does not provide it, consult the client project’s official installation instructions for a repository or supported build that matches your Mint base. Do not add an unverified repository or run a random installation script.- Browser authorization fails: Confirm you signed in to the intended account and approved the request. Copy the complete response URL, including its query string, into the waiting Terminal prompt. If the prompt has closed, start
onedriveagain and repeat authorization. - Synchronization reports an error: Check the internet connection, available disk space, and the exact error text. Run
onedrive --synchronizeagain after correcting the cause. For command details, useonedrive --help; do not delete configuration or sync data as a first fix. - The background service is not running: Check
systemctl --user status onedrive. If it is inactive, trysystemctl --user restart onedrive, then check the status again. If the service reports a configuration error, read the message before changing files. - Changes are not showing up: Confirm that you are viewing the same Microsoft account and the correct local folder. Run a manual sync and check its output. Remember that a local file change may not appear online until the client has completed an upload.
Frequently Asked Questions
Is this Microsoft's official OneDrive app for Linux?
No. The onedrive package is a community-maintained command-line client, not an official Microsoft desktop application.
Where are my synced files stored?
The default location is ~/OneDrive in the home directory of the Linux account that authorized the client.
Does synchronization run automatically?
Not just because the client is installed. Run a manual sync when needed, or enable its user service as described above for ongoing synchronization while logged in.
Can I sync a work or school OneDrive account?
Often, yes, but access depends on your organization’s Microsoft settings and policies. If authorization is blocked, ask your administrator whether third-party clients are allowed.
Will this keep every file online-only?
Do not assume so. This client synchronizes files to a local folder; confirm the installed version’s documented features before relying on online-only or on-demand file behavior.
How do I stop automatic synchronization?
Run systemctl --user disable --now onedrive. This stops and disables the user service; you can still run a manual synchronization from Terminal.