Many cloud services don’t support the Linux platform, so if you’re looking to transfer files back and forth you’ll need to use a third-party solution. There are many types of solutions that enable Linux users to access third-party cloud services (like Google Drive, Backblaze, etc) but Rclone for Linux is the best by far, as it allows users to have multiple connections to many different services.
Install Google Go
Rclone uses Google Go, so before you can install it, you’ll need to have a build profile set up and ready to go. Thankfully, most Linux distributions have a recent version of the Go language in their software sources. Open up a terminal and get it set up on your Linux OS.
sudo apt install golang
sudo apt-get install golang
Most Linux distributions automatically set up a build environment for Google Go. Arch isn’t one of those distributions. Use the Pacman package tool to install the latest version of Google Go. Then, set up a build environment by following the official Arch Wiki instructions.
sudo pacman -S go
Fedora Linux has Google Go in the official software sources, but it doesn’t automatically set up a build environment. Use the DNF packaging tool to get Go, then follow the Fedora Developer instructions that show how to set up a build environment.
sudo dnf install golang
sudo zypper install go go-doc
Using a Linux distribution that doesn’t have a convenient package for installing Google Go? You’ll need to set everything up manually. Setting up Go from scratch starts out by downloading the release from the website.
cd ~/Downloads wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
When the Go package finishes downloading to your Linux PC, use the tar command and extract it to /usr/local.
sudo tar -C /usr/local -xvzf go1.11.linux-amd64.tar.gz
Go is working. The next step is to configure a development/build environment so that we can install Rclone on Linux. Start out by using the mkdir command to make a new folder.
mkdir -p ~/go-development
Following the main folder, create the “bin,” “src,” and “pkg” subfolders.
mkdir -p ~/go-development/bin mkdir -p ~/go-development/src mkdir -p ~/go-development/pkg
Open your Bash profile in the Nano, text editor.
Paste the code below into Nano.
Save the edits to your profile with Ctrl + O, and exit with Ctrl + X.
To install Rclone on Linux, open up a terminal and use the go get command. Running this command will download a recent version of the Rclone source code directly to your Go development environment.
go get github.com/ncw/rclone
CD into your Go environment path.
Find the Rclone binary file and place it in your Bin directory. Putting the data in this directory will make the app executable, like any other program.
sudo cp rclone /usr/bin/
Install Rclone Without Google Go
Using the Google Go version of Rclone is a great way to get the application up and running, as Go has support on nearly every Linux distribution.
That said if you don’t feel like setting up Go, feel free to check Pkgs.org for a binary version to install.
To install the Binary version, scroll through the list on the page, find your Linux distribution and click on “rclone.”
Use Rclone on Linux
Setting up Rclone on Linux starts by generating a new configuration file. In a terminal, run the rclone config command.
Using Rclone requires a new remote. To create a new remote connection, press the “n” button on your keyboard and press the enter key.
In the terminal box, type the name of the connection. In this tutorial, we’ll call this connection “test.”
After selecting a name, choose the type of connection for Rclone to use. Options are:
- 1. Amazon Drive
- 2. Amazon S3
- 3. Backblaze B2
- 4. Dropbox
- 5. Encrypt/Decrypt a remote
- 6. Google Cloud Storage
- 7. Google Drive
- 8. Hubic
- 9. Local Disk
- 10. Microsoft OneDrive
- 11. OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
- 12. SSH/SFTP
- 13. Yandex Disk
Enter the selection number for your new connection and press the enter key on the keyboard to move on to the next step in the configuration process.
Follow the prompts and do what the steps say. When your new Rclone connection is ready to go, write the letter “y” for “yes this is OK” and press the enter key.
Your new Rclone connection is set up. Let’s copy some files. To copy some data into the root directory of your connection, do:
rclone copy /home/username/path/to/local/data-folder/ nameofconnection:remotefolder
Want to sync some data down from your remote connection with Rclone? Do it with the following command.
rclone sync nameofconnection:remotefolder /home/username/path/to/local/data-folder/