Install Google Drive Ocamlfuse on Debian, Ubuntu, Linux Mint

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 the OCaml programming language. This tutorial is going to show you how to install Google Drive Ocamlfuse on Debian, Ubuntu, Linux Mint 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 include:

  • 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, Linux Mint

You can easily install Google drive Ocamlfuse on Ubuntu and Linux Mint from the official PPA. Fire up a terminal window (CTRL+ALT+T), then run the following commands to add the PPA, update the 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

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 Debian, Ubuntu, or Linux Mint box. As always, if you found this post useful, then subscribe to our free newsletter or follow us on Twitter or like our Facebook page. Thanks for visiting!

Rate this tutorial
[Total: 18 Average: 4.9]

11 Responses to “Install Google Drive Ocamlfuse on Debian, Ubuntu, Linux Mint

  • Andy Freuler
    8 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
    5 months ago

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

    • Gabriel Sauceda
      5 months 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

  • Станислав Владимирович
    5 months 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
    5 months 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.

  • Don Hirst
    4 years ago

    Does this interface support permanent deletion of files in .Trash via the BASH shell script rm function? Thanks.

  • how do you mount only via command line on a server without a graphical interface?

  • Heinz L.
    3 years ago

    MX 21_AHS, Kernel 5.10.0-10 works fine. script works error-free.
    On my old machine it took very long to compile.
    After Install works great and fast. THX 4 Good work.

  • Hello,i use linux mint mate,but this not working,nothing happend.
    Best regards from Slovenia

  • Command google-drive-ocamlfuse doesn’t open browser with permissions request.
    The answer is: “Error: You should specify a client id (-id) and a client secret (-secret)”

  • 2024/10/05 – This guide is very out of date. Google API and OPAM both seem to have changed significantly.

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.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here