Manage your own Sunshine configuration
Steam Headless includes Sunshine for streaming to Moonlight on PCs, phones, tablets, televisions, and handhelds. The normal settings work automatically. Use this page when you want to understand the integration or change Sunshine's applications and advanced streaming choices.
Architectural overview: How Sunshine runs
Sunshine runs as steam-headless-sunshine.service. Steam Headless starts it as the desktop user and the web interface can safely restart it for you.
Key operational characteristics:
- Direct Wayland capture: Sunshine attaches directly to KWin's virtual Wayland output via PipeWire screencast interfaces, capturing game frames with hardware acceleration without requiring a dummy HDMI plug or physical display.
- Hardware encoding: Sunshine uses hardware video encoding (Intel VA-API
iHD/i965, AMD MesaradeonsiVA-API, or NVIDIA NVENC) to compress frames with sub-millisecond pipeline latency. - Input integration: When a Moonlight client sends gamepad, mouse, or keyboard events, Sunshine writes them directly to
/dev/uinput. The container input service exposes them only inside that container; the virtual seat name is generated automatically. - Low-latency PipeWire audio: Sunshine hooks into PipeWire to capture desktop audio streams directly from the digital sink before audio leaves the container.
Accessing the Sunshine web UI securely via the Web Interface
Sunshine includes its own administration interface on port 47990, but Steam Headless keeps that interface inside the container. Use the protected Sunshine page in the web interface rather than exposing or browsing to port 47990 directly.
The authenticated reverse proxy
The web interface provides a built-in, secure reverse proxy for Sunshine accessible at:
https://<container-ip>:8483/sunshine
Why use the integrated reverse proxy?
- One sign-in: Access through the web interface uses your Steam Headless sign-in. Steam Headless manages Sunshine's internal password automatically.
- Encrypted transport: The connection is secured with the container's TLS certificate without exposing unencrypted internal HTTP ports on your local network.
- Integrated navigation: You can transition between the Dashboard, container journal logs, and Sunshine configuration with a single click in the navigation bar.
Pairing Moonlight clients: Step-by-step workflow
To stream games from Steam Headless to a Moonlight client (on iOS, Android, Steam Deck, Apple TV, or a PC), pair your client device using Sunshine's secure PIN verification:
Step 1: Open Moonlight on your client device
Launch Moonlight on your target device. Because each Steam Headless container has its own dedicated macvlan IP address, Moonlight automatically discovers the container on your local network and displays its configured Moonlight name.
If your Moonlight client is on a different VLAN or subnet where mDNS broadcasts are blocked, click the Add Host manually button in Moonlight and enter the container's IP address (for example: 192.168.1.50).
Step 2: Obtain the pairing PIN
Click on the discovered Steam Headless host in Moonlight. Moonlight will display a 4-digit numeric PIN (for example: 4829) and wait for authorization.
Step 3: Authorise the PIN in the Web Interface
- Open your web browser and log in to the web interface at
https://<container-ip>:8483. - Click on the Sunshine tab in the main navigation (or open
https://<container-ip>:8483/sunshine). - In the Sunshine navigation bar, select PIN.
- Enter the 4-digit PIN displayed in Moonlight into the PIN field.
- Click Send.
Step 4: Verification
Within two seconds, Sunshine validates the cryptographic handshake. In Moonlight, the host tile updates to show an unlocked green padlock icon. Click the host to see the list of available applications (Desktop and Steam Big Picture) and begin streaming immediately.
Audio sink management and multi-channel surround sound
Sunshine captures audio in real time using container-local PipeWire sound servers.
Virtual audio pipeline flow
- Automatic digital sink initialisation: When the desktop session starts, PipeWire and WirePlumber create a headless virtual audio sink. Game audio streams automatically bind to this default output.
- Surround sound configuration: Sunshine supports stereo (2.0), 5.1 surround, and 7.1 surround audio streams. When Moonlight requests surround sound playback, Sunshine requests the corresponding multi-channel audio format from PipeWire.
- Stream mute behaviour: Audio is processed exclusively in memory. When you disconnect from Moonlight, Sunshine automatically pauses audio capture; when you reconnect, audio resumes instantly without requiring sound daemon restarts.
Comparing native browser streaming vs Sunshine / Moonlight
Steam Headless provides two independent streaming paths. Choose the streaming method best suited to your immediate device and use case:
| Feature | Native Browser Streaming | Sunshine / Moonlight Streaming |
|---|---|---|
| Client Requirement | Zero-install web browser (Chrome, Edge, Firefox, Safari) | Moonlight client app (Installed from App Store / package manager) |
| Primary Protocol | WebRTC (UDP/8483) or WebSocket (TCP/8483) | GameStream protocol (RTSP TCP / Enet UDP) |
| Multi-Viewer Support | Yes: Multiple viewers can connect simultaneously to spectate or share control | No: Exclusive 1:1 connection between client and host |
| Hardware Controller Support | Standard Gamepad API (Xbox / PlayStation layout) | Xbox 360-style controller with standard controls and rumble |
| High Refresh Rates | Up to 120 Hz (depending on browser display synchronization) | Up to 240+ Hz with dedicated hardware frame pacing |
| Administrative Controls | Integrated dashboard, systemd service restarts, journal viewer, capacity telemetry | Game launching and stream playback only |
| Best Used For | Quick access, Chromebooks, work laptops, administration, multiplayer couch spectating | Primary gaming sessions, handheld gaming consoles (Steam Deck), TV streaming boxes (Apple TV / Shield) |
Custom Sunshine configuration and file overrides
When you pair Moonlight clients or configure custom settings in Sunshine's web UI, Sunshine persists its state inside the container's user home directory:
/home/steamheadless/.config/sunshine/
├── apps.json # Custom application definitions and launch commands
└── sunshine.conf # Streaming parameters, audio sinks, and encoder preferences
Because /home/steamheadless is mounted from a persistent volume on your host (e.g. ./data/homes/container-a), all paired Moonlight clients, custom application shortcuts, and encoder adjustments are preserved across container updates and restarts.
Adding custom applications (apps.json)
By default, Sunshine exposes shortcuts to the Desktop and Steam Big Picture. You can add dedicated launchers for standalone games, emulators, or Flatpaks via the Sunshine web UI (Applications → Add New) or by editing apps.json:
{
"env": {
"PATH": "$(PATH):/usr/bin:/app/bin"
},
"apps": [
{
"name": "Desktop",
"image-path": "desktop.png"
},
{
"name": "Steam Big Picture",
"output": "",
"cmd": "steam steam://open/bigpicture",
"image-path": "steam.png"
},
{
"name": "RetroArch",
"output": "",
"cmd": "flatpak run org.libretro.RetroArch",
"image-path": "retroarch.png"
}
]
}
Keep your renderer and encoder choices
Steam Headless normally keeps Sunshine matched to the container's encoder GPU and reapplies its required capture and encoder settings whenever the container starts. This is the safest choice for most people.
If you want to choose Sunshine's renderer or encoder yourself in its Configuration page, or manage its application catalogue manually without the container synchronising detected launchers, use the SUNSHINE_ENABLE_AUTO_CONFIG option and recreate the container:
environment:
SUNSHINE_ENABLE_AUTO_CONFIG: 'false'
Without this override, your renderer choice in Sunshine can appear to save but will be replaced by the container's encoder GPU at the next container start, and installed launchers will be automatically discovered and added to Sunshine. Setting SUNSHINE_ENABLE_AUTO_CONFIG: 'false' keeps your custom applications and renderer selections untouched. Steam Headless still protects the settings needed for web interface sign-in and proxy access.
Automatic display mode switching
By default, Sunshine is configured to automatically adjust the virtual desktop display mode and refresh rate to match Moonlight client stream requests using steam-headless-set-display-mode in Sunshine's global preparation commands.
This feature depends on SUNSHINE_ENABLE_AUTO_CONFIG=true. When auto configuration is set to false, Steam Headless leaves Sunshine's configuration untouched on container startup and does not register or update preparation commands; you can still add any desired commands manually in Sunshine's Configuration page.
If you keep auto configuration enabled but prefer to keep the virtual display resolution fixed or handle display modes manually, set SUNSHINE_ENABLE_AUTO_DISPLAY_MODE to 'false':
environment:
SUNSHINE_ENABLE_AUTO_DISPLAY_MODE: 'false'
Advanced streaming parameters (sunshine.conf)
For power users seeking fine-grained control over network packet sizing or audio bitrates, use Sunshine's Configuration page in the web interface. Direct file editing is harder to recover from and is not needed for normal use.
Restart Sunshine from the Services & Logs page if a saved change does not take effect immediately. Terminal users can run:
docker exec steam-headless-a systemctl restart steam-headless-sunshine.service