<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Run AWX inside docker on RHEL 9]]></title><description><![CDATA[Run AWX inside docker on RHEL 9]]></description><link>https://awx-on-docker.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 21:43:05 GMT</lastBuildDate><atom:link href="https://awx-on-docker.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AWX on RHEL 9 with minimal resources]]></title><description><![CDATA[Many of us do not have high-end laptops to run resource-intensive applications and large codebases. If you're looking to set up AWX on Docker with limited hardware, follow these simple steps for an easy installation.
Minimum requirements:

Docker pac...]]></description><link>https://awx-on-docker.hashnode.dev/awx-on-rhel-9-with-minimal-resources</link><guid isPermaLink="true">https://awx-on-docker.hashnode.dev/awx-on-rhel-9-with-minimal-resources</guid><dc:creator><![CDATA[Mohan Juriyani]]></dc:creator><pubDate>Sun, 23 Mar 2025 09:27:23 GMT</pubDate><content:encoded><![CDATA[<p>Many of us do not have high-end laptops to run resource-intensive applications and large codebases. If you're looking to set up <strong>AWX on Docker</strong> with limited hardware, follow these simple steps for an easy installation.</p>
<h2 id="heading-minimum-requirements">Minimum requirements:</h2>
<ul>
<li><p>Docker packages and python should be installed.</p>
</li>
<li><p>System requirement:</p>
<p>  <strong>CPU: 2</strong><br />  <strong>Memory: 4GB</strong></p>
</li>
</ul>
<h2 id="heading-steps-to-install">Steps to install:</h2>
<ul>
<li><p>First download the required package and disable SELINUX.</p>
<pre><code class="lang-plaintext">  sudo setenforce 0
  sudo dnf -y install git gcc gcc-c++ ansible nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3-pip wget nano     libseccomp
</code></pre>
</li>
<li><p>Now enable the repo for docker and install it.</p>
</li>
</ul>
<pre><code class="lang-plaintext">sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf -y install docker-ce
</code></pre>
<ul>
<li><p>Since we will be using Python environments, it is recommended to create a <strong>virtual environment</strong> before installing the required pip packages or binaries. This approach helps <strong>keep the base OS isolated</strong> and prevents conflicts between system-wide and project-specific dependencies.</p>
<pre><code class="lang-plaintext">   python3 -m venv myenv
   source myenv/bin/activate
   pip3 install setuptools_rust
   pip3 install wheel
   pip3 install docker-compose
   pip3 install docker-compose   --force
   pip install --upgrade setuptools pip
   pip install pyyaml
</code></pre>
</li>
<li><p>Once the above steps are completed lets try cloning and installing AWX.</p>
</li>
</ul>
<blockquote>
<p>Note: internet access should be enabled from your host to clone or download the required things.</p>
</blockquote>
<pre><code class="lang-plaintext">cd ~
git clone -b 17.1.0 https://github.com/ansible/awx.git
cd awx
</code></pre>
<p>Once you clone the repo lets edit some parameters for running AWX with ease.</p>
<blockquote>
<p>make sure below entries are un-commented and details are correctly mentioned.</p>
</blockquote>
<pre><code class="lang-plaintext">
[all:vars]
dockerhub_base=ansible
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir="/var/lib/awx/pgdocker"
host_port=80
host_port_ssl=443
docker_compose_dir="/var/lib/awx/awxcompose"  ##compose file for configuring containers

pg_username=awx
pg_password=your_pg_pass
pg_database=awx
pg_port=5432

admin_user=your_awx_admin_user
admin_password=your_awx_pass

create_preload_data=True

secret_key=your_awx_pass

awx_alternate_dns_servers="8.8.8.8,8.8.4.4"

project_data_dir=/var/lib/awx/projects #the things that you create inside AWX will be stored here#
</code></pre>
<p>Run below script to setup the AWX.</p>
<pre><code class="lang-plaintext">ansible-playbook -i ~/awx/installer/inventory ~/awx/installer/install.yml
</code></pre>
<ul>
<li>output should look like this.</li>
</ul>
<pre><code class="lang-plaintext">[root@lm003030 tasks]# ansible-playbook -i ~/awx/installer/inventory ~/awx/installer/install.yml

PLAY [Build and deploy AWX] ******************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************
ok: [localhost]

TASK [check_vars : admin_password should be defined] *****************************************************************
ok: [localhost] =&gt; {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [check_vars : include_tasks] ************************************************************************************
skipping: [localhost]

TASK [check_vars : include_tasks] ************************************************************************************
included: /root/awx/installer/roles/check_vars/tasks/check_docker.yml for localhost

TASK [check_vars : postgres_data_dir should be defined] **************************************************************
ok: [localhost] =&gt; {
    "changed": false,
    "msg": "All assertions passed"
}



TASK [kubernetes : include_tasks] ************************************************************************************
skipping: [localhost] =&gt; (item=openshift_auth.yml)
skipping: [localhost] =&gt; (item=openshift.yml)
skipping: [localhost]

TASK [kubernetes : include_tasks] ************************************************************************************
skipping: [localhost] =&gt; (item=kubernetes_auth.yml)
skipping: [localhost] =&gt; (item=kubernetes.yml)
skipping: [localhost]

TASK [kubernetes : Use kubectl or oc] ********************************************************************************
skipping: [localhost]

TASK [kubernetes : set_fact] *****************************************************************************************
skipping: [localhost]

TASK [kubernetes : Record deployment size] ***************************************************************************
skipping: [localhost]

TASK [kubernetes : Set expected post-deployment Replicas value] ******************************************************
skipping: [localhost]
TASK [local_docker : Set DockerHub Image Paths] **********************************************************************
ok: [localhost]

TASK [local_docker : Create /var/lib/awx/awxcompose directory] *******************************************************
ok: [localhost]

TASK [local_docker : Create Redis socket directory] ******************************************************************
ok: [localhost]

TASK [local_docker : Create Docker Compose Configuration] ************************************************************
ok: [localhost] =&gt; (item={'file': 'environment.sh', 'mode': '0600'})
changed: [localhost] =&gt; (item={'file': 'credentials.py', 'mode': '0600'})
ok: [localhost] =&gt; (item={'file': 'docker-compose.yml', 'mode': '0600'})
ok: [localhost] =&gt; (item={'file': 'nginx.conf', 'mode': '0600'})
ok: [localhost] =&gt; (item={'file': 'redis.conf', 'mode': '0664'})

TASK [local_docker : Render SECRET_KEY file] *************************************************************************
ok: [localhost]

TASK [local_docker : Remove AWX containers before migrating postgres so that the old postgres container does not get used] ***
ok: [localhost]

TASK [local_docker : Run migrations in task container] ***************************************************************
changed: [localhost]

TASK [local_docker : Start the containers] ***************************************************************************
changed: [localhost]

TASK [local_docker : Update CA certs in awx_web container ] ***************************************************************************
changed: [localhost]

TASK [local_docker : Update CA certs in awx_task container ] ***************************************************************************
changed: [localhost]

TASK [local_docker : wait for launch script to create a user ] ***************************************************************************
changed: [localhost]


PLAY RECAP ***********************************************************************************************************
localhost                  : ok=16   changed=5    unreachable=0    failed=0    skipped=73   rescued=0    ignored=2
</code></pre>
<p>Now you see the running container using docker ps.</p>
<pre><code class="lang-plaintext">[root@lm003030 awxcompose]# docker ps -a
CONTAINER ID   IMAGE                COMMAND                  CREATED             STATUS             PORTS                  NAMES
ef60880365d7   ansible/awx:17.1.0   "/usr/bin/tini -- /b…"   20 minutes ago      Up 19 minutes      0.0.0.0:80-&gt;8052/tcp   awx_web
e01da4e4fa8c   ansible/awx:17.1.0   "/usr/bin/tini -- /u…"   About an hour ago   Up About an hour   8052/tcp               awx_task
5fe4298e3adc   postgres:12          "docker-entrypoint.s…"   About an hour ago   Up About an hour   5432/tcp               awx_postgres
7eb79a359674   redis                "docker-entrypoint.s…"   About an hour ago   Up About an hour   6379/tcp               awx_redis
[root@lm003030 awxcompose]#
</code></pre>
<p>now try to login to your web or AWX UI controller like below.</p>
<blockquote>
<p>http://your-server-ip</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742720783193/356f5d04-a1b8-487b-bdfd-74a2a19ac08d.png" alt class="image--center mx-auto" /></p>
<p>Here you go, you have successfully deployed AWX up and running.</p>
<h2 id="heading-key-take-aways">key take-aways:</h2>
<ol>
<li><p>Make sure you have sufficient space on / or /var directory as data will be getting stored inside /var/lib.</p>
</li>
<li><p>Ports are available to use. ( to check if ports are conflicting use <strong>lsof -i :80</strong> and stop that service or app if not in use. )</p>
</li>
<li><p>Incase your script are failing with below errors, you can try to fix it by creating required directory and assigning correct permissions or by downloading required dependencies.</p>
<pre><code class="lang-plaintext"> TASK [local_docker : Remove AWX containers before migrating postgres so that the old postgres container does not get u                                        sed] ***
 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError:                                         No module named 'docker'
 fatal: [localhost]: FAILED! =&gt; {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for                                         Python: docker&gt;=5.0.0 (Python &gt;= 3.6) or docker&lt;5.0.0 (Python 2.7)) on lm003030's Python /usr/bin/python3. Please rea                                        d the module documentation and install it in the appropriate location. If the required library is installed, but Ansib                                        le is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example                                         via `pip install docker` (Python &gt;= 3.6) or `pip install docker==4.4.4` (Python 2.7). The error was: No module named '                                        docker'"}
 ...ignoring

 TASK [local_docker : Run migrations in task container] ***************************************************************
 changed: [localhost]

 TASK [local_docker : Start the containers] ***************************************************************************
 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError:                                         No module named 'docker'
 fatal: [localhost]: FAILED! =&gt; {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for                                         Python: docker&gt;=5.0.0 (Python &gt;= 3.6) or docker&lt;5.0.0 (Python 2.7)) on lm003030's Python /usr/bin/python3. Please rea                                        d the module documentation and install it in the appropriate location. If the required library is installed, but Ansib                                        le is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example                                         via `pip install docker` (Python &gt;= 3.6) or `pip install docker==4.4.4` (Python 2.7). The error was: No module named '                                        docker'"}
</code></pre>
</li>
<li><p>you can also restart your containers by going inside compose file</p>
<pre><code class="lang-plaintext"> [root@lm003030 awxcompose]# pwd
 /var/lib/awx/awxcompose
 [root@lm003030 awxcompose]# ls -lrth
 total 24K
 -rw-------. 1 root root  154 Mar 22 22:48 environment.sh
 -rw-------. 1 root root 2.6K Mar 22 22:48 docker-compose.yml
 -rw-------. 1 root root 2.9K Mar 22 22:48 nginx.conf
 -rw-rw-r--. 1 root root   78 Mar 22 22:48 redis.conf
 -rw-------. 1 root root    8 Mar 22 22:48 SECRET_KEY
 drwxr-xr-x. 5 root root   74 Mar 23 01:43 myenv
 drwxrwxrwx. 2 root root   24 Mar 23 13:14 redis_socket
 -rw-------. 1 root root  458 Mar 23 14:10 credentials.py
 [root@lm003030 awxcompose]#
</code></pre>
</li>
</ol>
]]></content:encoded></item></channel></rss>