How to sync Google Drive on Linux with Docker

How to sync Google Drive on Linux with Docker

This is an quick and easy docker based solution to backup your data and sync it to the Google Drive.

It will be useful for small and medium on Linux hosted websites.

Technologies used:

System Requirements:

  • Linux OS with Docker v17+


  • Clone repository from Github anywhere to your server.
    git clone
    You will have two files: Dockerfile and
  • In console run ./
    It runs following steps:
    • create /Backup/GoogleDrive - Google Drive dir
    • create /Backup/conf - configs and credentials to the googledrive account
    • build of Docker Image
    • first run of DriveSync script

Please watch out to the output in console:

DriveSync will ask open an long url in browser to grant access to your Google Drive. Copy this long url and open in browser, acceppt access, copy code-response and paste it back to the console.

Done! You have grant access and made first synchronization. All entry of /Backup/GoogleDrive will be syncroniezed with Google Drive.

You can set cronjob to run ./ every day. For example:

0 0 * * *  /bin/sh   /path_to_script/ #divesync everyday at 00:00

What will be backed up to the /Backup/GoogleDrive directory - on yours decision.

You can take example of "How to backup database" and "How to backup site" from next article.


Visit our blog

On sale