How To Install OneDrive on Ubuntu 24.04 LTS
Ubuntu users often face challenges when trying to access Microsoft’s OneDrive cloud storage service on their Linux systems. While Windows users enjoy seamless OneDrive integration, Ubuntu 24.04 LTS users must explore alternative methods to synchronize their files with Microsoft’s cloud platform. This comprehensive guide will walk you through multiple proven methods to install and configure OneDrive on Ubuntu 24.04 LTS, ensuring you can access your cloud storage efficiently.
The demand for OneDrive access on Linux systems has grown significantly as more professionals, students, and organizations rely on Microsoft’s ecosystem for collaboration and file sharing. Ubuntu 24.04 LTS, with its enhanced stability and updated packages, provides several viable options for OneDrive integration. Whether you need basic file access or full synchronization capabilities, this guide covers every scenario.
Throughout this tutorial, you’ll discover three primary installation methods: GNOME’s native online accounts integration, the popular abraunegg OneDrive client, and alternative third-party solutions. Each method offers unique advantages depending on your specific requirements, technical expertise, and usage patterns.
Prerequisites and System Requirements
System Requirements
Your Ubuntu system should have at least 2GB of available disk space for the OneDrive client and synchronized files. The installation requires a stable internet connection and approximately 512MB of RAM for optimal performance. To verify your Ubuntu version, execute the following command:
lsb_release -a
The output should confirm Ubuntu 24.04 LTS as your operating system. Most desktop environments, including GNOME, KDE Plasma, and XFCE, support OneDrive clients with varying degrees of integration.
Before You Begin
Ensure you have a valid Microsoft account with OneDrive access. Personal Microsoft accounts include 5GB of free storage, while Microsoft 365 subscriptions provide 1TB or more. Administrator privileges are essential for installing system packages and configuring services.
Update your package repository and system packages before proceeding:
sudo apt update && sudo apt upgrade -y
Consider backing up important local files before setting up synchronization to prevent data loss during configuration.
Method 1: Native GNOME Online Accounts Integration
Understanding GNOME 46 Integration
GNOME’s native OneDrive support provides seamless file access through the default file manager without requiring additional software installation. This integration mounts OneDrive as a network location rather than synchronizing files locally, which means files are accessed on-demand through your internet connection.
The native integration offers excellent compatibility with GNOME applications and maintains system consistency. However, it requires constant internet connectivity and doesn’t provide offline file access or advanced synchronization features.
Step-by-Step Setup Process
Launch the Settings application by pressing the Super key and typing “Settings” or use the keyboard shortcut Super + I
. Navigate to the “Online Accounts” section in the left sidebar menu.
Click the “Add Account” button and select “Microsoft 365” from the available service providers. This action will open your default web browser and redirect you to Microsoft’s authentication page.
Enter your Microsoft account credentials in the browser window. If you have two-factor authentication enabled, complete the additional security verification steps. Review the permissions requested by GNOME and click “Accept” to grant access to your OneDrive files.
Return to the Settings window where you should see your Microsoft account listed under connected accounts. The setup process typically completes within 30-60 seconds, depending on your internet connection speed.
Accessing OneDrive Files
Open the Files application (Nautilus) from the Activities overview or press Ctrl + Alt + F
. Look for your Microsoft account in the left sidebar under “Other Locations” or directly in the main sidebar.
Click on your OneDrive entry to browse your cloud files. The interface behaves similarly to local folders, allowing you to open, copy, and move files. Keep in mind that large files may take longer to load due to network download requirements.
File operations like copying to local storage work seamlessly, but editing cloud files directly requires downloading them first. The system maintains file associations, so documents open in their appropriate applications automatically.
Method 2: Installing abraunegg OneDrive Client
Client Overview and Features
The abraunegg OneDrive client is an open-source solution that supports OneDrive Personal, OneDrive Business, and Office 365 accounts. Unlike GNOME’s integration, this client creates local copies of your cloud files, enabling offline access and advanced synchronization options.
Key features include bidirectional synchronization, selective folder sync, bandwidth throttling, and systemd integration for automatic startup. The client operates through command-line interface primarily, though graphical interfaces are available separately.
Installation Options
Option 1: Ubuntu Repository Installation
The simplest installation method uses Ubuntu’s official repository packages. Execute the following command in your terminal:
sudo apt install onedrive
This method installs a stable but potentially older version of the client. The repository version receives security updates but may lack the latest features found in upstream releases.
Verify the installation by checking the version:
onedrive --version
Option 2: Third-Party Repository
For the most recent features and bug fixes, add the OpenSUSE Build Service repository that maintains updated packages for Ubuntu systems.
First, add the repository GPG key:
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.04/Release.key | sudo apt-key add -
Add the repository source:
echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list
Update package information and install:
sudo apt update
sudo apt install onedrive
Initial Configuration and Authorization
After installation, begin the authorization process by running the client for the first time:
onedrive
The application will display a URL that you must copy and paste into your web browser. The URL typically appears as:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=...
Open this URL in your browser and sign in to your Microsoft account. After successful authentication, Microsoft will display an authorization code. Copy this code and return to your terminal.
Paste the authorization code when prompted. The client will verify the credentials and create necessary configuration files in your home directory under ~/.config/onedrive/
.
Basic Synchronization Operations
Before performing a full synchronization, test the connection with a dry run:
onedrive --dry-run --sync
This command shows what changes would be made without actually modifying files. Review the output to ensure the synchronization will behave as expected.
Execute a complete synchronization:
onedrive --sync
The initial sync may take considerable time depending on your OneDrive storage usage and internet connection speed. The client creates a local OneDrive
folder in your home directory by default.
For single-directory synchronization, specify the target folder:
onedrive --sync --single-directory Documents
Monitor synchronization progress through verbose output:
onedrive --sync --verbose
Method 3: Alternative OneDrive Solutions
onedriver – FUSE Filesystem Approach
The onedriver application creates a FUSE-based filesystem that mounts OneDrive as a local directory with on-demand file downloading capabilities.
Install onedriver from the official repository:
sudo apt install onedriver
Create a mount point directory:
mkdir ~/OneDrive
Mount your OneDrive account:
onedriver ~/OneDrive &
The application will prompt for authentication through your web browser. After authorization, your OneDrive files appear in the specified directory, downloaded automatically when accessed.
Onedriver excels at handling large files and provides seamless filesystem integration. Files appear instantly in the directory but download on-demand, conserving local storage space.
rclone – Multi-Cloud Solution
Rclone offers comprehensive cloud storage support, including OneDrive, with powerful command-line tools and optional GUI interfaces.
Install rclone:
sudo apt install rclone
Configure OneDrive access:
rclone config
Follow the interactive configuration wizard:
1. Choose “New remote”
2. Enter a name (e.g., “onedrive”)
3. Select “Microsoft OneDrive” from the storage list
4. Complete the authentication process
Synchronize files using rclone commands:
rclone sync onedrive: ~/OneDrive --progress
For bidirectional synchronization:
rclone bisync onedrive: ~/OneDrive --resync
OneDriveGUI – Graphical Interface
OneDriveGUI provides a user-friendly graphical interface for the abraunegg OneDrive client, simplifying configuration and monitoring.
Download the latest release from GitHub and install using the appropriate package manager. The GUI offers multi-account support, automatic synchronization scheduling, and visual sync status indicators.
Launch OneDriveGUI and configure your accounts through the intuitive interface. The application runs in the system tray and provides desktop notifications for sync events.
Advanced Configuration and Optimization
Systemd Service Configuration
Enable automatic OneDrive synchronization at system startup using systemd services. This configuration ensures your files stay synchronized without manual intervention.
Enable the user service:
systemctl --user enable onedrive
systemctl --user start onedrive
Check service status:
systemctl --user status onedrive
View service logs for troubleshooting:
journalctl --user -u onedrive -f
For system-wide installation, use the global service:
sudo systemctl enable onedrive@$USER
sudo systemctl start onedrive@$USER
Custom Configuration Files
Create personalized configuration by copying the default template:
mkdir -p ~/.config/onedrive
cp /usr/share/doc/onedrive/config ~/.config/onedrive/
Edit the configuration file:
nano ~/.config/onedrive/config
Key configuration options include:
– sync_dir
: Local synchronization directory path
– skip_file
: Exclude specific files using patterns
– skip_dir
: Exclude entire directories
– monitor_interval
: Synchronization check frequency
– min_notify_changes
: Minimum changes before notification
Selective Synchronization
Configure single-directory synchronization for specific folders. Edit the configuration file and set:
sync_dir = "~/Documents/OneDrive"
skip_dir = "Pictures|Videos"
This configuration synchronizes only specified directories while excluding others, optimizing storage usage and sync performance.
Create exclusion rules for file types:
skip_file = "*.tmp|*.log|~*"
Troubleshooting Common Issues
Authentication Problems
Token expiration requires re-authentication. Delete the stored authentication and repeat the authorization process:
rm ~/.config/onedrive/refresh_token
onedrive
Browser compatibility issues may prevent successful authentication. Try different browsers or clear browser cache and cookies for Microsoft domains.
Network firewall restrictions can block authentication. Ensure ports 80 and 443 are accessible for HTTPS connections to Microsoft servers.
Synchronization Errors
File conflicts arise when local and cloud files differ. The OneDrive client typically creates conflict copies with timestamps. Review and merge changes manually.
Permission errors occur when the client cannot write to the local directory. Verify directory ownership and permissions:
ls -la ~/OneDrive
sudo chown -R $USER:$USER ~/OneDrive
Large file synchronization may timeout on slow connections. Adjust the configuration file:
operation_timeout = 3600
Performance Optimization
Reduce sync frequency for better performance:
monitor_interval = 300
Limit bandwidth usage:
rate_limit = "1M"
Exclude temporary files and system directories from synchronization to improve performance and reduce unnecessary network traffic.
Security and Privacy Considerations
Data Protection
OneDrive files are stored locally in plaintext after synchronization. Consider using disk encryption for sensitive data protection. Ubuntu 24.04 LTS supports LUKS encryption during installation.
Implement strong password policies for your Microsoft account and enable two-factor authentication for additional security. Regular password updates minimize unauthorized access risks.
Local file backups provide additional protection against synchronization errors or accidental deletions. Create regular backups of critical synchronized folders.
Network Security
OneDrive clients use HTTPS encryption for data transmission, ensuring secure communication with Microsoft servers. Verify SSL certificate validity during authentication processes.
VPN usage may affect synchronization performance but provides additional privacy protection. Test synchronization functionality after VPN configuration changes.
Corporate networks may restrict cloud storage access. Consult IT administrators about firewall rules and proxy configurations for OneDrive connectivity.
Best Practices and Tips
Workflow Integration
Integrate OneDrive synchronization with existing file management workflows. Create symbolic links to frequently accessed folders for convenient access:
ln -s ~/OneDrive/Documents ~/Desktop/OneDrive-Docs
Develop backup strategies that complement cloud synchronization. Local backups protect against synchronization errors while cloud storage provides offsite protection.
Version control systems like Git work alongside OneDrive synchronization but require careful configuration to avoid conflicts. Consider using .gitignore
files to exclude OneDrive metadata.
Maintenance and Updates
Regular client updates ensure compatibility with Microsoft’s service changes and provide security improvements. Monitor for updates:
apt list --upgradable | grep onedrive
Backup configuration files before major updates:
cp -r ~/.config/onedrive ~/.config/onedrive.backup
Monitor log files for recurring errors or performance issues:
tail -f ~/.config/onedrive/sync.log
Periodic configuration reviews help optimize performance and storage usage as your OneDrive usage patterns change.
Congratulations! You have successfully installed OneDrive. Thanks for using this tutorial for installing the OneDrive online cloud storage on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official OneDrive website.