Recent CVEs are a good reason to check how current your AWX instance is. This guide covers patching the operating system, upgrading AWX itself, and moving to a fresh CloudSOE image. The image runs on Ubuntu 26.04 LTS on both AWS and Azure. It doesn’t include PHP, so the PHP2Shell advisory doesn’t apply.
The most important thing to know: apt only patches the operating system. AWX, the AWX Operator, k3s and Helm were not installed from apt, so apt upgrade never touches them.
What you can upgrade in place
| Component | In place? | How |
|---|---|---|
| Operating system (Ubuntu 26.04 packages, kernel) | Yes | apt update && apt upgrade, then reboot if asked (below) |
| AWX 24.0.0 to a later 24.x release | Yes, with care | Change the AWX custom resource; the operator rolls it out and migrates the database (below) |
| AWX Operator (2.19.1, Helm chart) | Not recommended | 2.19.1 is the operator for the whole 24.x line. Use a fresh image when a new pairing ships |
k3s (pinned to v1.33.5+k3s1) | Patch releases only | Same v1.33 line, one step at a time (below). For anything bigger, use a fresh image |
| PostgreSQL 15, Redis 7 containers | Minor updates only | Re-pull the same tag. No major PostgreSQL upgrades in place |
Execution environments (awx-ee) | Yes | Pull a newer image, or register a new EE in the portal |
For anything marked “not recommended”, the safe path is a fresh CloudSOE image with your data restored into it. That way the old instance stays untouched until the new one is proven.
Before you start: back up
Do both of these before every upgrade, OS patches included.
1. Snapshot the disk
A disk snapshot is your rollback for everything on this page:
- AWS: EC2 → Volumes → select the instance’s root volume → Actions → Create snapshot.
- Azure: the VM → Disks → select the OS disk → Create snapshot.
A snapshot taken while AWX is busy is crash-consistent. For a cleaner one, take it when no jobs are running.
2. Dump the AWX database and its secret key
Everything in AWX (inventories, credentials, job templates, history) lives in the PostgreSQL pod. Its data sits on the instance under /var/lib/awx-storage/postgresql. Instances from older images use /mnt/awx-storage, and kubectl get pv -o wide shows which one yours uses.
AWX encrypts saved credentials with a secret key stored in the Kubernetes secret awx-secret-key. A database dump without that key restores everything except your credentials, so back up both:
mkdir -p ~/awx-backup && cd ~/awx-backup
# 1. The database
PG_POD=$(kubectl get pods | grep awx-postgres | cut -d " " -f1)
kubectl exec -i "$PG_POD" -- pg_dump -U awx awx | gzip > awx-db-$(date +%F).sql.gz
# 2. The secret key that decrypts stored credentials (keep it private)
kubectl get secret awx-secret-key -o jsonpath='{.data.secret_key}' | base64 -d > awx-secret-key.txt
chmod 600 awx-secret-key.txt
# 3. Project files stored on the instance (manual projects)
sudo tar czf awx-playbooks-$(date +%F).tgz -C /var/lib/awx-storage playbooks
Copy ~/awx-backup off the instance (your workstation, S3, Azure Blob). Treat awx-secret-key.txt like a password: anyone with it and the dump can decrypt your stored credentials.
The AWX Operator also has its own backup resource, AWXBackup. It writes a database dump plus the deployment’s secrets to a persistent volume inside the cluster:
cat <<'EOF' > awx-operator-backup.yaml
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
name: awx-backup-before-upgrade
namespace: default
spec:
deployment_name: awx
EOF
kubectl apply -f awx-operator-backup.yaml
kubectl get awxbackup awx-backup-before-upgrade -o jsonpath='{.status}'
That backup stays on the same instance, so it can’t replace the off-instance copy above. Restoring it is done with an AWXRestore resource. Follow the backup and restore section of the AWX Operator documentation if you go that route.
Update the operating system
OS updates are routine and safe. They don’t change AWX, the operator or k3s.
sudo apt update
sudo apt upgrade
Check whether the update needs a reboot (usually after a kernel update):
[ -f /var/run/reboot-required ] && cat /var/run/reboot-required
sudo reboot
After a reboot, k3s starts on its own and brings the AWX pods back. The one-time awx-firstboot service does not run again, because its marker /var/lib/awx-firstboot.done already exists. Give the pods a few minutes, then check:
kubectl get pods # awx-web, awx-task, awx-postgres-15-0 and the operator should be Running
Automatic security updates
The CloudSOE build leaves Ubuntu’s standard unattended-upgrades setup as it is. Ubuntu cloud images normally have it turned on for security updates, but it never reboots for you. Check it with:
systemctl status unattended-upgrades
cat /etc/apt/apt.conf.d/20auto-upgrades
Held packages
The image doesn’t hold any packages. If you added holds yourself, list them so you know what apt upgrade will skip:
apt-mark showhold
Don’t run an in-place release upgrade (do-release-upgrade) on this image. To move to a newer Ubuntu release, use a fresh image.
Upgrade AWX
Know what you’re running
cat /etc/cloudsoe-support.txt # image build and version
kubectl get awx awx -o jsonpath='{.spec.image_version}{"\n"}' # AWX version (24.0.0 on this image)
helm list # operator chart (my-awx-operator, 2.19.1)
k3s --version # k3s (v1.33.5+k3s1)
How the image is pinned
This image doesn’t track “latest” anywhere:
- The AWX Operator is installed with Helm as the release
my-awx-operator, chart version 2.19.1. - The AWX custom resource
awxpinsimage_version: 24.0.0and setsimage_pull_policy: IfNotPresent. Every image AWX needs is pre-loaded into k3s, so nothing is downloaded unless you change a version. - Both execution environments (AWX EE Latest and AWX EE 24.0.0) are set to pull only if missing. Jobs keep using the cached copy of
awx-ee:latest, even after a newer one is published.
Upgrade AWX within 24.x
Operator 2.19.1 was released alongside AWX 24.6.1 and supports the whole 24.x line. A 24.x upgrade therefore only means changing the AWX version in the custom resource. The operator stays as it is.
- Check the AWX releases and their release notes. Pick a 24.x version (24.6.1 at the time of writing).
- Take the backups above. Database migrations run forward only.
- Make sure the instance can reach
quay.io, because the new AWX images get downloaded. - Point the custom resource at the new version:
kubectl patch awx awx --type merge \
-p '{"spec":{"image_version":"24.6.1","init_container_image_version":"24.6.1"}}'
- Watch the operator roll out the change and the database migrations run:
kubectl logs -f deployment/awx-operator-controller-manager -c awx-manager
kubectl get pods -w
The web and task pods restart on the new image. Expect the UI to be unavailable for several minutes while migrations run (an HTTP 500 or a maintenance page is normal during that time). When awx-web and awx-task are Running again, go to Check everything works.
Optionally, register a matching execution environment (for example quay.io/ansible/awx-ee:24.6.1) in Administration → Execution Environments.
Upgrading beyond AWX 24 or the operator
Moving to a different AWX Operator version (a new chart through helm upgrade, with its new CRDs) and a new AWX major version is a multi-step operator procedure. The CRDs, the default images and the Postgres handling can all change between versions, and a half-finished rollout can leave AWX down. We don’t recommend doing it in place on this image. When a newer AWX/operator pairing is published as a CloudSOE image, move to the fresh image and restore your database into it.
Refresh execution environments
Because the execution environments pull only if missing, a newer awx-ee:latest is not picked up on its own. To refresh it, pull the image into k3s:
sudo k3s crictl pull quay.io/ansible/awx-ee:latest
New jobs use the refreshed image. The AWX control plane also uses awx-ee:latest, and it switches to the new image the next time the awx-task pod restarts. To keep a known-good EE alongside it, register a version-tagged image as a separate execution environment instead of replacing latest.
Refresh PostgreSQL 15 and Redis 7 minor versions
The custom resource uses the floating tags postgres:15 and redis:7, but IfNotPresent means the cached copy is never refreshed. To pick up a newer minor release (security fixes within the same major), take the backups, then:
sudo k3s crictl pull docker.io/library/postgres:15
kubectl delete pod awx-postgres-15-0 # recreated on the refreshed image, data stays on disk
Wait for awx-postgres-15-0 to be Running before you do anything else. Don’t change the PostgreSQL major version (postgres_image_version) in place. A major upgrade needs a data migration that this setup doesn’t do for you. Use a fresh image instead.
k3s: patch releases only
k3s was installed with the official get.k3s.io script, pinned to v1.33.5+k3s1. It’s pinned on purpose: with a newer k3s (v1.37), the AWX 24.0.0 + operator 2.19.1 stack never finished its first boot. The database migrations crawled and the UI stayed on HTTP 500.
- Don’t jump k3s minor versions (for example v1.33 to v1.35). Kubernetes upgrades one minor version at a time, and each jump can break the operator or AWX.
- Patch releases within
v1.33are a reasonable in-place update. Take the snapshot first, then re-run the installer pinned to the exact release you want:
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.33.X+k3s1' sh - # replace X with the patch release
k3s --version
kubectl get pods -w # pods restart; wait until awx-web, awx-task and awx-postgres are Running
- For a newer Kubernetes line, move to a fresh CloudSOE image. New images only move k3s forward after AWX has passed our build checks on that version.
Move to a fresh CloudSOE image
This is the safest way to pick up a new AWX version, a new k3s or a newer base OS. You build a new instance next to the old one, restore your data into it, test it, and only then switch over.
1. Back up the old instance
Run the database, secret-key and project-file backup from Before you start. Copy the files to your workstation:
scp -r ubuntu@<old-ip>:~/awx-backup ./awx-backup # Azure: use your admin username
2. Launch the latest image
Launch a new instance from the current CloudSOE AWX listing: AWS guide or Azure guide. Wait until first boot finishes (awx-bootstrap-status reaches 100%) before you restore anything.
3. Copy the backup across
scp -r ./awx-backup ubuntu@<new-ip>:~/
4. Restore on the new instance
Stop the operator first so it doesn’t restart AWX in the middle of the restore. Then stop the web and task pods, put back the old secret key and load the database:
cd ~/awx-backup
# Pause the operator, then stop AWX's web and task pods
kubectl scale deployment awx-operator-controller-manager --replicas=0
kubectl scale deployment awx-web awx-task --replicas=0
# Restore the secret key so stored credentials decrypt
kubectl patch secret awx-secret-key \
-p "{\"data\":{\"secret_key\":\"$(base64 -w0 awx-secret-key.txt)\"}}"
# Replace the fresh database with your dump
PG_POD=$(kubectl get pods | grep awx-postgres | cut -d " " -f1)
kubectl exec -i "$PG_POD" -- psql -U awx -d postgres -c 'DROP DATABASE awx;'
kubectl exec -i "$PG_POD" -- psql -U awx -d postgres -c 'CREATE DATABASE awx OWNER awx;'
gunzip -c awx-db-*.sql.gz | kubectl exec -i "$PG_POD" -- psql -q -U awx -d awx
# Restore manual project files
sudo tar xzf awx-playbooks-*.tgz -C /var/lib/awx-storage
# Hand control back to the operator; it starts awx-web and awx-task again
kubectl scale deployment awx-operator-controller-manager --replicas=1
kubectl get pods -w
If awx-web and awx-task don’t come back within a few minutes, start them yourself with kubectl scale deployment awx-web awx-task --replicas=1. If the new image runs a newer AWX than the old one, the task pod migrates the restored database on startup, which can take a few minutes.
You now log in with your old AWX accounts and passwords, because they came back with the database. The password in /opt/default-awx-login.txt on the new instance no longer applies, so delete that file.
5. Switch DNS or the IP
- AWS: move the Elastic IP from the old instance to the new one (EC2 → Elastic IPs → Associate), or update your DNS record.
- Azure: move the static public IP to the new VM’s network interface, or update your DNS record.
- Update any load balancer target (ALB target group or Application Gateway backend pool) to point at the new instance on port 30300.
Managed hosts don’t care where AWX runs, but check firewall rules on your targets that only allow the old instance’s address.
6. Retire the old instance
Leave the old instance stopped (not deleted) for a few days while you confirm jobs run on the new one. Then terminate or delete it, and clean up the snapshots and backup files you no longer need.
Check everything works
Run these after any upgrade or migration:
kubectl get pods # awx-web, awx-task, awx-postgres-15-0 and the operator: Running
kubectl get awx awx -o jsonpath='{.spec.image_version}{"\n"}'
sudo systemctl status k3s
From your own machine (an Azure VM often can’t reach its own public IP), check the portal and the API’s ping endpoint. A JSON reply that includes "version" means AWX is up:
curl -sI http://<public-ip>:30300/
curl -s http://<public-ip>:30300/api/v2/ping/
Finally, log in and run a known-good job template, such as the built-in Demo Job Template. Check that a job using stored credentials succeeds, which confirms the secret key was restored correctly.
Next steps
- Configure AWX: file locations, kubectl, storage and the web portal port
- Tips & tricks: backups, troubleshooting first boot and sizing advice