Skip to main content

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.

Terminal
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
Prerequisites for macvlan network

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.

Container hostname and discovery

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 / OptionPurposeWhy it is required
--name steam-headless-aContainer nameUniquely identifies the container instance in Docker management commands and logs.
--hostname steam-headless-aNetwork host nameMachine name advertised to Moonlight, Steam Link, and local discovery clients.
--restart unless-stoppedRestart policyKeeps the container running automatically across host restarts unless explicitly stopped.
--privileged=falseSecurity boundaryEnsures the container remains unprivileged and cannot manipulate host kernel registers or physical drives.
--pids-limit 8192Task capacityAllows a full desktop, launchers, browsers, games, and their threads while retaining a container boundary against runaway task creation.
--cgroupns private & --security-opt writable-cgroups=truePrivate writable cgroupsIn Docker 28+, this gives systemd a writable cgroup v2 tree without exposing or bind-mounting the host's /sys/fs/cgroup.
--security-opt seccomp=unconfinedSandbox syscallsPermits system calls like pivot_root used by Steam's pressure-vessel and Flatpak's bubblewrap.
--security-opt systempaths=unconfinedUnmasked /procAllows nested sandboxes to mount container-internal /proc filesystems safely.
--cap-add SYS_ADMINMount capabilitiesRequired by systemd for service sandbox mounts and FUSE filesystem mounting.
--cap-add SYS_PTRACEProcess tracingAllows shinputd to call pidfd_getfd(2) to attach to uinput file descriptors created by game processes.
--cap-add NET_ADMINNetwork netlinkRequired by shinputd to emit internal libudev netlink multicast events.
--cap-add DAC_READ_SEARCHDescriptor inspectionGrants shinputd permission to inspect user-owned file descriptors.
--cap-add SYS_NICEReal-time schedulingEnables RealtimeKit (rtkit) to elevate PipeWire audio thread priorities for crackle-free audio.
--stop-signal SIGRTMIN+3Systemd shutdownSignals systemd to shut down services, terminate games cleanly, and flush disk buffers.
--stop-timeout 30Shutdown grace periodGrants processes up to 30 seconds to exit gracefully before Docker terminates them.
--shm-size 2gShared memory poolProvides sufficient memory for Wayland surface buffers, PipeWire audio, and browser tabs.
-tAllocate a TTYRequired by systemd's console initialisation.
--device /dev/dri/renderD128DRM render nodePasses the physical GPU render node for Vulkan/OpenGL acceleration and hardware video encoding.
--device /dev/fuseFUSE filesystemEnables running AppImages and user-space filesystems.
--device /dev/uinput & /dev/uhidVirtual inputAllows Sunshine and Steam to emulate gamepads, joysticks, keyboards, and mice.
--device-cgroup-rule "c 13:* rwm"Dynamic event minorsAllows access to dynamic /dev/input/event* devices allocated when controllers connect.
--tmpfs /run, /run/lock, /tmpRuntime tmpfsTemporary system directories recreated cleanly on container startup.
--tmpfs /dev/input:rw,dev,mode=0755Seat-isolated inputAllocates a private, in-memory input device tree isolated from other containers and the host.
-v ... (Volumes)Persistent storageMounts timezone, input discovery, appliance state, system journal, user profile, and games library.
-e ... (Environment)User ownership IDsSets user ownership IDs (PUID/PGID); advanced display, streaming, and session options can be added from the container options reference.
--network & --ipNetwork configurationAttaches 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:

Terminal
sudo docker logs -f steam-headless-a

Stopping and restarting​

To stop the session cleanly:

Terminal
sudo docker stop steam-headless-a

To restart the existing container:

Terminal
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:

  1. Stop the running container:
    sudo docker stop steam-headless-a
  2. Remove the old container instance:
    sudo docker rm steam-headless-a
  3. Pull the updated image from the registry:
    sudo docker pull josh5/steam-headless:2
  4. Re-execute the complete docker run command with all original parameters intact.
Save your run command

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.