Skip to main content
๐ŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy โ€” plus the companion book on Leanpub & Amazon. Start Learning
Install Ansible on Rocky Linux 9
Automation

Install Ansible on Rocky Linux 9 (Step-by-Step 2026)

Step-by-step guide to install Ansible on Rocky Linux 9. Copy-paste commands, verify installation, and configure for production.

LB
Luca Berton
ยท 1 min read

Here is how to install Ansible on Rocky Linux 9 in 2026. Tested and verified.

Install Ansible

# Enable EPEL repository
sudo dnf install -y epel-release

# Install Ansible
sudo dnf install -y ansible-core

# Or install full Ansible package
sudo dnf install -y ansible

Alternative: pip Installation

sudo dnf install -y python3-pip
pip3 install ansible --user
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc
source ~/.bashrc

Verify

ansible --version
ansible localhost -m ping

Install Collections

ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install redhat.rhel_system_roles

Free 30-min AI & Cloud consultation

Book Now