1. Home
  2. Docs
  3. Cloud Archiving
  4. Cloud Storage Configurati...
  5. Google drive

Google drive

Configuring Rclone with Google Drive

Set up a project in Google Cloud Console
Go to the Google Cloud Console.
Create a new project or select an existing one.
Project Name: Give it a name (e.g., “Rclone Google Drive”).
Enable the Google Drive API:
Navigate to APIs & Services > Library.
Search for Google Drive API and click Enable.

Set up API credentials
Go to APIs & Services > Credentials.
Create credentials:
Click Create Credentials and select OAuth 2.0 Client ID.
Configure the consent screen:
Fill in the required fields (application name, support email, etc.).
Select the application type:
Choose Desktop App and click Create.
Save the Client ID and Client Secret.

Manual token configuration
Start the Rclone configuration:

rclone config

Add a new remote:                                                                                                                   
    Select n to create a new remote and give it a name, e.g., gdrive.                                                               
Select the type of remote:                                                                                                          
    Choose Google Drive.                                                                                                            
Enter the Client ID and Client Secret:                                                                                              
    Enter your credentials or leave them blank to use the default Rclone values.                                                    
Choose the scope:                                                                                                                   
    Select Full access (recommended for full access to your Google Drive).                                                          
Generate the token:                                                                                                                 
    If you have access to a browser, follow the instructions to authenticate.                                                       
    If not, Rclone will provide a link that you can open on another device. Copy the generated code back into the terminal.         

Manual configuration file

If you want to configure manually, edit the Rclone configuration file:                                                              

    vim ~/.config/rclone/rclone.conf

Add the following:                                                                                                                      
                                                                                                                                        
    [rclone]                                                                                                                            
    type = drive                                                                                                                        
    client_id = <your_client_id>                                                                                                        
    client_secret = <your_client_secret>                                                                                                
    scope = drive                                                                                                                       
    token = {"access_token":"<your_access_token>","token_type":"Bearer","expiry":"2024-01-01T00:00:00Z"}                                
                                                                                                                                        Test the configuration                                                                                                                  
                                                                                                                                        
    Run the following command to verify:                                                                                                
                                                                                                                                        
rclone lsd rclone:                                                                                                                      
                                                                                                                                        
This command will list the top-level directories in your Google Drive.

How can we help?