← Back to Dashboard
Cloud Storage

Setting Up Rclone S3 Mount on Linux

A comprehensive guide to install, configure, and automate S3 bucket mounts using Rclone and Systemd for user suraj.

1. Installation

Install the latest version of rclone directly from the official source:

curl https://rclone.org/install.sh | sudo bash

2. Configuration

Run the interactive setup to connect to the Datahub S3 storage:

rclone config

Follow these specific prompts during the setup:

3. Prepare the Mount Point

Create the local directory where the S3 bucket will appear:

mkdir -p "/home/suraj/Datahub S3"

4. Setup Persistence (Systemd)

To ensure the drive mounts automatically on boot/login, create a systemd user service.

First, create the service directory and the file:

mkdir -p ~/.config/systemd/user/
nano ~/.config/systemd/user/rclone-datahub.service

Paste the following configuration into the file:

[Unit]
Description=RClone Mount Datahub S3

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount datahub:suraj "/home/suraj/Datahub S3" \
  --config=%h/.config/rclone/rclone.conf \
  --vfs-cache-mode writes
ExecStop=/bin/fusermount -u "/home/suraj/Datahub S3"
Restart=on-failure

[Install]
WantedBy=default.target

        

5. Enable and Start

Activate the automation using the following commands:

# Reload the manager to recognize the new file
systemctl --user daemon-reload

# Enable the service to start at login
systemctl --user enable rclone-datahub.service

# Start the mount immediately
systemctl --user start rclone-datahub.service

6. Verification

Check if the mount is active and running correctly:

systemctl --user status rclone-datahub.service

Key Commands for Management

Action Command
Stop Mount systemctl --user stop rclone-datahub.service
Restart Mount systemctl --user restart rclone-datahub.service
View Logs journalctl --user -u rclone-datahub.service -f