Google Drive client_id for rclone, headless server setup
This is the short reference I keep for setting up an rclone Google Drive client ID on a headless Ubuntu server. It follows the rclone Drive docs on making your own client ID, plus the details I tripped over.
Because the default rclone Google Drive client_id is shared by many users, it can hit Google rate limits more easily. For a more stable setup, create your own Google OAuth app and use its client_id and client_secret in rclone.
Why this matters
Better reliability than the shared default rclone client
Lower chance of quota and rate-limit issues
Better for production and multiple services
What I had to create
When creating the Google OAuth app, I had to choose:
Application type:Desktop app
This is correct for rclone authentication, even if the final usage is on a headless Ubuntu server.
Steps
Open the Google API Console and create or select a project.
Put them into your rclone Google Drive remote config.
Reconnect/authenticate the remote.
Notes
Even on a headless server, the OAuth client type should still be Desktop app.
Google may show an unverified app warning during login. That is expected for a personal setup.
For External apps, adding yourself as a test user is important.
Useful rclone command
To reconnect the remote after adding your own credentials:
bash
rclone config reconnect hetzner-dev:
Result
After reconnecting, I was able to download files from Google Drive directly to:
bash
~/smow/db_dumps
Keep the token from expiring after 7 days
If the consent screen stays in Testing, Google expires the refresh token after 7 days, and your scheduled syncs start failing with auth errors. For a personal setup, set the publishing status to In production. The app stays unverified, so you still see the warning at login, but the token no longer expires weekly. Then run rclone config reconnect once more.
What to do next
This setup is the Drive half of a few bigger workflows I run:
Authorizing Google APIs from a terminal works the same way in the Google Ads MCP setup guide, which also uses a Desktop app OAuth client.