Patching OCI LXC on Proxmox VE 9.2 With Snapshots and PBS
Patching OCI LXC on Proxmox VE 9.2 workloads with snapshots and PBS backups gives fast rollback, durable recovery, and a safe predictable maintenance window.

On this page
Patching an OCI LXC workload on Proxmox VE 9.2 is safe when you separate two questions: can you revert the container filesystem quickly, and can you restore it from an external copy if the patch damages more than the container? Use a local LXC snapshot for the update window, then a PBS backup for durable recovery. The result is a predictable patch path: apply the update, verify the workload, and roll back only the layer that failed.
Key Takeaways
- Snapshot first: take a local snapshot before package updates so rollback takes seconds.
- Back up durably: send a PBS backup before or immediately after a risky patch window.
- Verify before promote: test service status, logs, and a health endpoint before deleting safety copies.
- Rollback deliberately: choose snapshot for fast reversals and PBS restore for damaged state or node loss.
- Watch storage: snapshots consume space and depend on snapshot-capable storage.
Why OCI LXC Patching Needs Two Safety Nets
OCI LXC containers sit in a useful middle ground. They are managed like normal Proxmox containers, but they often come from OCI images and may run application stacks that look very Docker-like. If your container is part of a Docker in OCI LXC on Proxmox VE 9.2 setup, a package update can touch the container rootfs, the daemon state, and mounted application data all at once.
That creates two different failure shapes. The patch may only break the container's own files, in which case a snapshot rollback is fast and enough. The patch may also corrupt something you need to recover from outside the container, such as a damaged ZFS pool, a deleted directory, or a backup that turns out to be the only good copy. A PBS backup gives you that second line of defense.
Keep the container unprivileged unless the OCI workload truly needs extra capabilities. That reduces the blast radius when a package update changes permissions, AppArmor behavior, or service startup order.
Before patching a production OCI LXC workload, I also want the container to pass a basic pre-production audit. DNS, firewall, backup, and mount choices are boring topics until an update makes them expensive.
This is also why the update runbook should be boring. The goal is not to make patching fancy. The goal is to make the failure path obvious. If the package update breaks the container, roll back. If the container is fine but the backup is missing, back it up now. If the node is unhealthy, restore from PBS.
How to Choose the Right Rollback Path
Not every patch needs the same recovery plan. A small security update inside a stateless web container can be rolled back with a snapshot. A database container with long-running transactions deserves a PBS backup, and sometimes a stop-mode backup, before you touch packages.
| Rollback method | Speed | Durability | Best for |
|---|---|---|---|
| Local LXC snapshot | Seconds | Same host and storage only | Package updates and config changes |
| PBS backup with snapshot mode | Minutes | Off-host PBS datastore | Risky patches before promotion |
| PBS backup with stop mode | Minutes plus downtime | Off-host PBS datastore | Databases or snapshot mode failures |
| Package manager history | Minutes | Inside the container only | Reinstalling one broken package |
The honest tradeoff is simple. Snapshot rollback is fast, but it lives on the same storage and does not protect you from host-level mistakes. PBS restore is safer, but it is slower and may require a spare container ID or a short outage while you restore over the old workload.
For most web services, I use a snapshot plus a post-patch PBS backup. For databases, I use a stop-mode PBS backup, then a snapshot, then the patch. For containers that are rebuilt from images, I keep the old image tag as a third option, but I still treat the container's mutable state as the thing that needs backup.
How to Patch an OCI LXC Container Safely
Use this runbook for routine patches on Proxmox VE 9.2. For a high-risk update, take the PBS backup before the snapshot and patch, then take another backup after verification.
- Confirm the container and its storage.
pct config 104
pct snapshotlist 104
The config output tells you which storage holds the rootfs. If that storage cannot snapshot, the snapshot step will fail later, and you should plan around PBS instead.
- Take a pre-patch snapshot.
pct snapshot 104 pre-patch-2026-01-15 --description "Before package update"
Use a name with a date or build number. On an 8 GiB Debian OCI image backed by ZFS, I have seen this finish in under five seconds. On slower directory storage, it may be slower or unsupported.
- Apply the package update.
pct exec 104 -- env DEBIAN_FRONTEND=noninteractive apt-get update
pct exec 104 -- env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
For Alpine-based OCI images, use the Alpine package manager commands instead.
pct exec 104 -- apk update
pct exec 104 -- apk upgrade
- Verify the workload before calling it good.
pct exec 104 -- systemctl is-active nginx
pct exec 104 -- journalctl -u nginx -n 20 --no-pager
pct exec 104 -- curl -fsS http://127.0.0.1/health
Replace nginx and the health URL with your actual service. I also like to open the app from a client, not just from inside the container, because firewall and DNS changes can hide local success.
- Take a post-patch PBS backup if the service is healthy.
vzdump 104 --storage pbs01 --mode snapshot --compress zstd
If you already took a pre-patch PBS backup, this second backup captures the new working state. If you only took a snapshot, this is the moment your recovery plan becomes durable.
What to Back Up to PBS Before a Big Patch
If the update changes core packages, TLS libraries, container runtime files, or anything that can restart services, take a PBS backup. A PBS backup is also the copy you want when the container state is no longer trustworthy.
Make sure your Proxmox node has a PBS storage entry. A minimal excerpt looks like this:
pbs: pbs01
datastore pbs01
server pbs.example.com
content backup
Then back up the container:
vzdump 104 --storage pbs01 --mode snapshot --compress zstd
For PBS 4.2, a compressed backup of a lightly used 8 GiB OCI LXC container often finishes in one to two minutes after the initial full backup. A large package update may add a few hundred MiB of changed data, but it should still be quick enough to fit inside a maintenance window.
If snapshot mode fails because the container or storage cannot produce a consistent snapshot, use stop mode and accept the downtime:
vzdump 104 --storage pbs01 --mode stop --compress zstd
Keep enough PBS retention to cover the patch window and the rollback decision. A nightly backup is not enough if you patch at 10:00 and the failure only appears during the afternoon traffic spike. For critical OCI LXC workloads, I like a manual backup before the patch and a scheduled backup after the patch.
After the backup completes, do not assume it is restorable. Run a PBS restore test at least once for each workload type you care about. Restoring to a spare CTID is usually less stressful than restoring over the original container during a live incident.
When and How to Roll Back
Snapshot rollback is for the patch window
Use snapshot rollback when the patch has just happened and the container is still on the same node and storage. Stop the container, roll it back, and start it again.
pct stop 104
pct rollback 104 pre-patch-2026-01-15
pct start 104
This path is fast, but it is not a backup. If the snapshot was taken too late, or if the container writes to a bind mount outside the rootfs, rollback will not save you from everything.
After a successful rollback, take a fresh snapshot only if you plan to try the patch again. Do not leave a long chain of pre-patch snapshots hanging around. They consume storage and make future rollback decisions harder.
PBS restore is for the bad state you cannot trust
Use PBS restore when the container filesystem is damaged, the wrong OCI image tag was deployed, or the node itself is unavailable. Restore to a new CTID first, verify the application, then move DNS, firewall rules, or the original container ID.
If you are restoring over the original CTID, stop and destroy or rename the old container first. If you are restoring to a spare CTID, make sure the network configuration does not create an IP address conflict while both containers are running.
Common Gotchas and Tradeoffs
One gotcha I have hit more than once: snapshots do not follow external mounts. If your OCI LXC container uses an NFS share, a CIFS share, or a host bind mount for application data, rollback restores the container rootfs but leaves that external data changed. For those workloads, pair snapshots with application-level dumps or PBS backups that include the data path.
Another gotcha is storage support. A snapshot is only as good as the storage underneath it. If the container rootfs lives on storage that cannot snapshot, the snapshot command fails, and your pre-patch safety net disappears. That is the moment to switch to a PBS stop backup and accept the short downtime.
Package updates can also rewrite config files. If your OCI LXC container stores local changes in files that the package manager owns, the update may replace or conflict with them. Snapshot rollback restores the old files, but it also restores the old service state, so you should still check whether external dependencies changed during the failed patch window.
There is also an OCI-specific tradeoff. If your workflow prefers rebuilding containers from registry images, a rollback may be better done by redeploying the previous image tag than by restoring an old container state. Keep the old tag available, and keep a PBS backup for the mutable state that image rebuilds cannot reproduce.
Finally, keep snapshots short-lived. A snapshot taken before a patch is not a long-term archive. Delete it after you have a verified PBS backup and a stable running container, unless you are intentionally keeping a restore point for a release.
Conclusion
Patching OCI LXC workloads on Proxmox VE 9.2 is predictable when you use a local snapshot for the patch window and PBS for durable recovery. Take the snapshot, apply the update, verify the service, and back up before you delete the safety net. Your next step is to pick one non-critical OCI LXC container and run the full sequence: snapshot, patch, verify, PBS backup, and rollback drill.


