{"id":664,"date":"2016-07-05T12:27:27","date_gmt":"2016-07-05T06:57:27","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=664"},"modified":"2026-09-12T12:33:30","modified_gmt":"2026-09-12T07:03:30","slug":"s3fs-installation","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/s3fs-installation\/","title":{"rendered":"How to Mount an Amazon S3 Bucket as a Local File System Using s3fs"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">s3fs is a FUSE-based file system backed by Amazon S3. It allows you to mount an S3 bucket as a local file system so that you can read and write files using standard file system operations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the S3 bucket is mounted as a local file system, applications can access the bucket using normal file system commands instead of directly interacting with the S3 API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Linux server with root or sudo access.<\/li>\n\n\n\n<li>An active Amazon S3 bucket.<\/li>\n\n\n\n<li>AWS Access Key and Secret Key with the required permissions.<\/li>\n\n\n\n<li>Internet connectivity from the server.<\/li>\n\n\n\n<li>Sufficient permissions to install packages and kernel modules.<\/li>\n\n\n\n<li>A local directory to use as the S3 mount point<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n<p><span style=\"font-weight: 400;\">Install Dependencies:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">yum install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap util-linux<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Download fuse:<\/span><\/p>\n<p><code>wget http:\/\/sourceforge.net\/projects\/fuse\/files\/fuse-2.X\/2.9.4\/fuse-2.9.4.tar.gz<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: 400;\">Extract and install it:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">cd fuse-2.9.4<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">.\/configure --prefix=\/usr\/local<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">make<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">make install<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Add to loadable modules:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">ldconfig<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">modprobe fuse<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Download s3fs:<\/span><\/p>\n<p><code><\/code><code><span style=\"font-weight: 400;\">wget https:\/\/s3fs.googlecode.com\/files\/s3fs-1.74.tar.gz<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Extract and install it:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">tar -xzf s3fs-1.74.tar.gz<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">cd s3fs-1.74<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\">.\/configure --prefix=\/usr\/local<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\"> make<\/span><\/code><\/p>\n<p><code><span style=\"font-weight: 400;\"> make install<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Export the access key and secret key:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">echo AccessKey:Secretkey &gt; ~\/.passwd-s3fs<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Install fuse:<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">yum install libfuse,fuse-libs<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">Mount the bucket to a local directory.<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">s3fs -o allow_other -o use_cache=\/tmp\/cache\/ bucket-name\u00a0\/mnt\/<\/span><\/code><\/p>\n<p><span style=\"font-weight: 400;\">where,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/tmp\/cache &#8211; local cache directory.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bucket-name\u00a0&#8211; S3 bucket Name<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/mnt &#8211; Local Mount point<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Add a permanent entry in \/etc\/fstab<\/span><\/p>\n<p><code><span style=\"font-weight: 400;\">s3fs#bucket-name\u00a0\/cfmnt fuse allow_other,use_cache=\/tmp\/cache 0 0<\/span><\/code><\/p>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By following the above steps, you can install FUSE and s3fs and mount an Amazon S3 bucket as a local file system. Once mounted, the S3 bucket can be accessed through the specified local mount point using standard file system operations. Adding the entry to <code>\/etc\/fstab<\/code> also allows the bucket to be mounted automatically when the server starts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. What is s3fs?<\/strong><br>s3fs is a FUSE-based file system that allows you to mount an Amazon S3 bucket as a local file system on a Linux server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. How do you mount an S3 bucket using s3fs?<\/strong><br>Install and configure s3fs with AWS credentials, create a local mount point, and use the <code>s3fs<\/code> command to mount the S3 bucket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. How can you automatically mount an S3 bucket after reboot?<\/strong><br>Add the appropriate s3fs entry to <code>\/etc\/fstab<\/code> so the S3 bucket can be mounted automatically when the server starts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-create-an-aws-s3-bucket-using-terraform\/\">How to Create an AWS S3 Bucket Using Terraform<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-mount-amazon-s3-bucket-as-a-drive\/\">How to Mount Amazon S3 bucket as a Drive <\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business?. Our experts can help with\u00a0web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction s3fs is a FUSE-based file system backed by Amazon S3. It allows you to mount an S3 bucket as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[],"class_list":["post-664","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-aI","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=664"}],"version-history":[{"count":3,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions"}],"predecessor-version":[{"id":11703,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions\/11703"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}