![]() |
|
gdrive v3.9.1 - Linux Server Setup with Google API and OAuth Authentication - Printable Version +- DevOps Discussion Forum (https://forums.geekssolutions.io) +-- Forum: Cloud Computing (https://forums.geekssolutions.io/forumdisplay.php?fid=10) +--- Forum: DevOps (https://forums.geekssolutions.io/forumdisplay.php?fid=14) +--- Thread: gdrive v3.9.1 - Linux Server Setup with Google API and OAuth Authentication (/showthread.php?tid=10) |
gdrive v3.9.1 - Linux Server Setup with Google API and OAuth Authentication - santosh - 04-07-2026 gdrive v3.9.1 - Linux Server Setup with Google API and OAuth Authentication Overview This guide covers installing gdrive v3.9.1 on a Linux server, enabling the Google Drive API, configuring OAuth, and authenticating on a headless server. Prerequisites
Step 0 - Download and Install gdrive Binary Run on: Linux Server Download for x64: Code: wget https://github.com/glotlabs/gdrive/releases/download/3.9.1/gdrive_linux-x64.tar.gzFor ARM64 servers use: Code: wget https://github.com/glotlabs/gdrive/releases/download/3.9.1/gdrive_linux-arm64.tar.gzVerify the tarball: Code: file gdrive_linux-x64.tar.gzExtract and install: Code: tar -xzf gdrive_linux-x64.tar.gzConfirm installation: Code: gdrive versionStep 1 - Enable Google Drive API Run on: Google Cloud Console (one-time setup)
Step 2 - Configure OAuth Consent Screen Run on: Google Cloud Console
Step 3 - Create OAuth Client Run on: Google Cloud Console
Step 4 - Authenticate gdrive on Headless Linux Server Option A - SSH Port Forward (Recommended) Run on: Your local laptop first, then server On your local laptop open a terminal and run: Code: ssh -N -L 8085:127.0.0.1:8085 root@YOUR_SERVER_IPKeep this terminal open. Then open a new SSH session to your server: Code: gdrive account addPaste your Desktop Client ID and Secret when prompted. Copy the Google URL that is printed and open it in your laptop browser. Sign in as a Test user and click Allow. Google will redirect to http://127.0.0.1:8085 and the SSH tunnel will forward it back to the server completing the auth. Verify on the server: Code: gdrive account listOption B - Export Token from Laptop and Import to Server Run on: Your local laptop first, then server On your laptop: Code: gdrive account addCopy token to server: [c |