Skip to content

Install Ansible using Python installation manager pip

Updated 1 min read

Updated: 28 September 2026 · Applies to: Ansible (ansible-core 2.16+) on Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

pip installs the newest Ansible from the Python Package Index. On current systems, install it with pipx or in a virtual environment; installing into the system Python with pip is blocked on Ubuntu 23.04 and newer.

With pipx (recommended)

sudo apt install pipx              # AlmaLinux/Rocky: dnf install epel-release && dnf install pipx
pipx ensurepath                      # log in again afterwards
pipx install --include-deps ansible
ansible --version

Upgrade later with pipx upgrade --include-injected ansible.

In a virtual environment

python3 -m venv ~/ansible-venv
source ~/ansible-venv/bin/activate
pip install ansible
ansible --version

ansible or ansible-core?

  • ansible includes ansible-core plus a large set of community collections (modules for many systems).
  • ansible-core is the engine with only the built-in modules; add collections with ansible-galaxy collection install.

See "Install and configure Ansible Automation IT Tool" for your first inventory and playbook.

Troubleshooting

  • ansible: command not found after installing with pipx: run pipx ensurepath and open a new terminal.
  • A module is missing: install its collection, for example ansible-galaxy collection install community.general.
  • Two versions installed: check which one runs with which -a ansible and remove the one you do not need.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket