Tutorial: Mounting Google Drive on Debian 12 with rclone

Prerequisites

  • A Debian 12 system with root access.
  • An internet connection.
  • It is smart to obtain your own api from google for this(client ID and secret key) Separate tutorial here

Step 1: Install rclone

Update the package list:

sudo apt update

  1. Install rclone:

sudo apt install rclone

Step 2: Configure rclone for Google Drive

  1. Run the rclone configuration:

rclone config

  1. Follow the prompts:
  • Choose n for a new remote.
  • Name it (e.g., gdrive).
  • Select drive for Google Drive as the storage type.
  • Follow the authentication steps. This usually involves copying a URL to your browser, logging into your Google account, and getting an authentication token. Paste this token back into the terminal(if installing on a headless machine like Debian you will need access to another machine with a browser that is running the same version as rclone).
  • Almost all other options are default or left blank, there will be a config question that will be set to no on headless machines and yes on machines with browsers.
  1. Finish the configuration and exit when done.

Step 3:Enable & install Fuse

Enable Fuse in the Container: (Run this command on your Proxmox host):

pct set <container-id> -features fuse=1

  1. Restart the Container: After setting the fuse feature, restart the container:

pct restart <container-id>

  1. Go back to container running rclone

  1. Install fuse:

apt update
apt
install fuse

Step 4: Create a Mount Point

  1. Create a directory for mounting Google Drive:

sudo mkdir /mnt/gdrive

  1. Set permissions (optional, if you want other users to access it):

sudo chmod 755 /mnt/gdrive

Step 4: Mount Google Drive

  1. Run the mount command:

rclone mount gdrive: /mnt/gdrive --daemon --allow-other --vfs-cache-mode writes

  • The --allow-other flag allows other users to access the mounted drive.

Step 5: Create a Systemd Service for Auto-Mounting(not sure if this works yet)

  1. Create a systemd service file:

sudo nano /etc/systemd/system/rclone-gdrive.service

  1. Add the following content to the file:

[Unit]
Description=Mount Google Drive using rclone
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount gdrive: /mnt/gdrive \
       
--config=/root/.config/rclone/rclone.conf \
       --vfs-cache-mode writes \
       --allow-other
ExecStop=/bin/fusermount -u /mnt/gdrive
Restart=on-failure

[Install]
WantedBy=multi-user.target

3. Enable and start the service:

sudo systemctl enable rclone-gdrive
sudo systemctl
start rclone-gdrive

Step 6: Install and Configure Samba for Network Sharing

  1. Install Samba:

sudo apt install samba

  1. Edit the Samba configuration file:

sudo nano /etc/samba/smb.conf

  1. Add the following section to share the Google Drive mount(at the bottom):

[GoogleDrive]
path = /mnt/gdrive
browseable =
yes
read only =
no
guest ok =
yes
force
 user = root

  1. Restart Samba to apply changes:

sudo systemctl restart smbd

Step 7: Access Google Drive Over the Network

Now, you can access your Google Drive from other devices on your network. Use the following format to connect:

On Windows, open File Explorer and use the address:

\\<server-ip>\GoogleDrive

  • On Linux, you can use a file manager to browse to smb://<server-ip>/GoogleDrive.
  • On windows: Go to this pc; right click; add a network location; this will add the drive as a folder for easy access.

Things to note:

This method does allow anyone on the network to access this file system, however they would need the local IP address and need to know how to access it to get in.

There are ways to secure this, by adding credentials and encrypting just have not tested yet.

This guide just covers GoogleDrive but the process should be similar for almost any cloud provider.

https://rclone.org/drive/