Mount AWS S3 bucket to your Debian

This is really nice to have as it can extend Linux file system with unlimited capacity for assets / logs / recorded call etc. The key is S3FS!

Ok, let’s get started.

  • Create bucket in S3 and IAM user with full S3 access;
  • Install dependencies;
  • Install S3FS;
  • Save access and secret key;
  • Mount bucket;
  • Profit!

The following dependencies you will need:

apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool pkg-config libssl-dev

Clone S3FS to your Linux FS:

git clone https://github.com/s3fs-fuse/s3fs-fuse

Change your directory and build the software:

cd s3fs-fuse/
./autogen.sh &&Ā ./configure --prefix=/usr --with-openssl &&Ā make &&Ā make install

Once done, create access data to your bucket:

touch ~/.passwd-s3fs

And now put your access and secret keys pair to this file in the following format: AWS Access Key ID:AWS Secret Access Key Now last thing is to mount:

mkdir /tmp/cache
chmod 777 /tmp/cache
mkdir /mnt/yourbucketname
s3fs -o use_cache=/tmp/cacheĀ yourbucketnameĀ /mnt/yourbucketname

Now you should be able to see uploaded files in your AWS Explorer or vice versa! Enjoy!

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy