Overview#
This is a memo for using gdrive in a LAMP environment launched on Amazon Lightsail. This enables file backups to Google Drive, among other things.
Steps#
First, access Amazon Lightsail and press the “Connect using SSH” button on the target instance.

You can access the server as shown below.
Installing golang#
Install golang as follows.
You can verify the version as follows.
Installing gdrive#
Run the following.
You can verify the version as follows.
Authentication#
When you run the following, a URL is displayed.
After pasting the obtained authentication code, the following is displayed.
For example, running the following lists the files on Google Drive.
Summary#
This summarizes the method for using gdrive in a LAMP environment launched on Amazon Lightsail.
You can check gdrive usage at the link below. I hope this is helpful for use cases such as file backups.
https://github.com/prasmussen/gdrive#usage