# Installing Ansible on Ubuntu 22.04

Ansible is an open-source automation tool that simplifies configuration management, application deployment, and task automation.

**<mark>Step 1: Update the System Package</mark>**

```plaintext
sudo apt update
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723802908981/7088bf93-2594-46aa-b453-fff050ec910c.png align="center")

**<mark>Step 2: Install Python</mark>**

Ansible requires Python, so you need to install Python and `pip`, the Python package manager:

```plaintext
sudo apt install -y python3 python3-pip
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803001928/fbc6444b-ca3b-4641-a95e-7816f2c39e79.png align="center")

Verify the Python installation by checking the version:

```plaintext
python3 --version
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803031736/04f03c03-1383-4f4c-aeb5-a9fc6310f15c.png align="center")

**<mark>Step 3: Add the Ansible PPA (Personal Package Archive)</mark>**

To install the latest version of Ansible, add the official Ansible PPA to your system:

```plaintext
sudo apt update
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803063256/90690c2b-86fc-4197-a6bc-ca78668e6700.png align="center")

Add the Ansible PPA (Personal Package Archive)

```plaintext
sudo apt install -y software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803185362/751dfe92-2cbe-420b-8026-1e198188640a.png align="center")

**<mark>Step 4: Install Ansible</mark>**

With the PPA added, you can now install Ansible:

```plaintext
sudo apt install -y ansible
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803300381/89dc411f-382e-42e7-acea-2192b98200a4.png align="center")

**Verify the Installation:**

To ensure Ansible is installed correctly, check its version:

```plaintext
ansible --version
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1723803334874/6626b2fc-8e2c-4c23-97dc-f383234651a8.png align="center")
