The first thing to do, is to make sure that your Ubuntu system is up to date, type:
$ sudo apt-get update && sudo apt-get -y upgrade
Then, download and install the python pip that is required to install the AWS cli, type:
$ sudo apt-get install python-pip
When the download finishes, you are ready to download and install the AWS cli, type:
$ pip install awscli
When the installation is finished, it’s time to configure your AWS cli, type:
$ aws configure
Configuration:
AWS Access Key ID: <Your AWS Access Key ID>
AWS Secret Access Key: <Your AWS Secret Access key>
Default region Name : <eu-central-1>
Default output format: None
Having finished the configuration, you are ready to download your S3 bucket with the following command:
$ aws s3 sync s3:/BUCKET_NAME .
- replace BUCKET_NAME with the actual name of the S3 bucket to download
- don't forget the .
Your console output should be similar
[..]
download: s3://BUCKET_NAME/uploads/photo_attachment/file_name/138/administration_tiny_post.jpg to uploads/photo_attachment/file_name/138/administration_tiny_post.jpg
download: s3://BUCKET_NAME/uploads/photo_attachment/file_name/138/administration_thumb_post.jpg to uploads/photo_attachment/file_name/138/administration_thumb_post.jpg
[..]
Commands extracted from how to download your S3 bucket locally using the AWS cli