How to Use `rclone` for Cloud Storage on Arch Linux
rclone
for Cloud Storage on Arch LinuxCategories:
5 minute read
Cloud storage has become an essential part of modern computing. Whether you’re backing up your system, sharing files across devices, or syncing important documents, having a reliable way to interact with cloud providers from your Linux machine is a must. On Arch Linux, one of the best tools available for managing cloud storage from the command line is rclone
.
This article will guide you through installing, configuring, and using rclone
for various cloud storage tasks on Arch Linux. We’ll cover syncing files, mounting cloud storage as a filesystem, and performing scheduled backups—all while keeping things secure and efficient.
What is rclone
?
rclone
is a command-line program that allows you to manage and sync files between your local filesystem and over 70 different cloud storage services, including:
- Google Drive
- Dropbox
- OneDrive
- Amazon S3
- Mega
- Backblaze B2
- pCloud
- WebDAV servers
- FTP/SFTP
- And many more
rclone
is often compared to rsync
but designed specifically for the cloud. It is robust, scriptable, and fast, with built-in support for file encryption, caching, and mounting cloud services as if they were local drives.
Step 1: Installing rclone
on Arch Linux
Installation on Arch Linux is straightforward, thanks to the Arch User Repository (AUR) and official repositories.
To install rclone
from the official repos:
sudo pacman -S rclone
You can verify the installation with:
rclone version
If you want the very latest development version, it’s also available in the AUR:
yay -S rclone-git
Step 2: Configuring rclone
Once installed, you need to set up a remote—which is how rclone
refers to cloud storage providers.
Launch Configuration Wizard
rclone config
You will see an interactive prompt like this:
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
Press n
to create a new remote.
Example: Setting Up Google Drive
Let’s say you want to connect to Google Drive. Here’s how the process works:
- Name the remote (e.g.,
gdrive
) - Choose the storage provider – select the number for Google Drive.
- Client ID/Secret – You can leave them blank to use the default, or enter your own for more control.
- Scope – Choose full access (
drive
). - Auto-config – If you’re on a desktop, say
yes
, and a browser window will open for OAuth authentication. - Team Drive? – If you’re not using Google Workspace/Team Drive, just say
no
.
After successful authentication, the remote will be saved, and you’ll see:
Current remotes:
Name Type
==== ====
gdrive drive
You can add multiple remotes by repeating this process.
Step 3: Basic rclone
Commands
Now that you’ve got a remote configured, you can start using rclone
. Let’s look at some core commands.
Listing Files and Directories
rclone ls gdrive:
You can also use rclone lsd
(list directories only) or rclone lsf
(structured file list).
Example:
rclone lsd gdrive:
Copying Files
To upload a file from your system to Google Drive:
rclone copy ~/Documents/report.pdf gdrive:Backups
To download a file from cloud storage:
rclone copy gdrive:Backups/report.pdf ~/Downloads
rclone copy
does not delete files from the source; usesync
if you want mirroring.
Syncing Directories
Synchronize a local directory with a remote folder:
rclone sync ~/Pictures gdrive:Photos
Be careful: sync
will delete files on the destination if they are not present on the source.
Step 4: Mounting Cloud Storage as a Filesystem
You can mount a cloud remote like a local directory using rclone mount
.
First, ensure fuse
is installed:
sudo pacman -S fuse3
Then run:
rclone mount gdrive: ~/gdrive --vfs-cache-mode writes
This mounts your Google Drive at ~/gdrive
. You can browse, open, and save files like you would on a local disk.
To unmount:
fusermount3 -u ~/gdrive
Optional: Automate Mounting with Systemd
To auto-mount your cloud storage at boot, create a systemd service file:
sudo nano /etc/systemd/system/rclone-gdrive.service
Paste the following (adjust paths and names as needed):
[Unit]
Description=Rclone Mount Google Drive
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount gdrive: /home/yourusername/gdrive \
--vfs-cache-mode writes \
--allow-other \
--umask 002 \
--log-level INFO \
--log-file /var/log/rclone-gdrive.log
ExecStop=/bin/fusermount3 -u /home/yourusername/gdrive
Restart=on-failure
User=yourusername
Group=yourgroup
[Install]
WantedBy=default.target
Enable and start the service:
sudo systemctl enable --now rclone-gdrive
Step 5: Encrypting Your Files
rclone
has built-in encryption support via the crypt
remote.
Add a Crypt Remote
rclone config
- Choose
n
to create a new remote - Name it something like
gdrive-encrypted
- Choose storage type:
crypt
- Enter the path:
gdrive:secure
- Set a strong password (rclone can generate one)
- Optionally encrypt filenames and directory names
Once done, you can use it like any other remote:
rclone copy ~/Private gdrive-encrypted:
This ensures your files are encrypted before they ever leave your system.
Step 6: Scheduling Backups with cron
Let’s automate syncing a local folder to Google Drive every night.
Create a Script
nano ~/rclone-backup.sh
#!/bin/bash
rclone sync ~/Documents gdrive:DocumentsBackup --log-file=$HOME/rclone-backup.log --log-level INFO
Make it executable:
chmod +x ~/rclone-backup.sh
Add to Crontab
crontab -e
Add the line:
0 2 * * * /home/yourusername/rclone-backup.sh
This will run the script every night at 2 AM.
Step 7: Useful Tips and Flags
--dry-run
– Simulate what the command would do without making changes.--progress
– Show live progress during transfers.--bwlimit
– Limit bandwidth usage.--transfers
– Number of parallel transfers (default is 4).--checkers
– Number of file checkers during sync.
Example:
rclone sync ~/Videos gdrive:Media --progress --bwlimit 2M
Troubleshooting Common Issues
OAuth not working (headless servers):
Use rclone authorize
on a desktop and copy the token back to your server.
API Rate Limits:
Google Drive and others have rate limits. Use flags like --tpslimit
or --drive-chunk-size
to mitigate.
Files not appearing:
Try rclone lsf
with --fast-list
or --drive-list-chunk
for better performance.
Conclusion
rclone
is a powerful tool that transforms the way you interact with cloud storage on Arch Linux. Whether you’re syncing documents, creating backups, or mounting a remote filesystem, rclone
offers a secure and flexible solution—all from the command line.
It supports a wide array of providers, handles encryption gracefully, and integrates well with automation tools. For power users, system administrators, or anyone managing cloud files on Linux, rclone
is an indispensable utility.
Once you get the hang of it, you’ll find it more efficient and scriptable than many GUI-based alternatives. Give it a try—and make your Arch Linux cloud-native in the smartest way possible.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.