cd ../blogs
doc4 min read

Mount AWS S3 as a Local Drive on Windows

A complete guide on how to easily mount your AWS S3 bucket as a local drive in Windows, persisting across reboots.

#aws#s3#windows#storage#automation#rclone

The Goal

Amazon S3 is fantastic for cheap, infinitely scalable cloud storage, but managing files through the AWS Console or the CLI isn't exactly intuitive for daily use. What if you could just open Windows File Explorer and drag-and-drop files directly into your S3 bucket exactly like you do with a local USB drive?

In this guide, we will use rclone (a command-line program to manage files on cloud storage) and WinFsp (Windows File System Proxy) to mount an S3 bucket as a native X: drive on Windows.


Prerequisites

Before we start configuring the connection, you'll need to download and install two lightweight tools:

  1. Install rclone: Download the zip file from the official rclone website and extract it to a directory of your choice (for example: C:\rclone).
  2. Install WinFsp: Download and install WinFsp. This acts as the backbone layer that allows rclone to create a virtual hard drive on Windows.

Step 1: Configure rclone with Your S3 Bucket

Now that the tools are installed, we need to tell rclone how to connect to our AWS account. Open your command prompt (cmd) and navigate to where you extracted rclone (like C:\rclone).

Run the configuration command:

rclone config

rclone will guide you through an interactive setup. Follow these steps:

  1. Choose n for a New remote.
  2. name: Name the remote whatever you like (e.g., myS3).
  3. Storage: Choose the storage type, type s3.
  4. provider: Choose AWS (usually option 1).
  5. Next, enter your required AWS details:
    • env_auth: Usually false (we will enter keys manually).
    • access_key_id: Enter your AWS Access Key ID.
    • secret_access_key: Enter your AWS Secret Access Key.
    • region: Enter your AWS Region (e.g., us-east-1).
  6. endpoint: Keep it empty if you are using standard AWS S3.
  7. Set any other advanced options as needed, or just press Enter to keep the defaults.
  8. After reviewing and completing the configuration, type q to quit the config menu.

Step 2: Mount the S3 Bucket

To avoid typing a long command every time you want to access your bucket, create a batch script.

Create a new text file inside your rclone directory (like C:\rclone\mount_s3.bat) so it can easily access the rclone.exe executable. Open it in Notepad, and paste the following line:

rclone.exe mount myS3:your-bucket-name X: --vfs-cache-mode full

Command Explanation:

  • rclone.exe mount : The core command telling rclone to mount a remote filesystem.
  • myS3:your-bucket-name : Make sure to replace myS3 with the name you gave your configuration remote in Step 1, and your-bucket-name with the exact name of your AWS S3 bucket.
  • X: : This is the drive letter you want to assign to the mounted bucket in Windows. Feel free to change it to Z:, S:, etc.
  • --vfs-cache-mode full : Crucial for reliability and performance! This enables local caching for reading and writing operations.

If you double-click this .bat file now, a command window will open, and your S3 bucket will instantly appear as your X: drive in File Explorer!


Step 3: Run it Silently on Startup

So when we mount the S3 bucket with the .bat file, it leaves a command prompt window open which is annoying. Let's mount it silently without seeing any CLI windows. Furthermore, you probably want this drive to be available every time you turn on or restart your PC. Let's automate the startup process.

Create a VBScript Launcher

Create a new text file named mount_s3_silent.vbs and add the following code:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "C:\rclone\mount_s3.bat", 0
Set WshShell = Nothing

(Make sure to update the path to point to the .bat file you created in Step 2).

Script Explanation:

  • CreateObject("WScript.Shell") : Creates a Windows scripting object that allows us to execute shell commands.
  • "C:\rclone\mount_s3.bat", 0 : Runs our batch script. The magic here is the 0 at the end. This tells Windows to execute the target file in a completely hidden window.
  • Set WshShell = Nothing : Cleans up memory after the command is launched.

Add to Windows Startup

To make the drive mount automatically when you turn on your computer:

  1. Press Win + R on your keyboard to open the Run dialog.
  2. Type shell:startup and hit Enter. This opens your Windows Startup folder.
  3. Move or copy your mount_s3_silent.vbs file into this folder.

Done! ✅

Your AWS S3 bucket is now deeply integrated into your Windows machine, acting exactly like a local hard drive, persisting across reboots, with zero visible background windows.