EXAMTOPICS / TECHNOLOGY INSIGHTS

Red Hat EX200: Rootless Containers on RHEL

Rootless containers on RHEL let a normal user run containerized workloads without giving the container engine host-level root privileges. That changes the risk model in an important way: a process that is “root” inside the container is mapped into an unprivileged user namespace on the host rather than automatically becoming real host root. The result is not magic isolation, but it is a strong default for many developer, automation, and service workloads that do not require privileged access to the operating system.

This topic belongs naturally with Red Hat RHCSA EX200 administration and the broader Red Hat certifications path. RHEL uses Podman as a daemonless container engine, and its rootless model is deliberately integrated with user namespaces, user-scoped configuration, and systemd. Creating and configuring Podman containers provides general container background; the operational difference here is how storage, identities, networking, volumes, and service persistence behave when the container owner is not root.

Rootless changes identity, storage, and privilege boundaries

A rootless Podman user gets container storage under the user’s home directory rather than the system-wide root container store. RHEL documents the normal rootless storage path under $HOME/.local/share/containers/storage, while rootful container storage uses a system location such as /var/lib/containers/storage. This means two users can have different images and containers even on the same host.

User namespaces also map container user and group IDs onto subordinate ranges assigned to the host account. Those ranges are defined through mechanisms such as /etc/subuid and /etc/subgid. The container can therefore represent many internal UIDs while the host kernel still treats the workload as belonging to an unprivileged user range.

This is why root inside a rootless container is not equivalent to host root. The container cannot simply change the host clock, load kernel modules, reconfigure arbitrary host devices, or perform other privileged operations without additional host authorization. That limitation is a security feature, but it also means administrators must identify workloads that truly require elevated host capabilities instead of assuming every container can run rootless.

Prepare the user environment deliberately

A normal RHEL user may already have subordinate ID mappings created during account setup, but production administration should verify them rather than assume. If subordinate UID or GID ranges are changed manually, current Red Hat guidance calls for podman system migrate so Podman can apply the new mapping correctly.

Rootless container configuration belongs in user-scoped paths such as $HOME/.config/containers. Files like containers.conf, storage.conf, and registries.conf let an administrator or user change behavior without modifying global settings for every container workload on the host.

Keep the account itself healthy. Rootless services depend on the user’s home directory, runtime directory, subordinate IDs, and systemd user manager. Moving a home directory, restoring files with wrong ownership, or deleting subordinate ID mappings can break workloads even though the container image has not changed.

Volumes require both Linux and SELinux awareness

Mounting host content into a container creates one of the most common rootless troubleshooting problems. The host path must be accessible to the user account, the mapped container identity must be able to work with the content, and SELinux labeling must permit the container process to use the files. Ordinary mode bits alone do not guarantee success.

Plan data ownership before launching the container. If a database image writes as a specific container UID, determine how that UID maps through the user namespace and whether the host directory ownership supports the write. Avoid “fixes” that recursively make data world-writable; they trade a namespace problem for a filesystem-security problem.

On SELinux-enforcing RHEL systems, use supported Podman volume-label options and persistent host labeling practices rather than disabling SELinux. The rootless model and SELinux complement each other: user namespaces reduce host privilege, while SELinux further constrains what the container process may access.

Networking and ports are intentionally different from rootful containers

Rootless networking is designed to work without giving the user unrestricted control over host networking. That means behavior can differ from a rootful container bridge, particularly for low-numbered privileged ports, direct host networking, and network namespaces.

Expose only the ports the application needs and test them from the correct client path. If a service inside the container listens on port 8080, map it to an appropriate host port owned by the user workflow. Do not assume that a container’s internal port is automatically reachable on the host or network.

If an application requires host networking, raw sockets, special devices, or other elevated networking behavior, reconsider whether rootless is the right execution model. The correct solution may be a carefully constrained rootful service, a capability adjustment, or a different architecture. The objective is not “rootless at any cost,” but “least host privilege that still supports the workload.”

Use Quadlet and systemd for persistent services

Interactive podman run commands are useful for testing, but a production service needs predictable startup, shutdown, dependency handling, and logs. RHEL 10 documents Quadlet as the preferred way to describe Podman containers for systemd. A rootless user can place a .container definition in a user container-systemd directory such as $HOME/.config/containers/systemd/, then let systemd generate the service.

Quadlet keeps container intent close to systemd semantics. The unit can declare the image, command, volumes, environment, dependencies, and installation targets. Administrators can then use familiar systemctl --user operations to start, stop, inspect, and enable the workload.

For a user service that must remain active after logout, enable lingering with loginctl enable-linger <username>. Without lingering, a user-scoped service model may stop when the login session ends. This is a host administration decision, so enable it only for accounts whose background services genuinely need to persist.

Prefer image and configuration reproducibility over pet containers

A maintainable container service should be recreatable from its image, configuration, secrets, and persistent data. If an administrator routinely opens a shell inside the running container and makes manual changes, the next image update or service recreation can erase those fixes.

Keep mutable application data in explicit volumes, put startup configuration in files or environment sources, and version the Quadlet or deployment definition. If the image must change, build or select a new image instead of treating the container’s writable layer as a permanent server filesystem.

This also makes troubleshooting safer. When a rootless service fails, you can compare the running definition with the expected version, recreate the container, and know which host paths and environment values should be present. Reproducibility is one of the main operational benefits of containers, but only if the team avoids turning them into manually customized virtual machines.

Troubleshoot from the user boundary outward

When a rootless container fails, run diagnostic commands as the owning user first. Check podman ps -a, container logs, image availability, mounts, and user-scoped systemd status. Then inspect the user’s subordinate ID mappings, home-directory permissions, SELinux denials, and networking.

For a systemd-managed container, use systemctl --user status and the user journal to determine whether systemd failed before Podman even started the workload. If the service works interactively but not after reboot, check lingering, user environment assumptions, network readiness, and absolute paths in the service definition.

Rootless container troubleshooting is easiest when the administrator remembers the boundary: the workload is intentionally tied to a normal host account. Storage, configuration, service lifetime, and permissions therefore follow that account. Once those dependencies are explicit, Podman becomes a predictable RHEL service tool rather than a collection of special-case container commands.

The practical standard is to start rootless whenever the workload does not need host-root powers, integrate the service with systemd, keep data and configuration reproducible, and elevate only the specific capabilities that the application truly requires. That approach preserves the convenience of containers without turning every container deployment into an implicit privileged service.

Secrets and images need the same least-privilege discipline

Rootless execution reduces host privilege, but it does not make secrets inside the container harmless. Avoid baking credentials, API keys, or private certificates into images. Deliver secrets through a mechanism appropriate to the application and restrict the host files or secret stores that provide them. If a rootless container can read a secret owned by its user account, compromise of that container may expose the same data.

Image provenance matters as well. Pull from trusted registries, use explicit image references or controlled tags for production, and understand when an automated update will replace the running image. Rootless containers can still execute malicious application code with the permissions of the owning account and access any host data intentionally mounted into them. Least privilege therefore applies to the image source, the user account, mounts, network access, and service definition together.

When a service needs access to a device, kernel feature, or host path that forces extensive privilege expansion, stop and reconsider the boundary. A small dedicated rootful service with a narrowly defined role may be safer than a nominally rootless container granted so many exceptions that the original security benefit disappears.

Operational ownership should be explicit

Because rootless workloads belong to user accounts, teams must decide who owns those accounts and how they are maintained. Avoid tying critical production services to a personal employee login. Create service-oriented accounts with controlled home directories, subordinate IDs, and documented systemd user services. That keeps workload identity stable when people change roles.

Back up only what must be preserved: deployment definitions, configuration, secrets through the approved secret-management process, and persistent application data. Container images can normally be pulled again. This reduces recovery complexity and reinforces the principle that the running container is disposable while its declared configuration is the durable asset.