Sometimes you just need to pull everything from an S3 bucket down to your local Linux environment. The quickest way is with the AWS CLI.
Step 1: Install and Configure AWS CLI
|
1 2 3 4 5 6 |
sudo apt install -y awscli # Debian/Ubuntu # or sudo yum install -y awscli # RHEL/CentOS aws configure |
Enter your AWS access key, secret key, region, and output format.
Step 2: Sync the Bucket
Use the sync command to copy all objects:
|
1 2 |
aws s3 sync s3://your-bucket-name /local/destination/path |
This will recursively download everything and preserve the folder structure.
Step 3: Useful Options
- Dry run (test first):
12aws s3 sync s3://your-bucket-name /local/path --dryrun - Delete files not in the bucket:
12aws s3 sync s3://your-bucket-name /local/path --delete - Force region:
12aws s3 sync s3://your-bucket-name /local/path --region us-east-1
That’s it! You’ve successfully cloned your S3 bucket to your Linux server.




