How to Access Amazon S3 Bucket like a Local File System
Access Amazon S3 Bucket like a Local File System using Mountpoint for Amazon S3.
Published Feb 9, 2024
Mountpoint for Amazon S3 is now generally available and ready for production workloads. This open-source simple file client is optimized for read-heavy workloads that require high throughput and focused on high-performance access to large data sets.
In this post, we'll see how to effortlessly access an S3 bucket as a local file system by leveraging Mountpoint for Amazon S3.
Based on your Linux distributions and hardware-platform architecture, download prebuilt packages.
I am using the Ubuntu distro of Windows Subsystem for Linux (WSL2) running on x86_64 architecture. So, I'll download DEB-based distributions for x86_64.
RPM-based distributions (Amazon Linux, Fedora, CentOS, RHEL):
x86_64https://s3.amazonaws.com/mountpoint-s3-release/latest/x86_64/mount-s3.rpmARM64 (Graviton)https://s3.amazonaws.com/mountpoint-s3-release/latest/arm64/mount-s3.rpm
DEB-based distributions (Debian, Ubuntu):
x86_64https://s3.amazonaws.com/mountpoint-s3-release/latest/x86_64/mount-s3.debARM64 (Graviton)https://s3.amazonaws.com/mountpoint-s3-release/latest/arm64/mount-s3.deb
Other distributions:
x86_64https://s3.amazonaws.com/mountpoint-s3-release/latest/x86_64/mount-s3.tar.gzARM64 (Graviton)https://s3.amazonaws.com/mountpoint-s3-release/latest/arm64/mount-s3.tar.gz
Install the downloaded Mountpoint for Amazon S3 package.
To make sure the installation was successful, please check the version.
Mountpoint for Amazon S3 uses the same credentials configuration options as the AWS CLI. So, either use
aws configure
AWS CLI to create the credential file or create it manually.or,
Create
~/.aws/credentials
file and add aws_access_key_id
and aws_secret_access_key
.Sample
~/.aws/credentials
contentNow create a local directory (e.g.
~/local-dir
) and mount it with an S3 bucket (e.g. aj-mounts3-bucket
).Now, we are good to access the S3 bucket as a local file system using different file operations.
Let's create a few files and a directory inside the mounted local directory.
Refresh S3 bucket. And we'll see the exact same files and directories in the S3 bucket as objects.