---
title: "How to Install Ansible Galaxy Roles and Collections"
description: "Using Ansible doesn’t require you create everything from scratch. Ansible Galaxy encourages users to share pre-configured Ansible roles and collections for popular tasks and applications you can..."
url: https://www.inmotionhosting.com/support/edu/ansible/install-ansible-galaxy-roles-and-collections/
date: 2020-02-27
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["Ansible Tutorials"]
type: post
lang: en
---

# How to Install Ansible Galaxy Roles and Collections

Using [Ansible](https://www.inmotionhosting.com/ansible) doesn’t require you create everything from scratch. [Ansible Galaxy](https://galaxy.ansible.com/home) encourages users to share pre-configured Ansible roles and collections for popular tasks and applications you can implement within playbooks immediately. These community submitted roles can save time when configuring playbooks for deployment.

Remember, when browsing roles on Ansible Galaxy, it’s important to check stats such as last commit, quality score, community score, and download count. These stats help you understand the quality of submitted content.

Below we’ll cover how to install content from the Ansible Galaxy community with examples:

- [Install a role](#roles)
- [Install a collection](#collections)

## Install Ansible Galaxy Roles

1. Visit [https://galaxy.ansible.com](https://galaxy.ansible.com)
2. Search for a role you wish to use
3. Select the role name for more details
4. Open your terminal (or [SSH](https://www.inmotionhosting.com/support/server/ssh/how-to-login-ssh/))
5. Install the Ansible Galaxy role:`ansible-galaxy install author.role` – e.g. [*ansible-galaxy install geerlingguy.security*](https://galaxy.ansible.com/geerlingguy/security)You’ll see the URL for the downloaded role and extraction destination.
6. Add the role in an [Ansible playbook](https://www.inmotionhosting.com/support/edu/ansible/create-an-ansible-playbook/):

![Ansible Galaxy Security Role Details](https://www.inmotionhosting.com/support/wp-content/uploads/2020/02/ansible-galaxy-security-role.png)*Copy the installation command to your clipboard to get started*

tasks:
name: Include geerlingguy's Security role
include_role: geerlingguy.security

## Install Ansible Galaxy Collections

An **Ansible collection** is a package of playbooks, roles, modules, and plugins for distribution. Collections show up in Galaxy searches alongside roles. When you select a collection, you’ll have two download options:

- Install the collection role from your terminal: `ansible-galaxy collection install authorname.collectionname`– e.g. [*ansible-galaxy collection install awx.awx*](https://galaxy.ansible.com/awx/awx)
- Select **Download Tarball** to download the compressed archive to your home folder, and install it from your terminal: `ansible-galaxy collection install packagename.tar.gz`– e.g. *ansible-galaxy collection install awx-awx-9.2.0.tar.gz*

Here are two ways to implement Ansible collections in your playbooks:

tasks:
import_role:
name: awx.awx

collections:
name: awx.awx
tasks:

Learn more about IT automation in our [Ansible Education Channel](https://www.inmotionhosting.com/support/edu/ansible/).

Looking to improve performance with your Ansible agent? Manage your Ansible agent with the [Cloud Server](https://www.inmotionhosting.com/cloud-vps) that fits your needs.
