{"id":114,"date":"2026-07-16T22:43:39","date_gmt":"2026-07-16T20:43:39","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/?p=114"},"modified":"2026-07-05T23:30:22","modified_gmt":"2026-07-05T21:30:22","slug":"how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way","status":"publish","type":"post","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/","title":{"rendered":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Backing up your remote server (like a Raspberry Pi) directly to Google Drive is a brilliant way to ensure data safety. The tool for the job is <strong>Rclone<\/strong> \u2013 the &#8220;Swiss Army knife&#8221; of cloud storage. However, setting it up on a &#8220;headless&#8221; server (a machine without a graphical interface or web browser) can be tricky, especially when dealing with Google&#8217;s authentication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will walk you through the bulletproof method: creating your own Google Cloud Platform (GCP) project to avoid rate limits, authorizing on your local machine, and moving the configuration to your server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 1: Creating Your GCP Project (Avoiding Rate Limits)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Using Rclone&#8217;s default Google Drive client ID means sharing bandwidth with thousands of other users, leading to throttling. Here is how to create your own:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Create a Project:<\/strong> Go to the <a href=\"https:\/\/console.cloud.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Cloud Console<\/a>, click the project dropdown, and select <strong>New Project<\/strong>. Name it something like &#8220;Rclone Backup&#8221;.<\/li>\n\n\n\n<li><strong>Enable the API:<\/strong> Search for <strong>Google Drive API<\/strong> in the top search bar and click <strong>Enable<\/strong>.<\/li>\n\n\n\n<li><strong>Configure OAuth Consent Screen:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Go to <strong>APIs &amp; Services > OAuth consent screen<\/strong>.<\/li>\n\n\n\n<li>Choose <strong>External<\/strong> user type.<\/li>\n\n\n\n<li>Fill in the mandatory fields (App name, email addresses).<\/li>\n\n\n\n<li>Under &#8220;Scopes&#8221;, add <code>...\/auth\/drive<\/code> to give Rclone full access to manage files.<\/li>\n\n\n\n<li>Under &#8220;Test users&#8221;, add your own Google account email.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Generate Credentials:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Go to the <strong>Credentials<\/strong> tab.<\/li>\n\n\n\n<li>Click <strong>Create Credentials > OAuth client ID<\/strong>.<\/li>\n\n\n\n<li><strong>Crucial step:<\/strong> Choose <strong>Desktop app<\/strong> as the application type. This prevents issues with redirect URLs later.<\/li>\n\n\n\n<li>Click <strong>Create<\/strong>. Copy your <strong>Client ID<\/strong> and <strong>Client Secret<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 2: Local Authorization<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since your server doesn&#8217;t have a web browser, we will generate the access token on your main computer (Windows\/Mac\/Linux).<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Install Rclone on your local computer.<\/li>\n\n\n\n<li>Open a terminal and type <code>rclone config<\/code>.<\/li>\n\n\n\n<li>Press <code>n<\/code> for a new remote and name it (e.g., <code>gdrive<\/code>).<\/li>\n\n\n\n<li>Choose <code>drive<\/code> as the storage type.<\/li>\n\n\n\n<li>Paste your <strong>Client ID<\/strong> and <strong>Client Secret<\/strong> when prompted.<\/li>\n\n\n\n<li>When asked <code>Use auto config?<\/code>, type <code>y<\/code> (Yes).<\/li>\n\n\n\n<li>Your browser will open. Log in and grant permission.<\/li>\n\n\n\n<li>Back in the terminal, you will see a block of JSON code containing your token. <strong>Copy this entire token block.<\/strong><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 3: Server Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s move to your headless server (via SSH).<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Install Rclone on your server (<code>sudo apt install rclone<\/code>).<\/li>\n\n\n\n<li>Run <code>rclone config<\/code>.<\/li>\n\n\n\n<li>Create a new remote (<code>n<\/code>), name it exactly as you did locally (<code>gdrive<\/code>), choose <code>drive<\/code>, and paste your Client ID and Secret.<\/li>\n\n\n\n<li>When asked <code>Use auto config?<\/code>, type <code>n<\/code> (No).<\/li>\n\n\n\n<li>When prompted for the result\/token, <strong>paste the JSON block<\/strong> you copied from your local machine.<\/li>\n\n\n\n<li>Save and exit. Test it by typing <code>rclone lsd gdrive:<\/code>. You should see your Google Drive folders!<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 4: Automating Backups<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now that Rclone is authorized, let&#8217;s set up an automated backup script. Create a file named <code>backup.sh<\/code>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nBACKUP_DIR=\"\/path\/to\/local\/backup\"\nDATE=$(date +%Y-%m-%d)\nREMOTE=\"gdrive:ServerBackups\"\n\n# Your backup commands here (e.g., mysqldump, tar)\ntar -czf \"$BACKUP_DIR\/data_$DATE.tar.gz\" \/var\/www\/html\n\n# Copy to Google Drive (Rclone creates the folder automatically)\nrclone copy \"$BACKUP_DIR\/data_$DATE.tar.gz\" \"$REMOTE\"\n\n# Keep only the last 7 days of backups on Google Drive\nrclone delete \"$REMOTE\" --min-age 7d\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make the script executable (<code>chmod +x backup.sh<\/code>) and add it to your cron jobs (<code>crontab -e<\/code>) to run nightly. Your headless server is now securely backed up to the cloud!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backing up your remote server (like a Raspberry Pi) directly to Google Drive is a brilliant way to ensure data safety. The tool for the job is Rclone \u2013 the &#8220;Swiss Army knife&#8221; of cloud storage. However, setting it up on a &#8220;headless&#8221; server (a machine without a graphical interface or web browser) can be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-it-networks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog\" \/>\n<meta property=\"og:description\" content=\"Backing up your remote server (like a Raspberry Pi) directly to Google Drive is a brilliant way to ensure data safety. The tool for the job is Rclone \u2013 the &#8220;Swiss Army knife&#8221; of cloud storage. However, setting it up on a &#8220;headless&#8221; server (a machine without a graphical interface or web browser) can be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-16T20:43:39+00:00\" \/>\n<meta name=\"author\" content=\"luky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"luky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/\"},\"author\":{\"name\":\"luky\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"headline\":\"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way)\",\"datePublished\":\"2026-07-16T20:43:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/\"},\"wordCount\":479,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"articleSection\":[\"IT &amp; Networks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/\",\"name\":\"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-07-16T20:43:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"luky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"luky\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/author\\\/luky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog","og_description":"Backing up your remote server (like a Raspberry Pi) directly to Google Drive is a brilliant way to ensure data safety. The tool for the job is Rclone \u2013 the &#8220;Swiss Army knife&#8221; of cloud storage. However, setting it up on a &#8220;headless&#8221; server (a machine without a graphical interface or web browser) can be [&hellip;]","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/","og_site_name":"Lukas Wojcik - Blog","article_published_time":"2026-07-16T20:43:39+00:00","author":"luky","twitter_card":"summary_large_image","twitter_misc":{"Written by":"luky","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/#article","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/"},"author":{"name":"luky","@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"headline":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way)","datePublished":"2026-07-16T20:43:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/"},"wordCount":479,"commentCount":0,"publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"articleSection":["IT &amp; Networks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/","name":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way) - Lukas Wojcik - Blog","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"datePublished":"2026-07-16T20:43:39+00:00","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/how-to-set-up-rclone-with-google-drive-on-a-headless-server-the-right-way\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Set Up Rclone with Google Drive on a Headless Server (The Right Way)"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"luky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"luky"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"],"url":"https:\/\/www.lukaswojcik.com\/blog\/author\/luky\/"}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":1,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions\/115"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}