Install Google Drive Ocamlfuse on Ubuntu 16.04, Linux Mint 18, Debian 8

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.

google-drive-ocamlfuse

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. Click Allow.

google-drive-ocamlfuse

Next, select your Google account and click Allow button.

google-drive-ocamlfuse-ubuntu

Then 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-line

To 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-project

Then click Credentials on the left pane. Click Create Credentials and then select OAuth client ID.

google-api-console-oauth-client-id

Select other as the application type and give it a name.

google-api-console-create-client-id

You 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-api

Click 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-authentication

Click 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.

That’s it! I hope this article helped you mount Google Drive on your Ubuntu 16.04, Linux Mint 18 or Debian 8 machine. As always, if you found this post useful, then subscribe to our free newsletter or follow us on Google+, Twitter or like our Facebook page. Thanks for visiting!

Rate this tutorial
[Total: 16 Average: 4.8]

5 Responses to “Install Google Drive Ocamlfuse on Ubuntu 16.04, Linux Mint 18, Debian 8

  • Andy Freuler
    2 years ago

    Hi,
    whatsb are the steps for a second drive account?
    this command not working for a second time: google-drive-ocamlfuse
    Thanks

  • Gabriel Sauceda
    1 month ago

    Works very well on ubuntu 16.04, first tried using nautilus online-accounts but this one is better response much faster.

    • Gabriel Sauceda
      1 month ago

      putting the command : “google-drive-ocamlfuse ~/google-drive/ ” on startup applications didn’t work for me, so every time i have to run it manually

  • Станислав Владимирович
    1 month ago

    Откровенно говоря раздражает когда разработчики предполагают что юзеры такие же мегалинуксоиды и кодеры как они.
    Я столкнулся с проблемой что у меня как и у многих при первом запуске не открывался браузер для аутентификации и соответственно получения токена.
    Вопрос задавался неоднократно на разных площадках но автор везде советовал скопировать url которым приложение посылает запрос из лога приложения gdfuse.log в ~/.gdfuse/default/ и вставить его в браузер ручками. Цитирую: “Your should restart it with -debug, then check gdfuse.log and curl.log (in ~/.gdfuse/default/) to see what kind of error you are getting (it looks like you cannot access the authorization endpoint).”
    Есть одно но: для того чтобы лог писался сначала нужно прописать адрес папки в котором он находиться в конфиге программы (например log_directory=/home/stas/.gdfuse/default), причем обязательно абсолютный.
    Токен получил, но все равно сейчас мучаюсь чтобы понять как заставить работать в приложении вот эту строчку xdg-open (https и далее юрл запроса). Пробую увеличивать таймауты, результат пока нулевой.

  • Michael Ossing
    1 month ago

    Get this on Linux Mint 18.2:

    W: GPG error: https://dl.bintray.com/resin-io/debian stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 379CE192D401AB61
    E: The repository ‘https://dl.bintray.com/resin-io/debian stable Release’ is not signed.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.

    Don’t think I’ve had a problem with with a public key before, so suggestions for resolution would be appreciated.

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • * Some of my previous answers are lost after I uninstalled Disqus comment system from my website. I try to recover those answers whenever I can.