Skip to content

S3FS: Mounting Amazon S3 Buckets on Ubuntu & Debian Systems

A Beginner's Guide to Mounting Amazon S3 Buckets on Debian Systems using S3FS. How to Access Amazon S3 Using S3FS to Mount S3 Buckets

Steps
5
Covers
AWS, Debian, Disk Management
On this page 5 steps

Amazon S3 is a highly scalable and durable object storage service that allows you to store and retrieve any amount of data from anywhere on the web. S3FS is a FUSE (Filesystem in Userspace) interface for Amazon S3 that allows you to mount Amazon S3 buckets as a local file system on your Debian system. This allows you to easily access and manipulate your S3 data as if it were stored on a local file system. In this article, we’ll show you how to mount an Amazon S3 bucket on a Debian system using S3FS.

Before we begin, make sure that you have the following:

  1. An Amazon S3 account with at least one bucket created
  2. An access key and secret key with access to your S3 bucket
  3. A Debian system with root access
  4. S3FS installed on your system

Here’s the step-by-step guide to mounting an Amazon S3 bucket on a Debian system using S3FS:

Step 1 of 5Install S3FS

First of all, install the s3fs package on your system. That is available in the default system repositories. To install this package type:

sudo apt update 
sudo apt install s3fs 

This command installs S3FS on your Debian system.

Step 2 of 5Create a directory to mount the S3 bucket

Now, create a directory to mount the s3 bucket. You can also use an existing directory.

sudo mkdir /mnt/s3-mount 

This creates a directory where the S3 bucket will be mounted. You can choose a different directory name as desired.

Modify the permissions for the mount directory:

sudo chmod 777 /mnt/s3-mount 

This sets the permissions for the mount directory to allow read/write access for all users.

Step 3 of 5Create Credentials File

Create a password file to store your access and secret keys. You can generate key pair in your Amazon web services account.

echo ACCESS_KEY:SECRET_KEY > ~/.passwd-s3fs 
sudo chmod 600 ~/.passwd-s3fs 

Replace ACCESS_KEY and SECRET_KEY with your actual Amazon S3 access and secret keys. This file stores your access and secret keys securely, and the permissions are set to prevent unauthorized access.

Step 4 of 5Mounting the S3 bucket

Finally, use s3fs command line tool to mount your s3 bucket.

sudo s3fs BUCKET_NAME /mnt/s3-mount -o passwd_file=~/.passwd-s3fs 

Replace the “BUCKET_NAME” with the actual name of your Amazon S3 bucket. This command mounts the S3 bucket at the specified mount directory.

Step 5 of 5Verify It

To verify that s3 bucket is successfully mounted, execute:

sudo df -h 

This command displays the disk usage and mounted file systems on your system. If the S3 bucket is successfully mounted, you should see the mount directory listed with its corresponding S3 bucket name.

Mounting S3 Buckets on Ubuntu & Debian
Mounting Amazon S3 Bucket

That’s it! You have now successfully mounted an Amazon S3 bucket on your Debian system using S3FS. You can now access and manipulate the data in your S3 bucket as if it were stored on a local file system.

Conclusion

In conclusion, mounting an Amazon S3 bucket on a Debian system using S3FS is a simple and effective way to access your S3 data. With S3FS, you can easily access and manipulate your S3 data as if it were stored on a local file system, making it easier to work with your S3 data in your Debian environment.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top