Configure devices and storage
Rather than mounting the entire host /dev filesystem or using --privileged, Steam Headless requests only the specific kernel device nodes and storage directories necessary for gaming.
This architecture ensures:
- Clean isolation between multiple gaming containers;
- Host keyboard and mouse safety (container games cannot capture or interfere with host physical peripherals);
- Stable virtual input discovery via
shinputd; - Reliable persistent storage for user configurations, Proton prefixes, and game installations.
Required device mappings
To enable graphics acceleration, virtual gamepad emulation, and containerised desktop applications, expose the following device nodes to your container:
Device node reference table
| Host Device Node | Container Device Node | Why It Is Required |
|---|---|---|
/dev/dri/renderD128 | /dev/dri/renderD128 | GPU Rendering & Encoding: Provides unprivileged 3D Vulkan/OpenGL acceleration and hardware video encoding (VA-API / NVENC). |
/dev/fuse | /dev/fuse | Sandboxing & Portable Apps: Required by Flatpak runtimes (bubblewrap) and AppImage games to mount user-space virtual filesystems. |
/dev/uinput | /dev/uinput | Virtual Input Emulation: Used by shinputd and Sunshine to inject virtual mouse, keyboard, and gamepad events. |
/dev/uhid | /dev/uhid | Virtual HID Controllers: Enables virtual Bluetooth and HID controller emulation for gamepads. |
--privileged or mount host /devNever run Steam Headless with privileged: true or bind-mount the host /dev directory. Doing so breaks the container's private input isolation, exposes physical host mice and keyboards to remote players, and causes container startup failures.
Virtual input discovery and capabilities
The container runs an internal input discovery daemon called shinputd. When Sunshine or a browser session connects, shinputd dynamically creates virtual controller devices and assigns them to the container's private desktop seat.
To support this without granting container root access, configure the following settings:
-
Read-only sysfs bind mount:
volumes:- /sys/devices/virtual/input:/sys/devices/virtual/input:roAllows
shinputdto read kernel-allocated input event device numbers without allowing write access to host sysfs. -
Input major cgroup rule:
device_cgroup_rules:- 'c 13:* rwm'Linux assigns major device number
13to input subsystem devices (/dev/input/event*). Because event minors are allocated dynamically whenever a virtual controller connects, this rule permits dynamic minor allocation within the container's private/dev/inputtmpfs. -
Required Linux capabilities:
cap_add:- DAC_READ_SEARCH # Inspect container-local descriptor tables- NET_ADMIN # Send internal udev multicast within container network namespace- SYS_ADMIN # Required by systemd and FUSE- SYS_NICE # RealtimeKit priority scheduling for PipeWire audio- SYS_PTRACE # Inspect container-local uinput descriptors via pidfd_getfd
Storage architecture and layout
Steam Headless separates persistent storage into two Docker volumes and two host directories:
steam-headless-a-state <-- /var/lib/steam-headless (Docker volume per container)
steam-headless-a-journal <-- /var/log/journal (Docker volume per container)
./data/homes/desktop-a/ <-- /home/steamheadless (Host directory per container)
/mnt/storage/games/ <-- /mnt/games (Shared or dedicated host directory)
1. User home directory (/home/steamheadless)
- Contents: Desktop settings, Firefox user profile, Steam login credentials, game save data, Proton WINE prefixes (
~/.local/share/Steam/steamapps/compatdata), and Flatpak applications (~/.local/share/flatpak). - Isolation Requirement: Strictly private per container. Never share a home directory between multiple containers. Doing so leads to concurrent database corruption, conflicting Steam client sessions, and broken desktop caches.
- Performance Recommendation: Store this directory on a high-speed SSD or NVMe drive. Proton prefixes and shader caches rely heavily on random I/O during game launches. Typical size ranges from 20 GiB to 60 GiB+.
2. Appliance state directory (/var/lib/steam-headless)
- Contents: Steam Headless setup records, sign-in state, and auto-generated TLS certificates used by SHUI.
- Isolation Requirement: Strictly private per container.
- Size: Lightweight (typically under 100 MiB).
3. System journal directory (/var/log/journal)
- Contents: Persistent system and service logs exposed through SHUI and
journalctl. - Isolation Requirement: Strictly private per container.
- Retention: The container retains up to seven days of logs, rotates journal files daily, and limits journal storage to approximately 500 MiB.
4. Steam game library directory (/mnt/games)
- Contents: Downloaded Steam game assets and binaries (
steamapps/common/). - Sharing: Can be shared across multiple containers. You can mount a single large game directory across several containers simultaneously. Steam can read existing game files, avoiding duplicate downloads across containers.
- Size: Typically 200 GiB to several terabytes.
Let Steam find the mounted game library
When Steam starts, Steam Headless automatically adds /mnt/games/GameLibrary/Steam as a Steam storage library. You only need to mount your games drive at /mnt/games; there is no need to browse through Steam's storage settings and add the folder yourself.
If you already use other Steam library folders, they are left in place. Steam Headless adds its mounted library without replacing your existing entries or forgetting their installed games.
Share one library safely
Several Steam Headless containers can share /mnt/games, which saves storage space and avoids downloading a separate copy of every game for every player. Use the same desktop user and group options for all containers that need to update the shared library. Different IDs can leave one container able to see games but unable to install updates or create new files.
Stop the other containers before installing, updating, verifying, moving, or deleting games in a shared library. Steam does not support several containers changing the same game files at once, and an interrupted update can leave the shared copy needing repair.
Keep home and appliance state separate
Give every container its own home directory and appliance-state volume. Never point /home/steamheadless and /var/lib/steam-headless at the same host directory, and never share either one between containers. The home contains personal desktop settings, Steam sign-in details, Proton data, saves, and installed Flatpak apps. The smaller appliance-state volume contains the container's setup and security information.
Use an empty, dedicated location for appliance state. Steam Headless deliberately refuses to use an unfamiliar non-empty folder so that it cannot mistake personal files for its own state.
If you need to reset Steam Headless authentication, keep /home/steamheadless and /mnt/games intact. Deleting the home can remove desktop settings, Steam sign-in data, Proton prefixes, local saves, Flatpak apps, and Sunshine client pairings. Follow the password and enrolment recovery steps and reset only the authentication information described there.
User permissions and UID/GID mapping
The container desktop session runs under the non-root user steamheadless. To prevent permission conflicts when creating files on your host storage:
-
Set the
PUIDandPGIDoptions:environment:PUID: '1000'PGID: '1000'Use the numeric user ID and group ID of your host user account. Find yours by running
id -uandid -gon the host. -
Set host directory ownership: Before starting the container for the first time, grant ownership of your storage directories to UID/GID
1000:sudo chown -R 1000:1000 ./data/homes /mnt/storage/games
SELinux volume relabelling (:Z vs :z)
On Linux distributions with SELinux enabled in enforcing mode (such as Fedora Server, Red Hat Enterprise Linux, or CentOS Stream), Docker must apply appropriate SELinux security contexts to mounted volumes.
Steam Headless uses two distinct flags:
services:
desktop-a:
volumes:
- steam-headless-a-state:/var/lib/steam-headless
- steam-headless-a-journal:/var/log/journal
# Uppercase :Z assigns a private SELinux category
- ./data/homes/desktop-a:/home/steamheadless:Z
# Lowercase :z allows containers to share the label
- /mnt/storage/games:/mnt/games:z
volumes:
steam-headless-a-state:
steam-headless-a-journal:
:Z(Private): Configures a unique, unshared SELinux Multi-Category Security (MCS) label. Only this specific container can access the files. Use:Zfor/home/steamheadless.:z(Shared): Configures a shared SELinux label. Multiple containers can read and write to the same directory simultaneously. Use:zfor/mnt/games.
On hosts running AppArmor or no Linux Security Module (such as Ubuntu Server, Debian Server, or Unraid), the :Z and :z flags are safely ignored by Docker.
Mounting network storage (NFS, SMB & NAS)
You can store your game library on a Network Attached Storage (NAS) server (such as TrueNAS, Synology, or Unraid) and mount it into your Steam Headless containers.
The Proton filesystem rule
Proton (Wine) requires full Linux POSIX filesystem semantics, including:
- Case-sensitive filenames;
- True symbolic links and hard links;
- POSIX file locking and execution permissions.
Placing /home/steamheadless or Proton prefixes (compatdata) directly onto Windows SMB shares, NTFS drives, or FAT32 filesystems causes immediate game launch failures, silent crashes, or prefix corruption.
Best Practice:
- Keep
/home/steamheadless(and all Proton prefixes) on a native Linux filesystem (ext4, XFS, Btrfs, or ZFS). - Mount your network share exclusively as
/mnt/gamesto hold downloaded game content files (steamapps/common/).
Example: Mounting an NFS game share
-
Mount the NFS export on the host (e.g. in
/etc/fstab):192.168.1.10:/mnt/tank/games /mnt/nas-games nfs rw,hard,intr,noatime 0 0 -
Bind-mount the host mount point into Docker Compose:
volumes:- /mnt/nas-games:/mnt/games:z
Complete Docker Compose device and volume template
services:
desktop-a:
image: josh5/steam-headless:2
container_name: steam-headless-a
restart: unless-stopped
privileged: false
cap_add:
- DAC_READ_SEARCH
- NET_ADMIN
- SYS_ADMIN
- SYS_NICE
- SYS_PTRACE
security_opt:
- seccomp=unconfined
- systempaths=unconfined
- writable-cgroups=true
cgroup: private
pids_limit: 8192
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
device_cgroup_rules:
- 'c 13:* rwm'
tmpfs:
- /run
- /run/lock
- /tmp
- /dev/input:rw,dev,mode=0755
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-a-state:/var/lib/steam-headless
- steam-headless-a-journal:/var/log/journal
- ./data/homes/desktop-a:/home/steamheadless:Z
- /mnt/storage/games:/mnt/games:z
volumes:
steam-headless-a-state:
steam-headless-a-journal:
Verification and troubleshooting
After starting your container, verify device access and filesystem permissions:
-
Verify game library read/write access:
sudo docker compose exec desktop-a touch /mnt/games/test-write && \sudo docker compose exec desktop-a rm /mnt/games/test-writeIf this succeeds without permission errors, the container user can read and write game files.
-
Verify virtual input devices:
sudo docker compose exec desktop-a ls -la /dev/uinput /dev/uhidEnsure both character devices are present and accessible.
If you encounter permission errors or controllers are not detected by games, consult Input and audio troubleshooting or Installation and startup troubleshooting.