Cloud storage solutions for Linux

Here are recommendations for cloud storage options that can be used on Linux including a way on how to synchronise them. This includes Dropbox, Box, Yandex, Google Drive, and OneDrive. However, I used a workaround for Google Drive and OneDrive which may not necessarily be feasible for you.

Motivation

The best option for Windows machines is not necessarily the best for Linux. Cloud storage solution is not different.

Google Drive is fast and provides decent amount of space in their free tier. However, I came across challenges in accessing it on Linux so I spent time identifying ways to get it to work and gave alternative options a try.

Note: I am using Ubuntu 17.10.

Cloud storage solutions that work on Linux

Dropbox

Hands down, this is the best option for Linux users because they provide an official client for Linux, mirrors a copy onto disk, and have been around long enough to convince me that they are here to stay on a going concern.

Install via Dropbox’s official Linux installer.

Screenshot of how Dropbox tray icon appears:

Ubuntu tray icon

The only minor inconvenience I found was I needed to refresh Nautilus to know the status of the sync of new/changed files and folders. Otherwise they appear like below even after synchronisation has completed.

Dropbox folder sync in progress

Box and Yandex

These two do not exactly provide an official GUI client for Linux but they do support secure WebDAV protocol which Nautilus from GNOME 3 supports. This method does NOT mirror a copy to disk.

Open Nautilus then click on “Other Locations” on the bottom left:

Nautilus Other Locations

Then enter the WebDAV URL of the cloud storage provider into “Connect to Server” field on the bottom right:

Nautilus Connect to Server

The WebDAV URLs are:

  • Box: davs://dav.box.com/dav/
  • Yandex: davs://webdav.yandex.com/

I use these two cloud storage providers to keep redundant copies of my files.

Google Drive and OneDrive

Neither Google nor Microsoft provide official GUI client for Linux.

GNOME 3.18 added support for mounting Google Drive directly from Nautilus. However, I found it too slow to open it for the first time after reboot; taking at least 30 seconds. Furthermore, files are not mirrored to disk using this method.

I figured a workaround that makes use of my network-attached storage (NAS) for syncing to Google Drive then I mount from my laptop to NAS via Samba. On my QNAP NAS, I installed an app called “Cloud Drive Sync” which allows me to synchronise with Google Drive, Dropbox, and OneDrive. Similar apps should be available on other major NAS brands. For example, Asustor has “DataSync” and Synology has “Cloud Sync”.

QNAP Cloud Drive Sync

Then, I mount to my NAS shared folder as a Samba shared folder with network transfer performance of a local LAN.

I did say this option may not be feasible for you. I recommend using Dropbox, at least for now.

Syncing local folder to network share

While some would suggest mounting Samba shares via /etc/fstab, I prefer not to use that because it requires sudo and saving password to access the network share into a file that sits outside my home directory. Instead, I prefer to use gio mount.

The command:

gio mount smb://<hostname>/path/

To have this performed at Ubuntu startup, run “Startup Applications Preferences”. Add a new entry with the gio mount command above.

Startup Applications Preferences - Mount Network Share

Remember to substitute <hostname>. On Ubuntu 17.10, the mount points appear under /run/user/<userid>/gvfs/.

To automate syncing a local folder (i.e. Dropbox) to my Network-Attached Storage, I setup cron jobs for syncing to Google Drive and OneDrive.

Edit crontab (without sudo):

crontab -e

Then paste the following lines:

0 * * * * rsync -r -t --delete -s /home/<username>/Dropbox/Documents/ "/run/user/<uid>/gvfs/smb-share:server=<hostname>,share=home/Google Drive/Documents/"
0 * * * * rsync -r -t --delete -s /home/<username>/Dropbox/Documents/ "/run/user/<uid>/gvfs/smb-share:server=<hostname>,share=home/OneDrive/Documents/"

What this does is it uses rsync to synchronise a source to destination every hour. The --delete parameter causes the destination files/folders to be deleted if they do not exist in source. If you are uncomfortable with that setting, you may remove it. Be sure to substitute <username> with your Linux username, <uid> with your user ID (mine is 1000) and <hostname> with your NAS hostname.