Deploy with docker run
While Docker Compose is the recommended deployment method for Steam Headless, you can also launch a session directly using the standard docker run command-line interface.
This method is ideal for quick smoke tests, temporary evaluations, or automated provisioning scripts where Docker Compose is not available.
The command includes a working set of environment options. Use the container options reference to understand or customise them.
The timezone mount lets Steam Headless detect the host's timezone. You can choose one explicitly by adding -e TZ="Europe/London" to the command; a valid IANA TZ takes precedence over the host mount, with Etc/UTC as the final fallback. See Timezone for details.
Single-container docker run command
Below is the complete docker run command for launching a Steam Headless container on an Intel or AMD GPU.
sudo docker run -d \
--name steam-headless-a \
--hostname steam-headless-a \
--restart unless-stopped \
--privileged=false \
--pids-limit 8192 \
--cgroupns private \
--security-opt writable-cgroups=true \
--security-opt seccomp=unconfined \
--security-opt systempaths=unconfined \
--cap-add DAC_READ_SEARCH \
--cap-add NET_ADMIN \
--cap-add SYS_ADMIN \
--cap-add SYS_NICE \
--cap-add SYS_PTRACE \
--stop-signal SIGRTMIN+3 \
--stop-timeout 30 \
--shm-size 2g \
-t \
--device /dev/dri/renderD128:/dev/dri/renderD128 \
--device /dev/fuse:/dev/fuse \
--device /dev/uinput:/dev/uinput \
--device /dev/uhid:/dev/uhid \
--device-cgroup-rule "c 13:* rwm" \
--tmpfs /run \
--tmpfs /run/lock \
--tmpfs /tmp \
--tmpfs /dev/input:rw,dev,mode=0755 \
-v /etc/localtime:/run/host-localtime:ro \
-v /sys/devices/virtual/input:/sys/devices/virtual/input:ro \
-v steam-headless-a-state:/var/lib/steam-headless \
-v steam-headless-a-journal:/var/log/journal \
-v /var/lib/docker/volumes/steam-headless-home-a/_data:/home/steamheadless:Z \
-v /mnt/storage/games:/mnt/games:z \
-e PUID="1000" \
-e PGID="1000" \
--network session-lan \
--ip 192.168.1.50 \
josh5/steam-headless:2
Before specifying --network session-lan --ip 192.168.1.50, ensure the Docker macvlan network has already been created on your host. See the Macvlan networking guide for network creation instructions. For single-container testing without macvlan, you can substitute --network host.
The --hostname flag sets the network hostname for the container. Steam Remote Play, Steam Link, Sunshine / Moonlight, and local network discovery use this hostname as the machine name advertised to remote clients on your local network. Customise --hostname to whatever name you want remote streaming clients to see.
Command options explained
Every argument in the command corresponds directly to a technical requirement of the Steam Headless runtime:
| Flag / Option | Purpose | Why it is required |
|---|---|---|
--name steam-headless-a | Container name | Uniquely identifies the container instance in Docker management commands and logs. |
--hostname steam-headless-a | Network host name | Machine name advertised to Moonlight, Steam Link, and local discovery clients. |
--restart unless-stopped | Restart policy | Keeps the container running automatically across host restarts unless explicitly stopped. |
--privileged=false | Security boundary | Ensures the container remains unprivileged and cannot manipulate host kernel registers or physical drives. |
--pids-limit 8192 | Task capacity | Allows a full desktop, launchers, browsers, games, and their threads while retaining a container boundary against runaway task creation. |
--cgroupns private & --security-opt writable-cgroups=true | Private writable cgroups | In Docker 28+, this gives systemd a writable cgroup v2 tree without exposing or bind-mounting the host's /sys/fs/cgroup. |
--security-opt seccomp=unconfined | Sandbox syscalls | Permits system calls like pivot_root used by Steam's pressure-vessel and Flatpak's bubblewrap. |
--security-opt systempaths=unconfined | Unmasked /proc | Allows nested sandboxes to mount container-internal /proc filesystems safely. |
--cap-add SYS_ADMIN | Mount capabilities | Required by systemd for service sandbox mounts and FUSE filesystem mounting. |
--cap-add SYS_PTRACE | Process tracing | Allows shinputd to call pidfd_getfd(2) to attach to uinput file descriptors created by game processes. |
--cap-add NET_ADMIN | Network netlink | Required by shinputd to emit internal libudev netlink multicast events. |
--cap-add DAC_READ_SEARCH | Descriptor inspection | Grants shinputd permission to inspect user-owned file descriptors. |
--cap-add SYS_NICE | Real-time scheduling | Enables RealtimeKit (rtkit) to elevate PipeWire audio thread priorities for crackle-free audio. |
--stop-signal SIGRTMIN+3 | Systemd shutdown | Signals systemd to shut down services, terminate games cleanly, and flush disk buffers. |
--stop-timeout 30 | Shutdown grace period | Grants processes up to 30 seconds to exit gracefully before Docker terminates them. |
--shm-size 2g | Shared memory pool | Provides sufficient memory for Wayland surface buffers, PipeWire audio, and browser tabs. |
-t | Allocate a TTY | Required by systemd's console initialisation. |
--device /dev/dri/renderD128 | DRM render node | Passes the physical GPU render node for Vulkan/OpenGL acceleration and hardware video encoding. |
--device /dev/fuse | FUSE filesystem | Enables running AppImages and user-space filesystems. |
--device /dev/uinput & /dev/uhid | Virtual input | Allows Sunshine and Steam to emulate gamepads, joysticks, keyboards, and mice. |
--device-cgroup-rule "c 13:* rwm" | Dynamic event minors | Allows access to dynamic /dev/input/event* devices allocated when controllers connect. |
--tmpfs /run, /run/lock, /tmp | Runtime tmpfs | Temporary system directories recreated cleanly on container startup. |
--tmpfs /dev/input:rw,dev,mode=0755 | Seat-isolated input | Allocates a private, in-memory input device tree isolated from other containers and the host. |
-v ... (Volumes) | Persistent storage | Mounts timezone, input discovery, appliance state, system journal, user profile, and games library. |
-e ... (Environment) | User ownership IDs | Sets user ownership IDs (PUID/PGID); advanced display, streaming, and session options can be added from the container options reference. |
--network & --ip | Network configuration | Attaches the container to macvlan (or host) networking with a dedicated IP address. |
Container lifecycle and limitations
Checking logs and container health
To monitor the startup sequence:
sudo docker logs -f steam-headless-a
Stopping and restarting
To stop the session cleanly:
sudo docker stop steam-headless-a
To restart the existing container:
sudo docker start steam-headless-a
Updating to a newer image
When using docker run, updating the container image is a multi-step manual process:
- Stop the running container:
sudo docker stop steam-headless-a
- Remove the old container instance:
sudo docker rm steam-headless-a
- Pull the updated image from the registry:
sudo docker pull josh5/steam-headless:2
- Re-execute the complete
docker runcommand with all original parameters intact.
Because docker run requires numerous capability, device, and mount flags, we strongly advise saving your complete command into a shell script (e.g. start-steam-headless.sh) to prevent accidental misconfigurations during updates.
Next steps
- Docker Compose: Consider migrating to Docker Compose for automated updates and multi-container orchestration.
- Choose a network mode: Explore the differences between macvlan and host networking.
- First run: Log in to the web interface and configure your initial credentials.
- Container options: Customise screen resolutions, frame rates, and encoder profiles.