Skip to main content
Not all applications behave the same way. This guide provides configuration examples to help you add games and applications to Sunshine.
Throughout these examples, fields not shown are left blank. You can enhance your experience by adding an image via the Image field or logging output via the Output field.
When a working directory is not specified, it defaults to the folder where the target application resides. Specify a working directory explicitly if the application requires specific paths for assets or configuration files.

Common Launchers

Desktop

The most basic configuration streams your entire desktop:
FieldValue
Application NameDesktop
Imagedesktop.png

Steam Big Picture

Steam is launched as a detached command because Steam’s launcher process self-updates and the original process terminates.
FieldValue
Application NameSteam Big Picture
Command Preparations → Undosteam://close/bigpicture
Detached Commandssteam://open/bigpicture
Imagesteam.png
On Linux and FreeBSD, use setsid to properly detach the Steam process from Sunshine’s control.

Steam Games

Steam games can be launched using URI schemes or direct binary execution. This method is the most consistent across platforms and games:
FieldValue
Application NameSurviving Mars
Detached Commandssteam://rungameid/464920
Find a game’s Steam App ID by visiting its store page. The ID is in the URL: https://store.steampowered.com/app/464920/

Using Game Binary with Working Directory

FieldValue
Application NameSurviving Mars
CommandMarsSteam.exe
Working DirectoryC:\Program Files (x86)\Steam\steamapps\common\Surviving Mars

Using Game Binary with Full Path

FieldValue
Application NameSurviving Mars
CommandC:\Program Files (x86)\Steam\steamapps\common\Surviving Mars\MarsSteam.exe

Epic Games Store

The URI method provides the most consistent behavior:
FieldValue
Application NameSurviving Mars
Commandcom.epicgames.launcher://apps/d759128018124dcabb1fbee9bb28e178%3A20729b9176c241f0b617c5723e70ec2d%3AOvenbird?action=launch&silent=true
Find the Epic Games URI by checking the game’s shortcut properties or looking in the Epic Games Launcher’s web requests.

Using Game Binary

FieldValue
Application NameSurviving Mars
CommandMarsEpic.exe
Working DirectoryC:\Program Files\Epic Games\SurvivingMars

Prep Commands

Prep commands execute before starting an application and can clean up when the application closes. Common uses include changing resolution, refresh rate, or launching supporting processes.

Resolution and Refresh Rate Changes

Dynamically adjust display settings based on Moonlight client capabilities using environment variables:
  • ${SUNSHINE_CLIENT_WIDTH} - Client’s requested width
  • ${SUNSHINE_CLIENT_HEIGHT} - Client’s requested height
  • ${SUNSHINE_CLIENT_FPS} - Client’s requested frame rate

Linux (X11)

Prep StepCommand
Dosh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"
Undoxrandr --output HDMI-1 --mode 3840x2160 --rate 120
Replace HDMI-1 with your display output name. Find it by running xrandr without arguments.

Linux (Wayland/wlroots)

For wlroots-based compositors (Hyprland, Sway, etc.):
Prep StepCommand
Dosh -c "wlr-xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz"
Undowlr-xrandr --output HDMI-1 --mode 3840x2160@120Hz
wlr-xrandr only works with wlroots-based compositors. GNOME and KDE require different tools.

Linux (KDE Plasma)

Works on both Wayland and X11:
Prep StepCommand
Dosh -c "kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}"
Undokscreen-doctor output.HDMI-A-1.mode.3840x2160@120
Find your display name and supported modes by running kscreen-doctor -o.
Display names differ between X11 and Wayland. A monitor might be HDMI-A-0 on X11 but HDMI-A-1 on Wayland.

Linux (GNOME on Wayland)

Requires displayconfig-mutter:
Prep StepCommand
Dosh -c "displayconfig-mutter set --connector HDMI-1 --resolution ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --refresh-rate ${SUNSHINE_CLIENT_FPS} --hdr ${SUNSHINE_CLIENT_HDR}"
Undodisplayconfig-mutter set --connector HDMI-1 --resolution 3840x2160 --refresh-rate 120 --hdr false
HDR support requires GNOME 48+. Check support with displayconfig-mutter list. Remove the --hdr flag if your display doesn’t support it.

Linux (NVIDIA GPUs)

For NVIDIA proprietary drivers:
Prep StepCommand
Dosh -c "nvidia-settings -a CurrentMetaMode=\"HDMI-1: nvidia-auto-select { ViewPortIn=${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}, ViewPortOut=${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}+0+0 }\""
Undonvidia-settings -a CurrentMetaMode="HDMI-1: nvidia-auto-select { ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0 }"

macOS

Requires displayplacer:
Prep StepCommand
Dosh -c "displayplacer \"id:<screenId> res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:${SUNSHINE_CLIENT_FPS} scaling:on origin:(0,0) degree:0\""
Undodisplayplacer "id:<screenId> res:3840x2160 hz:120 scaling:on origin:(0,0) degree:0"
Replace <screenId> with your display’s ID. Run displayplacer list to find it.

Windows

Sunshine has built-in support for resolution changes on Windows. For third-party tools, you can use QRes:
Prep StepCommand
Docmd /C "C:\Tools\qres.exe /x:%SUNSHINE_CLIENT_WIDTH% /y:%SUNSHINE_CLIENT_HEIGHT% /r:%SUNSHINE_CLIENT_FPS%"
UndoC:\Tools\qres.exe /x:3840 /y:2160 /r:120
QRes must be downloaded separately.

Platform-Specific Considerations

Linux (Flatpak)

Flatpak packages run in a sandboxed environment. All commands must be prefixed with flatpak-spawn --host.
Example:
flatpak-spawn --host xrandr --output HDMI-1 --mode 1920x1080

Windows (Elevated Commands)

If Sunshine is installed as a service (default), you can launch applications with administrative privileges without UAC prompts:
{
  "name": "Game With AntiCheat",
  "cmd": "C:\\Games\\game.exe",
  "elevated": true,
  "prep-cmd": [
    {
      "do": "powershell.exe -command \"Start-Service GameService\"",
      "undo": "powershell.exe -command \"Stop-Service GameService\"",
      "elevated": false
    }
  ]
}
The elevated option can be set independently for the main command and each prep command.

Build docs developers (and LLMs) love