X
Collapse
-
How to Install AWS CLI on Ubuntu 24.04
AWS offers numerous services for anyone to use. However, when you want an easy and controlled way of controlling all your AWS services, you must install an AWS CLI (command-line interface). The AWS CLI gives you access to the AWS API, allowing you to manage all the services depending on the task you are handling or want to automate.
You can install the AWS CLI on Ubuntu 24.04, and there are two approaches you can use depending on your preference. You can install it as a snap package or a Python module inside a Python virtual environment. Let’s discuss each option.
Method 1: Install AWS CLI Via Snap
Ubuntu supports AWS CLI, and you can access it as a snap package from App Center via GUI or using the snap command. Installing AWS CLI as a snap will install all the dependency packages it requires without installing them separately.
If you find this approach convenient, execute the below command to install AWS CLI.
$ sudo snap install aws-cli --classic
AWS CLI will be downloaded and installed on your system. With this option, the AWS CLI is accessible system-wide and not just in a virtual environment, as in the second method.
Once you install AWS CLI, check the installed version to ascertain the package has been installed successfully.
$ aws --version
We’ve installed AWS CLI version 2.15.38.
The next step is to set up the AWS CLI by connecting it with your AWS account to allow you to take control of your AWS services. Run the configure command below.
$ aws configure
Provide your credentials to complete the setup.
Method 2: Install AWS CLI as a Python Module
You can also install AWS CLI on Ubuntu 24.04 as a Python module. This method requires creating a virtual environment and using pip to install AWS CLI. A virtual environment is a secluded way of using packages. Instead of making AWS CLI accessible system-wide, you can limit it to only being accessible inside the created virtual environment.
Besides, if you don’t have sudo privileges on the system, provided you have a virtual environment, you will manage to install AWS CLI. Follow the steps below.
Step 1: Install Python3 PIP and Venv
To create a virtual environment, we must have Venv installed. Execute the below command to install it.
$ sudo apt install Python3-venv
You also need PIP to help with installing Python modules. Therefore, install PIP using the following command.
$ sudo apt install python3-pip
Step 2: Create a Virtual Environment
With Venv, we can create a secluded environment in which to install AWS CLI without requiring sudo privileges. A virtual environment is recommended when working with Python modules, as it doesn’t interfere with APT-installed packages. Besides, if things go sideways, it doesn’t affect your system. We are using Python 3 for this case.
Here’s how you create a virtual environment and activate it.
$ python3 -m venv .venv
$ source .venv/bin/activate
We’ve named the virtual environment “venv,” but you can use any preferred name. Again, we’ve created the directory in our current location, but you can specify a different path.
Step 3: Install AWS CLI
Inside the virtual environment, running the following command will download and install AWS CLI.
$ pip3 install awscli
Ensure the download completes successfully. You will get an output similar to the one below.
You can check the installed version.
$ aws --version
With AWS CLI installed, configure it to start managing your AWS services. Once you are done using it or want to exit the virtual environment, deactivate it.
Conclusion
AWS CLI is a preferred way of managing your AWS services. On Ubuntu 24.04, you can install it as a snap package or in a Python virtual environment using PIP. This post discussed each method, giving examples to create a detailed and straightforward guide for anyone to follow along.
More...Tags: None
Posting comments is disabled.
Categories
Collapse
Article Tags
Collapse
There are no tags yet.
Latest Articles
Collapse
-
by KasimbaI don’t like my prompt, i want to change it. it has my username and host, but the formatting is not what i want. This blog will get you started quickly on doing exactly that.
This is my current prompt below:
To change the prompt you will update .bashrc and set the PS1 environment variable to a new value.
Here is a cheatsheet of the prompt options:
You can use these placeholders for customization:
\u – Username
...-
Channel: Articles
Today, 01:15 AM -
-
by KasimbaIn this post I will show you how to install the ZSH shell on Rocky Linux. ZSH is an alternate shell that some people prefer instead of BASH shell. Some people say ZSH has better auto-completion, theme support, and plugin system. If you want to give ZSH a try its quite easy to install and give it a try. This post is focused on the Rocky Linux user and how to install ZSH and get started with its usage.
Before installing anything new, it’s good practice to update your system packages:...-
Channel: Articles
12-25-2024, 02:01 AM -
-
by Kasimba
by George Whittaker
Introduction
In the world of operating systems, Windows has long held the lion’s share of the market. Its user-friendly interface and wide compatibility have made it the default choice for many. However, in recent years, Linux has steadily gained traction, challenging the status quo with its unique offerings. What was once considered the domain of tech enthusiasts and developers is now...-
Channel: Articles
12-21-2024, 06:52 AM -
-
by KasimbaOverview of NGINX and Apache
NGINX and Apache are leading web server solutions utilized for hosting websites and web applications. Apache, developed by the Apache Software Foundation, offers robust configuration options and extensibility. NGINX, created by Igor Sysoev, is known for its efficiency in handling numerous concurrent connections with low resource utilization. Both servers function not only as HTTP servers but also as reverse proxies, load balancers, and more.
What is
...-
Channel: Articles
12-21-2024, 03:54 AM -
-
by KasimbaHi everyone, I hope you are enjoying the BETA so far! This release introduces new features, tools, and artwork, so we anticipate a good number of bug reports. Every single fix helps us refine and improve the final release. Your feedback during the BETA phase is extremely important to us. Linux Mint 22.1 is our […]
More...-
Channel: Articles
12-16-2024, 11:50 AM -
-
by Kasimba
by George Whittaker
Introduction
Remote access is a cornerstone of modern IT infrastructure, enabling administrators and users to manage systems, applications, and data from virtually anywhere. However, with great power comes great responsibility—ensuring that remote access remains secure is paramount. This is where OpenSSH steps in, providing robust, encrypted communication for secure remote management....-
Channel: Articles
12-13-2024, 10:31 PM -