Google Drive Ocamlfuse provides an easy and free way to access your Google drive on Linux. It’s a FUSE file system for Google drive, written in OCaml. This tutorial is going to show you how to install Google Drive Ocamlfuse on Ubuntu 16.04, Linux Mint 18, Debian 8 Jessie and then mount your Google Drive. It’s doesn’t cost you a dime and it’s very easy to do.

Google Drive Ocamlfuse’s features includes:

  • Read and write access to ordinary files and folders
  • Read-only access to Google Docs, Sheets and Slides
  • Multiple account support
  • Duplicate file handling
  • Access to trash (.Trash directory)

Install Google Drive OCamlfuse on Ubuntu 16.04, Linux Mint 18

You can easily install Google drive Ocamlfuse on Ubuntu 16.04, Linux Mint 18 from official PPA. Fire up a terminal window (CTRL+ALT+T), then run the following commands to add the PPA, update local package index and install the application.

sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse

Install Google Drive Ocamlfuse on Ubuntu Once it’s installed, run the following command to authorize.


It will open a new tab in your browser asking you to grant it permission to view and manage the files in your Google Drive. ClickAllow.

google-drive-ocamlfuseNext, select your Google account and click Allow button.

google-drive-ocamlfuse-ubuntuThen in the terminal window, it will tell you the access token is retrieved correctly. Authorization is now complete.

Mount Your Google Drive

First, create a mount point for your Google Drive, such as ~/google-drive.

mkdir ~/google-drive

Then mount your Google drive using the following command:

google-drive-ocamlfuse ~/google-drive/

Now open your file manager, you will see a new tab on the left pane and your files in Google Drive will populate ~/google-drive/ folder.

mount-google-drive-linux-command-lineTo unmount Google drive, issue this command:

fusermount -u ~/google-drive

How to Compile Google Drive Ocamlfuse from Source on Debian 8

There’s no official deb package for Debian. But we can easily compile it from source. First, install OPAM package manager.

sudo apt install opam

Then install build dependencies.

sudo apt install m4 libcurl4-gnutls-dev libfuse-dev libsqlite3-dev zlib1g-dev libncurses5-dev pkg-config

Initialize OPAM state.

opam init

Update the list of available packages.

opam update

Compile and install Google Drive Ocamlfuse.

opam install google-drive-ocamlfuse

How to Use Google Drive Ocamlfuse to Back up Files on Ubuntu/Debian Server

First, ssh into your server and follow the above instructions to install Google Drive Ocamlfuse on the server. Note that on Ubuntu server, you need to install the software-properties-common package in order to add PPA.

sudo apt install software-properties-common

The authorization procedure is a little bit different because usually you don’t install GUI on Linux server.

Go to Google API console, Sign in with your Google account. Create a new project.

google-api-console-create-a-new-projectThen click Credentials on the left pane. Click Create Credentials and then select OAuth client ID.

google-api-console-oauth-client-idSelect other as the application type and give it a name.

google-api-console-create-client-idYou will get your client ID and client secret.

Next, Click Library on the left pane, then click Drive API under Google Apps API.

google-drive-apiClick Enable on the next page.

Now, back to your Linux server terminal, issue the following command. Replace the red text with your real client ID and client secret.

google-drive-ocamlfuse -headless -id your-client-id -secrect your-client-secret

You will be asked to open a URL in your browser. In the browser you will be asked to allow Google Drive Ocamlfuse to view and manage the files in your Google Drive.

google-drive-ocamlfuse-authenticationClick Allow, then copy the verification code and paste it to the terminal. You will see the following message.

Access token retrieved correctly.

Now make a directory as the mount point.

mkdir ~/google-drive-backup

And mount your Google drive on your server.

google-drive-ocamlfuse ~/google-drive-backup/

Cd into the directory and you will see your Google Drive files.