- s3fs allows Linux, macOS, and FreeBSD to mount an S3 bucket via FUSE(Filesystem in Userspace).s3fs makes you operate files and directories in S3 bucket like a local file system.s3fs preserves the native object format for files, allowing use of other tools like AWS CLI.
# Setup with S3

Install s3fs-fuse:
| |
Create credentials file (optional if using environment variables):
| |
Mount the sspaeti bucket:
| |
Unmount when done:
| |
Important Notes:
- Use home directory (
~/) to avoid needing sudo - mounting to /mnt/ or other system directories requires root permissionsSpecify the correct endpoint - use endpoint=eu-central-1 for EU buckets, endpoint=us-west-2 for US West, etc.If your AWS credentials are already in environment variables, s3fs-fuse will pick them up automatically without needing the .passwd-s3fs fileWhen using sudo, the ~ path doesn’t expand correctly - use full paths like /home/$(whoami)/AWS S3 setup see AWS S3.
# Create persistent Mounts
Above solution is gone after reboot, if you want persistence, we need to use fstab.
| |
Above credentials still need to be created or are been used here - check if they exist:
| |
Edit fstab config with sudo nvim /etc/fstab and add e.g. for my synology (Adding Network Drive - NAS Synology) and S3 drive the following configs:
| |
Enable allow_other for s3fs with:
Edit fuse config sudo nvim /etc/fuse.conf
| |
What does
user_allow_otherdo?The
user_allow_othersetting in/etc/fuse.confallows non-root users to use theallow_othermount option with FUSE filesystems. By default, FUSE mounts are only accessible by the user who mounted them.allow_othermakes the mount accessible to all users on the system
Single user system? You don’t need
allow_otherIf you’re the only user on your system, you can skip the
allow_otheroption and the fuse.conf change for better security.Check your user ID with:
12id -u # Should return 1000id -g # Should return 1000If your uid/gid match what’s in the fstab entry (1000), simply remove
allow_otherfrom the s3fs line:
1sspaeti /mnt/s3/sspaeti fuse.s3fs _netdev,use_path_request_style,url=https://s3.eu-central-1.amazonaws.com,endpoint=eu-central-1,uid=1000,gid=1000,passwd_file=/home/sspaeti/.passwd-s3fs 0 0And keep
user_allow_othercommented in/etc/fuse.conf. The mount will still work perfectly and be more secure.
# Test the mounts without rebooting
| |
Origin: stu
References: On MacOS see Mounting Amazon S3 as a File System, Adding Network Drive - NAS Synology
Created 2025-09-19
