Suraj's Blog

Laziest Method to Install GDrive in Linux Terminal Only

šŸš€ Google Drive Backup-Upload via Terminal & Installing rclone on Debian (Bookworm Latest)

Go to bottom instantly and read the last paragraph, if you are a nerd and want to know how this setup goes.

sudo -v ; curl https://rclone.org/install.sh | sudo bash

Okay, so it’s done. Now, time to do the main setup.

rclone config

Setting Up Client ID & Secret

Now, we come to the hardest part: the client ID and secret. Before this, you need to do one thing:

  1. Sign in to Google Cloud Console with the account you’ll use for Drive storage.
  2. Create a new project (I mean, why clutter other projects if you have many? Just create a new one).
  3. After creation, find “ENABLE APIS AND SERVICES” and search for “Drive” and enable it. Yes, do it right now.
  4. Click “Credentials” in the left-side panel (not “Create credentials”).
  5. If you haven’t configured the OAuth screen yet, do it now.
    • Click on “CONFIGURE CONSENT SCREEN” (top right corner of the right panel).
    • Select External and click CREATE.
    • Enter an Application Name (“rclone” is fine), User Support Email, and Developer Contact Email (your own email is fine).
    • Click Save (all other data is optional).
  6. Now, add scopes (this is needed so Rclone gets full access):
https://www.googleapis.com/auth/docs,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/drive.metadata.readonly
  1. Save and continue.
  2. Add users—add your own account under “Test Users”.
    • (If you’re a GSuite user, you could select “Internal” instead of “External”, but this restricts API use to Google Workspace users in your organization.)
  3. Click "+ CREATE CREDENTIALS" → “OAuth Client ID”.
  4. Download the JSON file (this is your client ID & secret—save it, it’s useful for the future).
  5. Choose Desktop app as the application type and click Create.
  6. If you chose “External,” publish the app. If “Internal,” no need to do anything.

Back to Rclone Setup

Go back to the terminal and:

socat TCP-LISTEN:8082,fork,reuseaddr TCP:127.0.0.1:53682

Alternative (Hostless Option):

ssh -L 53682:127.0.0.1:53682 headless-host

Verifying Setup

rclone ls gdrive:

Boom! Your drives and files are listed. šŸŽ‰

Mounting the Storage (Optional)

rclone mount --daemon gdrive:/your_directory

Check with:

df -h

Well, what magic? It’s just your drive added here. šŸ˜†


Backing Up to Google Drive (100% Success Rate āœ…)

Tested Environment: Debian Bookworm (Latest as of March 9, 2025)

Installing tmux (for Background Uploads)

apt install tmux -y

Starting a New Session

tmux new -s rclone_upload

A new screen should open—paste your command there.

rclone copy /var/lib/vz/dump gdrive:8Mar2025 --progress

gdrive: is my drive name (yours may vary), 8Mar2025 is my backup folder, and --progress helps track uploads.

Running in Background

Ctrl + B, then D

Reattaching to Session

tmux attach -t rclone_upload

Spoiler Alert: I noticed single files don’t go above 45MBps, while multiple files exceed 100MBps. Weird. Ask the Rclone community about it. Maybe try AI chat or something? šŸ¤·ā€ā™‚ļø

That’s it! You’re all set up with Rclone for Google Drive backups. but if you want to read some facts about the steps then read below


  1. I chose Debian OS because there weren’t any guides available for it, and I was already using Debian, so I made this guide.

  2. Why no detailed steps? I just wanted to create a setup so lazy that anyone who doesn’t want to read lengthy paragraphs (not like you, since you’re here reading this) will find it useful, and their work won’t stop.

  3. Why was setting up the client ID and secret the hardest part? Honestly, I messed this up multiple times, so I consider it the hardest (mainly because I don’t want to carefully read and follow all the steps). This time, I thought of creating a blog so that even if no one else uses it, it will help me in my specific machine environment.

  4. Yeah, follow that “add scopes” step because it’s important to allow Rclone to access the directory. In this case, Rclone is you.

  5. This whole guide is a mix of multiple sources—YouTube, Reddit, and even official docs. I carefully picked the laziest steps.

  6. Why use headless mode? I didn’t have XRDP or any RDP client installed, and neither do many others. Rclone’s default support for headless mode was kinda hard (maybe it just takes time to get used to), so I didn’t follow it. The SSH method? I didn’t try it, but it worked for my friend, and he said it’s good. So, good luck.

  7. If you face issues with mounting, just don’t mount. It’s mostly for syncing and checking storage space in Drive. If you just want to back up a few folders like me, skip it and follow the rest of the guide.

  8. I used both screen and tmux, and I found that tmux was the best for processing the bigger file upload in the background. Sure, you can do it directly, but in my case, it was over 2TB, so I had to run it in the background. Otherwise, just skip tmux and paste the command.

  9. IDK why there was a speed limit on a single file—might be something technical. If you find a solution, write me a well-documented guide and email me at im@surajmishra.co.in.

  10. I find it super lazy to attach screenshots, bro—hope you understand šŸ«°šŸ». You actually read all of this? Congrats, bro, you’re a real nerd with a great attention span. LOL!