AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Run and Stop AWX in Docker Containers: Start, Stop & Manage (Guide)

By Luca Berton · Published 2024-01-01 · Category: troubleshooting

How to run and stop Ansible AWX in Docker containers. Start, stop, restart AWX services, check logs, and troubleshoot common Docker deployment issues.

How to Run and Stop Ansible AWX in Docker container?

I'm going to show you how to start and stop the Ansible AWX in Docker containers. You can take advantage of the AWX modern web-UI and API interface. Running in Docker containers is recommended only for experienced users and developers. I'm Luca Berton and welcome to today's episode of Ansible Pilot.

Links • https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md#run-awx

Playbook

How to Run and Stop Ansible AWX in Docker containers. This requires Building from scratch Ansible AWX for Docker containers in a previous lesson.

code

Once you have a successful build of Ansible AWX for Docker containers, you can run the AWX container using the following command. The process is also spinning the requirements of PostgreSQL and Redis containers.

Your session will be attached to the AWX container, and start watching for log messages and events in real-time when the container was launched. The first time you start the environment, database migrations run in order to build the PostgreSQL initial database schema and data. By default, six Docker containers are running on your machine: tools_awx_1, tools_postgres_1, tools_redis_1, tools_receptor_hop, tools_receptor_1, tools_receptor_2. You can verify the containers running in your system using the docker ps command:

!Run Ansible AWX in Docker containers

Access the Ansible AWX Web UI

The Ansible AWX Web-UI is available at the URL https://localhost:8043/. A successful connection with your browser is going to show you the following login screen ( https://localhost:8043/#/login ).

!Run Ansible AWX UI in Docker containers

Access the Ansible AWX Web API

The Ansible AWX API is available at the URL https://localhost:8043/api/. A successful connection with your browser is going to show you the following API endpoint ( https://localhost:8043/api/ ). The Ansible AWX API is a Browsable API so easy to navigate via the browser. Please note that some API endpoints require authentication.

!Access the Ansible AWX API in Docker containers

Conclusion

Now you know how to Run and Stop Ansible AWX in Docker containers.

Start AWX

Stop AWX

Restart AWX

AWX Container Architecture

| Container | Purpose | |-----------|---------| | awx_web | Web UI and API (nginx + uwsgi) | | awx_task | Job execution engine | | postgres | Database | | redis | Message broker / cache |

Check Status and Logs

Manage with Ansible

Common Operations

Backup database

Restore database

Create admin user

Run management commands

Troubleshooting

AWX web not accessible

Task container keeps restarting

AWX Operator (Kubernetes) — Modern Approach

FAQ

Docker Compose vs AWX Operator?

Docker Compose is for development/small deployments. AWX Operator on Kubernetes is recommended for production.

How do I upgrade AWX?

My jobs are stuck in "pending"

Check the task container: docker logs awx_task. Common causes: Redis connection lost, insufficient memory, or task container crashed.

Related ArticlesAnsible Docker GuideWhat is Ansible AWX

Category: troubleshooting

Watch the video: Run and Stop AWX in Docker Containers: Start, Stop & Manage (Guide) — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home