In this tutorial, we will learn about 3 ways to install s3cmd in Ubuntu server 20.04 in 3 minutes. S3cmd command-line tool to manage the AWS S3 Objects.
Objects like Creating S3 buckets, uploading, retrieving, and deleting the AWS S3 objects.
After installation, let’s set up the s3cmd command line with the –configure option.
So there are many ways to install the s3cmd command line on the Ubuntu server but we will look the most 3 popular ways.
- Install S3cmd via an apt command.
- Second, Install S3cmd via dpkg command.
- Third, Install S3cmd via source code

Install S3cmd tool via an apt command Line
In Ubuntu there is a repository for the s3cmd tool, sometimes we have to update the repository.
So let’s update the repository using the “apt update” command.
> sudo apt update
Now let’s install the s3cmd tool via the “apt install” command on Ubuntu Server.
> sudo apt install s3cmd
Install S3cmd tool via dpkg command.
To install the S3cmd tool with the help of the dpkg command we have to download the .deb package for the s3cmd.
To download the package you have 2 ways, you can click on the link to download the .deb package on your local machine. Or you can use the wget command to download the package.
Let’s use the wget command to download the package in our local system.
> wget -P /tmp http://archive.ubuntu.com/ubuntu/pool/universe/s/s3cmd/s3cmd_2.0.2-1_all.deb
So while using a -P option it will download the package into the /tmp directory.
> sudo dpkg -i /tmp/s3cmd_2.0.2-1_all.deb
Install S3cmd tool via Source code.
So to install the S3cmd command line via Source code we have python installed on our local systems. Let’s use the wget command to download the tar file for s3cmd.
> wget -P /tmp https://sourceforge.net/projects/s3tools/files/s3cmd/2.2.0/s3cmd-2.2.0.tar.gz
Once the file will get downloaded into your local system, extract the file with the help of the tar command.
> tar -zxvf /tmp/s3cmd-2.2.0.tar.gz -C /tmp
So the package has uncompressed into the /tmp directory, now we have to use python command to install.
> cd s3cmd-2.2.0
> sudo python setup.py install
How to Setup S3cmd Command-line Tool in Linux.
To Setup the s3cmd we need the Access Key and Secret Token
To set up the s3cmd we need the Access Key and Secret Token which will create at the AWS console in IAM roles.
So with the help of Access Key and the Secret Tokens, we can connect with the AWS S3 buckets.
Let’s set up the s3cmd command to make the connection from the AWS s3 bucket with our local system.
> s3cmd --configure
"We have to put manually the Access Key, Secret Tokens, region of the bucket and then press enter" OUTPUT: Access key and Secret key are your identifiers for Amazon S3 Access Key: XXXXTastethelinux Secret Key: XXXXTastethelinux#####$!@@!# Default Region [US]: region_of_the_Bucket Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3. S3 Endpoint [s3.amazonaws.com]: Press Enter Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used if the target S3 system supports dns based buckets. DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: Press Enter Encryption password is used to protect your files from reading by unauthorized persons while in transfer to S3 Encryption password: Path to GPG program [/usr/bin/gpg]: Press Enter When using secure HTTPS protocol all communication with Amazon S3 servers is protected from 3rd party eavesdropping. This method is slower than plain HTTP, and can only be proxied with Python 2.7 or newer Use HTTPS protocol [Yes]: Press Enter On some networks all internet access must go through a HTTP proxy. Try setting it here if you can't connect to S3 directly HTTP Proxy server name: Press Enter New settings: Access Key: XXXXTastethelinux Secret Key: XXXXTastethelinux#####$!@@!# Default Region: region_of_the_Bucket S3 Endpoint: s3.amazonaws.com DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)s.s3.amazonaws.com Encryption password: Path to GPG program: /usr/bin/gpg Use HTTPS protocol: True HTTP Proxy server name: HTTP Proxy server port: 0 Test access with supplied credentials? [Y/n] n Save settings? [y/N] y Configuration saved to '/home/tastethelinux-ashish/.s3cfg'
So we have configured the s3cmd tool with the Access Key and Secret Key.
Now we will list the buckets we have access using “s3cmd ls” command
> s3cmd ls Output: 2019-12-30 10:14 s3://tla 2019-11-06 11:26 s3://tla-image 2020-07-01 11:07 s3://tastethelinux-backup 2019-11-07 13:59 s3://tla-logs
Want to learn more about s3cmd install in CentOS, please click on the link.