Overview
Memorandum for using gdrive in a LAMP environment started with Amazon Lightsail, allowing backup of files to Google Drive, etc.
Procedure
First, access Amazon Lightsail and press the following “Connect using SSH” button on the target instance.

You can access the server as follows.
Install golang
Install golang as follows.
You can check the version as follows.
bitnami@ip-172-26-1-210:~$ go version
go version go1.11.6 linux/amd64
Install gdrive
Execute the following.
You can check the version as follows.
bitnami@ip-172-26-1-210:~$ . /go/bin/gdrive version
gdrive: 2.1.1
Golang: go1.11.6
OS/Arch: linux/amd64
Authentication
Run the following to get the URL.
bitnami@ip-172-26-1-210:~$ . /go/bin/gdrive about
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=...
Enter verification code:
Paste the verification code you got and you should see something like this
For example, the following will list the files on Google Drive.
Summary
This is a summary of how to use gdrive in a LAMP environment started with Amazon Lightsail.
The usage of gdrive can be found below. We hope you find it useful, for example, for backing up your files.