Sunshinemaster
Sunshine master
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
Configuration

Host authority
By providing the host authority (URI + port), you can easily open each configuration option in the config UI.
Host authority:

Sunshine will work with the default settings for most users. In some cases you may want to configure Sunshine further.

The default location for the configuration file is listed below. You can use another location if you choose, by passing in the full configuration file path as the first argument when you start Sunshine.

Example

sunshine ~/sunshine_config.conf

The default location of the apps.json is the same as the configuration file. You can use a custom location by modifying the configuration file.

Default Config Directory

OS Location
Docker
/config
FreeBSD
~/.config/sunshine
Linux
~/.config/sunshine
macOS
~/.config/sunshine
Windows
%ProgramFiles%\\Sunshine\\config

Although it is recommended to use the configuration UI, it is possible manually configure Sunshine by editing the conf file in a text editor. Use the examples as reference.

The web UI groups these settings into the sidebar categories documented below. Encoder categories are shown only when supported on the current platform.

Permissions on every platform

Open Troubleshooting > Permissions in the Web UI to see required and optional access for the current platform. The Home page flags verifiable required access that is missing. Sunshine checks for access granted while it is running and restarts once after all verifiable required access is available. On Unix, adding a user to a group takes effect only after a new login session; Sunshine cannot detect the new group membership in the existing process.

On Linux and FreeBSD, virtual keyboard, mouse, and gamepad input need read and write access to /dev/uinput (Linux also checks /dev/input/uinput). The Web UI shows setup steps if that access is missing. On Windows, Sunshine checks whether its account can list and create files in the config directory beside the executable. Windows provides no consent prompt for directory ACLs, so the Web UI shows setup steps for correcting access.

General

locale

DescriptionThe locale used for Sunshine's user interface.
Default
en
Example
locale = en
ChoicesbgBulgarian
csCzech
deGerman
enEnglish
en_GBEnglish (UK)
en_USEnglish (United States)
esSpanish
frFrench
itItalian
jaJapanese
koKorean
plPolish
ptPortuguese
pt_BRPortuguese (Brazilian)
ruRussian
svSwedish
trTurkish
ukUkranian
zhChinese (Simplified)
zh_TWChinese (Traditional)

sunshine_name

DescriptionThe name displayed by Moonlight.
DefaultPC hostname
Example
sunshine_name = Sunshine

min_log_level

DescriptionThe minimum log level printed to standard out.
Default
info
Example
min_log_level = info
ChoicesverboseAll logging message.
Attention
This may negatively affect streaming performance.
debugDebug log messages and higher.
Attention
This may negatively affect streaming performance.
infoInformational log messages and higher.
warningWarning log messages and higher.
errorError log messages and higher.
fatalOnly fatal log messages.
noneNo log messages.

global_prep_cmd

DescriptionA list of commands to be run before/after all applications. If any of the prep-commands fail, starting the application is aborted.
Default
[]
Example
global_prep_cmd = [{"do":"nircmd.exe setdisplay 1280 720 32 144","elevated":true,"undo":"nircmd.exe setdisplay 2560 1440 32 144"}]

notify_pre_releases

DescriptionWhether to be notified of new pre-release versions of Sunshine.
Default
disabled
Example
notify_pre_releases = disabled

system_tray

DescriptionShow icon in system tray and display desktop notifications
Default
enabled
Example
system_tray = enabled

Input

controller

DescriptionWhether to allow controller input from the client.
Default
enabled
Example
controller = enabled

gamepad_driver

DescriptionControls which virtual gamepad backend Sunshine may use on Windows and macOS. On Windows, the Web UI and startup notification request a choice while this option is not set. If Sunshine detects an active Virtual HID Broker license on Windows, it automatically sets this option to all when it is missing.
Warning
ViGEmBus has limited gamepad features, supports only Xbox 360 and DualShock 4 emulation, and has reached end of life. Selecting vigembus also suppresses Virtual HID Broker startup notifications.
Note
all and vigembus apply only to Windows. On macOS, an unset value uses Virtual HID Broker.
Default
not set
Example
gamepad_driver = all
ChoicesallWindows only: prefer Virtual HID Broker when it is available and licensed, with ViGEmBus as a limited fallback.
virtualhidUse Virtual HID Broker for gamepads. An active paid license is required; Windows ViGEmBus fallback is disabled.
vigembusWindows only: use ViGEmBus for gamepads and hide Virtual HID Broker status and licensing details.
noneDisable virtual gamepads on Windows and macOS without changing keyboard or mouse input. Suppress broker and driver choice notices.

gamepad

DescriptionThe type of gamepad to emulate on the host. Automatic selection uses the controller type reported by the client. If the type is unknown, Sunshine can select a PlayStation-style controller from reported motion or touchpad support; otherwise it uses an Xbox-style controller.
Note
When gamepad_driver is vigembus on Windows, only auto, x360, and ds4 are available.
Default
auto
Example
gamepad = auto
ChoicesgenericGeneric HID gamepad
ds4DualShock 4 controller (PS4)
ds5DualShock 5 controller (PS5)
switchSwitch Pro controller
x360Xbox 360 controller
xoneXbox One controller
xseriesXbox Series controller

ds4_back_as_touchpad_click

DescriptionAllow Select/Back inputs to also trigger a PlayStation-style gamepad touchpad click. Useful for clients looking to emulate touchpad click on XInput devices.
Hint
Applies to ds4, ds5, and automatically selected PlayStation-style gamepads.
Default
enabled
Example
ds4_back_as_touchpad_click = enabled

motion_as_ds4

DescriptionIf a client reports that a connected gamepad has motion sensor support, emulate it on the host as a PlayStation-style controller.

When disabled, motion sensors will not be taken into account during gamepad type selection.
Hint
Only applies when gamepad is set to auto.
Default
enabled
Example
motion_as_ds4 = enabled

touchpad_as_ds4

DescriptionIf a client reports that a connected gamepad has a touchpad, emulate it on the host as a PlayStation-style controller.

When disabled, touchpad presence will not be taken into account during gamepad type selection.
Hint
Only applies when gamepad is set to auto.
Default
enabled
Example
touchpad_as_ds4 = enabled

virtualhid_randomize_mac

DescriptionRandomize the MAC address for PlayStation-style virtual controllers created by libvirtualhid.
Default
enabled
Example
virtualhid_randomize_mac = enabled

back_button_timeout

DescriptionIf the Back/Select button is held down for the specified number of milliseconds, a Home/Guide button press is emulated.
Tip
If back_button_timeout < 0, then the Home/Guide button will not be emulated.
Default
-1
Example
back_button_timeout = 2000

keyboard

DescriptionWhether to allow keyboard input from the client.
Default
enabled
Example
keyboard = enabled

key_repeat_delay

DescriptionThe initial delay, in milliseconds, before repeating keys. Controls how fast keys will repeat themselves.
Default
500
Example
key_repeat_delay = 500

key_repeat_frequency

DescriptionHow often keys repeat every second.
Tip
This configurable option supports decimals.
Default
24.9
Example
key_repeat_frequency = 24.9

always_send_scancodes

DescriptionSending scancodes enhances compatibility with games and apps but may result in incorrect keyboard input from certain clients that aren't using a US English keyboard layout.

Enable if keyboard input is not working at all in certain applications.

Disable if keys on the client are generating the wrong input on the host.
Caution
Applies to Windows only.
Default
enabled
Example
always_send_scancodes = enabled

key_rightalt_to_key_win

DescriptionIt may be possible that you cannot send the Windows Key from Moonlight directly. In those cases it may be useful to make Sunshine think the Right Alt key is the Windows key.
Default
disabled
Example
key_rightalt_to_key_win = enabled

mouse

DescriptionWhether to allow mouse input from the client.
Default
enabled
Example
mouse = enabled

high_resolution_scrolling

DescriptionWhen enabled, Sunshine will pass through high resolution scroll events from Moonlight clients.
This can be useful to disable for older applications that scroll too fast with high resolution scroll events.
Default
enabled
Example
high_resolution_scrolling = enabled

native_pen_touch

DescriptionWhen enabled, Sunshine will pass through native pen/touch events from Moonlight clients.
This can be useful to disable for older applications without native pen/touch support.
Default
enabled
Example
native_pen_touch = enabled

keybindings

DescriptionSometimes it may be useful to map keybindings. Wayland won't allow clients to capture the Win Key for example.
Tip
See virtual key codes
Hint
keybindings needs to have a multiple of two elements.
Default
[
0x10, 0xA0,
0x11, 0xA2,
0x12, 0xA4
]
Example
keybindings = [
0x10, 0xA0,
0x11, 0xA2,
0x12, 0xA4,
0x4A, 0x4B
]

Audio/Video

audio_sink

DescriptionThe name of the audio sink used for audio loopback.
Tip
To find the name of the audio sink follow these instructions.

FreeBSD/Linux + pulseaudio:
pacmd list-sinks | grep "name:"


FreeBSD/Linux + pipewire:
pactl info | grep Source
# in some causes you'd need to use the `Sink` device, if `Source` doesn't work, so try:
pactl info | grep Sink


macOS:
Sunshine can only access microphones on macOS due to system limitations. To stream system audio use Soundflower or BlackHole.

Windows:
Enter the following command in command prompt or PowerShell.
%ProgramFiles%\Sunshine\tools\audio-info.exe
If you have multiple audio devices with identical names, use the Device ID instead.
Attention
If you want to mute the host speakers, use virtual_sink instead.
DefaultSunshine will select the default audio device.
Example (FreeBSD/Linux)
audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo
Example (macOS)
audio_sink = BlackHole 2ch
Example (Windows)
audio_sink = Speakers (High Definition Audio Device)

virtual_sink

DescriptionThe audio device that's virtual, like Steam Streaming Speakers. This allows Sunshine to stream audio, while muting the speakers.
Tip
See audio_sink!
Tip
These are some options for virtual sound devices.
Defaultn/a
Example
virtual_sink = Steam Streaming Speakers

stream_audio

DescriptionWhether to stream audio or not. Disabling this can be useful for streaming headless displays as second monitors.
Default
enabled
Example
stream_audio = disabled

install_steam_audio_drivers

DescriptionInstalls the Steam Streaming Speakers driver (if Steam is installed) to support surround sound and muting host audio.
Note
This option is only supported on Windows.
Default
enabled
Example
install_steam_audio_drivers = enabled

external_audio

DescriptionEnables capture-only operation when an external audio router manages application playback. An explicit audio_sink is required; use an endpoint ID when names are ambiguous. Sunshine captures that endpoint directly without changing or restoring Windows default devices or endpoint formats.

In this mode, virtual_sink, automatic Steam audio driver installation, and Moonlight's host-playback toggle do not affect routing. Configure local playback and the audio sent to the selected endpoint in your external mixer. If the endpoint is unavailable, audio capture fails rather than falling back to another endpoint. Video streaming can continue without audio.
Note
This option is only supported on Windows. Other platforms retain their existing behavior.
Default
disabled
Example
external_audio = enabled
audio_sink = My Streaming Mix

adapter_name

DescriptionSelect the video card you want to stream.
Tip
To find the appropriate values follow these instructions.

FreeBSD/Linux + VA-API:
Unlike with amdvce and nvenc, it doesn't matter if video encoding is done on a different GPU.
ls /dev/dri/renderD* # to find all devices capable of VAAPI
# replace ``renderD129`` with the device from above to list the name and capabilities of the device
vainfo --display drm --device /dev/dri/renderD129 | \
grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"
To be supported by Sunshine, it needs to have at the very minimum: VAProfileH264High : VAEntrypointEncSlice

Windows:
Enter the following command in command prompt or PowerShell.
%ProgramFiles%\Sunshine\tools\dxgi-info.exe
For hybrid graphics systems, DXGI reports the outputs are connected to whichever graphics adapter that the application is configured to use, so it's not a reliable indicator of how the display is physically connected.
DefaultSunshine will select the default video card.
Example (FreeBSD/Linux)
adapter_name = /dev/dri/renderD128
Example (Windows)
adapter_name = Radeon RX 580 Series

output_name

DescriptionSelect the display number you want to stream.
Tip
To find the appropriate values follow these instructions.

FreeBSD/Linux:
During Sunshine startup, you should see the list of detected displays:
Info: Detecting displays
Info: Detected display: DVI-D-0 (id: 0) connected: false
Info: Detected display: HDMI-0 (id: 1) connected: true
Info: Detected display: DP-0 (id: 2) connected: true
Info: Detected display: DP-1 (id: 3) connected: false
Info: Detected display: DVI-D-1 (id: 4) connected: false
It is recommended to use the stable display connector name (text right before the parenthesis, e.g. DP-0) for this value. For wlgrab/x11grab and kmsgrab the numeric id value can also be used.

macOS:
During Sunshine startup, you should see the list of detected displays:
Info: Detecting displays
Info: Detected display: Monitor-0 (id: 3) connected: true
Info: Detected display: Monitor-1 (id: 2) connected: true
You need to use the id value inside the parenthesis, e.g. 3.

Windows:
During Sunshine startup, you should see the list of detected displays:
Info: Currently available display devices:
[
{
"device_id": "{64243705-4020-5895-b923-adc862c3457e}",
"display_name": "",
"friendly_name": "IDD HDR",
"info": null
},
{
"device_id": "{77f67f3e-754f-5d31-af64-ee037e18100a}",
"display_name": "",
"friendly_name": "SunshineHDR",
"info": null
},
{
"device_id": "{daeac860-f4db-5208-b1f5-cf59444fb768}",
"display_name": "\\\\.\\DISPLAY1",
"friendly_name": "ROG PG279Q",
"info": {
"hdr_state": null,
"origin_point": {
"x": 0,
"y": 0
},
"primary": true,
"refresh_rate": {
"type": "rational",
"value": {
"denominator": 1000,
"numerator": 119998
}
},
"resolution": {
"height": 1440,
"width": 2560
},
"resolution_scale": {
"type": "rational",
"value": {
"denominator": 100,
"numerator": 100
}
}
}
}
]
You need to use the device_id value.
DefaultSunshine will select the default display.
Example (FreeBSD/Linux)
output_name = 0
Example (macOS)
output_name = 3
Example (Windows)
output_name = {daeac860-f4db-5208-b1f5-cf59444fb768}

dd_configuration_option

DescriptionPerform mandatory verification and additional configuration for the display device.
Note
Applies to Windows only.
Default
disabled
Example
dd_configuration_option = ensure_only_display
ChoicesdisabledPerform no additional configuration (disables all dd_ configuration options).
verify_onlyVerify that display is active only (this is a mandatory step without any extra steps to verify display state).
ensure_activeActivate the display if it's currently inactive.
ensure_primaryActivate the display if it's currently inactive and make it primary.
ensure_only_displayActivate the display if it's currently inactive and disable all others.

dd_resolution_option

DescriptionPerform additional resolution configuration for the display device.
Note
"Optimize game settings" must be enabled in Moonlight for this option to work.
Note
Applies to Windows only.
Default
auto
Example
dd_resolution_option = manual
ChoicesdisabledPerform no additional configuration.
autoChange resolution to the requested resolution from the client.
manualChange resolution to the user specified one (set via dd_manual_resolution).

dd_manual_resolution

DescriptionSpecify manual resolution to be used.
Note
dd_resolution_option must be set to manual
Note
Applies to Windows only.
Defaultn/a
Example
dd_manual_resolution = 1920x1080

dd_refresh_rate_option

DescriptionPerform additional refresh rate configuration for the display device.
Note
Applies to Windows only.
Default
auto
Example
dd_refresh_rate_option = manual
ChoicesdisabledPerform no additional configuration.
autoChange refresh rate to the requested FPS value from the client.
manualChange refresh rate to the user specified one (set via dd_manual_refresh_rate).

dd_manual_refresh_rate

DescriptionSpecify manual refresh rate to be used.
Note
dd_refresh_rate_option must be set to manual
Note
Applies to Windows only.
Defaultn/a
Example
dd_manual_resolution = 120
dd_manual_resolution = 59.95

dd_hdr_option

DescriptionPerform additional HDR configuration for the display device.
Note
Applies to Windows only.
Default
auto
Example
dd_hdr_option = disabled
ChoicesdisabledPerform no additional configuration.
autoChange HDR to the requested state from the client if the display supports it.

dd_wa_hdr_toggle_delay

DescriptionWhen using virtual display device (VDD) for streaming, it might incorrectly display HDR color. Sunshine can try to mitigate this issue, by turning HDR off and then on again.
If the value is set to 0, the workaround is disabled (default). If the value is between 0 and 3000 milliseconds, Sunshine will turn off HDR, wait for the specified amount of time and then turn HDR on again. The recommended delay time is around 500 milliseconds in most cases.
DO NOT use this workaround unless you actually have issues with HDR as it directly impacts stream start time!
Note
This option works independently of dd_hdr_option
Note
Applies to Windows only.
Default
0
Example
dd_wa_hdr_toggle_delay = 500

dd_config_revert_delay

DescriptionAdditional delay in milliseconds to wait before reverting configuration when the app has been closed or the last session terminated. Main purpose is to provide a smoother transition when quickly switching between apps.
Note
Applies to Windows only.
Default
3000
Example
dd_config_revert_delay = 1500

dd_config_revert_on_disconnect

DescriptionWhen enabled, display configuration is reverted upon disconnect of all clients instead of app close or last session termination. This can be useful for returning to physical usage of the host machine without closing the active app.
Warning
Some applications may not function properly when display configuration is changed while active.
Note
Applies to Windows only.
Default
disabled
Example
dd_config_revert_on_disconnect = enabled

dd_mode_remapping

DescriptionRemap the requested resolution and FPS to another display mode.
Depending on the dd_resolution_option and dd_refresh_rate_option values, the following mapping groups are available: For each of those groups, a list of fields can be configured to perform remapping:
  • requested_resolution - resolution that needs to be matched in order to use this remapping entry.
  • requested_fps - FPS that needs to be matched in order to use this remapping entry.
  • final_resolution - resolution value to be used if the entry was matched.
  • final_refresh_rate - refresh rate value to be used if the entry was matched.
If requested_* field is left empty, it will match everything.
If final_* field is left empty, the original value will not be remapped and either a requested, manual or current value is used. However, at least one final_* must be set, otherwise the entry is considered invalid.
Note
"Optimize game settings" must be enabled on client side for ANY entry with resolution field to be considered.
Note
First entry to be matched in the list is the one that will be used.
Tip
requested_resolution and final_resolution can be omitted for refresh_rate_only group.
Tip
requested_fps and final_refresh_rate can be omitted for resolution_only group.
Note
Applies to Windows only.
Default
dd_mode_remapping = {
"mixed": [],
"resolution_only": [],
"refresh_rate_only": []
}
Example
dd_mode_remapping = {
"mixed": [
{
"requested_fps": "60",
"final_refresh_rate": "119.95",
"requested_resolution": "1920x1080",
"final_resolution": "2560x1440"
},
{
"requested_fps": "60",
"final_refresh_rate": "120",
"requested_resolution": "",
"final_resolution": ""
}
],
"resolution_only": [
{
"requested_resolution": "1920x1080",
"final_resolution": "2560x1440"
}
],
"refresh_rate_only": [
{
"requested_fps": "60",
"final_refresh_rate": "119.95"
}
]
}

max_bitrate

DescriptionThe maximum bitrate (in Kbps) that Sunshine will encode the stream at. If set to 0, it will always use the bitrate requested by Moonlight.
Default
0
Example
max_bitrate = 5000

minimum_fps_target

DescriptionSunshine tries to save bandwidth when content on screen is static or a low framerate. Because many clients expect a constant stream of video frames, a certain amount of duplicate frames are sent when this happens. This setting controls the lowest effective framerate a stream can reach.
Default
0
Choices0Use half the stream's FPS as the minimum target.
1-1000Specify your own value. The real minimum may differ from this value.

Network

upnp

DescriptionSunshine will attempt to open ports for streaming over the internet.
Default
disabled
Example
upnp = enabled

address_family

DescriptionSet the address family that Sunshine will use.
Default
ipv4
Example
address_family = both
Choicesipv4IPv4 only
bothIPv4+IPv6

bind_address

DescriptionSet the IP address to bind Sunshine to. This is useful when you have multiple network interfaces and want to restrict Sunshine to a specific one. If not set, Sunshine will bind to all available interfaces (0.0.0.0 for IPv4 or :: for IPv6).

Note: The address must exist on the host and be compatible with address_family. An IPv4 address works with either "ipv4" or "both"; when used with "both", Sunshine listens only on that IPv4 address. An IPv6 address requires address_family to be set to "both".
DefaultEmpty, binds to all interfaces
Example (IPv4)
bind_address = 192.168.1.100
Example (IPv6)
bind_address = 2001:db8::1
Example (Loopback)
bind_address = 127.0.0.1

port

DescriptionSet the family of ports used by Sunshine. Changing this value will offset other ports as shown in config UI.
Default
47989
Range1029-65514
Example
port = 47989

origin_web_ui_allowed

DescriptionThe origin of the remote endpoint address that is not denied for HTTPS Web UI.
Default
lan
Example
origin_web_ui_allowed = lan
ChoicespcOnly localhost may access the web ui
lanOnly LAN devices may access the web ui
wanAnyone may access the web ui

csrf_allowed_origins

DescriptionComma-separated list of additional allowed origins for CSRF protection. These origins will be appended to the default allowed origins (localhost variants and the configured web UI port). Requests from allowed origins can access state-changing API endpoints without CSRF tokens.

Attention
Only add origins you trust. Each origin must be a complete URL prefix including protocol and host (e.g., https://example.com). Port numbers are optional.
DefaultEmpty, uses built-in defaults: https://localhost, https://127.0.0.1, https://[::1], with configured UI port variants
Example
csrf_allowed_origins = https://myapp.local,https://custom.domain.com

external_ip

DescriptionIf no external IP address is given, Sunshine will attempt to automatically detect external ip-address.
DefaultAutomatic
Example
external_ip = 123.456.789.12

lan_encryption_mode

DescriptionThis determines when encryption will be used when streaming over your local network.
Warning
Encryption can reduce streaming performance, particularly on less powerful hosts and clients.
Default
0
Example
lan_encryption_mode = 0
Choices0encryption will not be used
1encryption will be used if the client supports it
2encryption is mandatory and unencrypted connections are rejected

wan_encryption_mode

DescriptionThis determines when encryption will be used when streaming over the Internet.
Warning
Encryption can reduce streaming performance, particularly on less powerful hosts and clients.
Default
1
Example
wan_encryption_mode = 1
Choices0encryption will not be used
1encryption will be used if the client supports it
2encryption is mandatory and unencrypted connections are rejected

ping_timeout

DescriptionHow long to wait, in milliseconds, for data from Moonlight before shutting down the stream.
Default
10000
Example
ping_timeout = 10000

packetsize

DescriptionLimit the packetsize to avoid fragmentation on a low MTU link.
Note
This helps avoid packet loss and micro-stutter on a layer 2 VPN with clients that cannot configure this value, e.g. Moonlight for Android/iOS.
Tip
To discover the optimal value:
  • Send ping to the server with don't fragment flag (DF)
  • Find the size of the largest replay, and subtract 16
  • Monitor the traffic to ensure no fragmentation
If using a VPN tunnel:
  • Set MTU on the TUN/TAP interface, and
  • Ensure no fragmentation both inside and outside the tunnel
  • Max UDP size = MTU size - 28
  • packetsize = max UDP size - 16
  • Monitor the traffic to ensure no fragmentation
Sample calculation for OpenVPN layer 2, using IPv4:
  • 1428 bytes for max ICMP/UDP size outside the tunnel
  • Subtract the OpenVPN overhead: 24 bytes (may vary)
  • 1404 bytes for Ethernet inside the tunnel
  • Subtract the Ethernet header: 14 bytes
  • 1390 bytes for MTU inside the tunnel
  • Subtract the IPv4 header: 20 bytes
  • Subtract the UDP header: 8 bytes
  • 1362 bytes for UDP payload
  • Subtract: 16 bytes
  • 1346 bytes for packetsize
Warning
Reduce the bitrate when using low values. Values larger than 1456 require jumbo frames.
Default
0
Range0, 200-65535
Example
packetsize = 1346

Config Files

file_apps

DescriptionThe application configuration file path. The file contains a JSON formatted list of applications that can be started by Moonlight.
Default
apps.json
Example
file_apps = apps.json

credentials_file

DescriptionThe file where user credentials for the UI are stored.
Default
sunshine_state.json
Example
credentials_file = sunshine_state.json

log_path

DescriptionThe path where the current Sunshine log is stored. Each time Sunshine starts, up to five previous logs are retained by appending .1 through .5 to this path.
Default
sunshine.log
Example
log_path = sunshine.log

pkey

DescriptionThe private key used for the web UI and Moonlight client pairing. For best compatibility, this should be an RSA-2048 private key.
Warning
Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits.
Default
credentials/cakey.pem
Example
pkey = /dir/pkey.pem

cert

DescriptionThe certificate used for the web UI and Moonlight client pairing. For best compatibility, this should have an RSA-2048 public key.
Warning
Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits.
Default
credentials/cacert.pem
Example
cert = /dir/cert.pem

file_state

DescriptionThe file where current state of Sunshine is stored.
Default
sunshine_state.json
Example
file_state = sunshine_state.json

Advanced

fec_percentage

DescriptionPercentage of error correcting packets per data packet in each video frame.
Warning
Higher values can correct for more network packet loss, but at the cost of increasing bandwidth usage.
Default
20
Range1-255
Example
fec_percentage = 20

qp

DescriptionQuantization Parameter. Some devices don't support Constant Bit Rate. For those devices, QP is used instead.
Warning
Higher value means more compression, but less quality.
Default
28
Example
qp = 28

min_threads

DescriptionMinimum number of CPU threads used for encoding.
Note
Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest value that can reliably encode at your desired streaming settings on your hardware.
Default
2
Example
min_threads = 2

hevc_mode

DescriptionAllows the client to request HEVC Main or HEVC Main10 video streams.
Warning
HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
Default
0
Example
hevc_mode = 2
Choices0advertise support for HEVC based on encoder capabilities (recommended)
1do not advertise support for HEVC
2advertise support for HEVC Main profile
3advertise support for HEVC Main and Main10 (HDR) profiles

av1_mode

DescriptionAllows the client to request AV1 Main 8-bit or 10-bit video streams.
Warning
AV1 is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
Default
0
Example
av1_mode = 2
Choices0advertise support for AV1 based on encoder capabilities (recommended)
1do not advertise support for AV1
2advertise support for AV1 Main 8-bit profile
3advertise support for AV1 Main 8-bit and 10-bit (HDR) profiles

capture

DescriptionForce specific screen capture method.
DefaultAutomatic. Sunshine will use the first capture method available in the order of the table above.
Example
capture = kms
ChoicesnvfbcUse NVIDIA Frame Buffer Capture to capture direct to GPU memory. This is usually the fastest method for NVIDIA cards. NvFBC does not have native Wayland support and does not work with XWayland.
Note
Applies to Linux only.
wlrCapture for wlroots based Wayland compositors via wlr-screencopy-unstable-v1. It is possible to capture virtual displays in e.g. Hyprland using this method.
Note
Applies to Linux only.
kmsDRM/KMS screen capture from the kernel. This requires that Sunshine has cap_sys_admin capability.
Note
Applies to Linux only.
kwinCapture with KDE/KWin Wayland compositor via KDE screencasting.
Note
Applies to Linux only.
x11Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible.
Note
Applies to FreeBSD and Linux only.
ddxUse DirectX Desktop Duplication API to capture the display. This is well-supported on Windows machines.
Note
Applies to Windows only.
wgc(beta feature) Use Windows.Graphics.Capture to capture the display.
Note
Applies to Windows only.
Attention
This capture method is not compatible with the Sunshine service.

fp16_sdr_gamma_encoded

DescriptionTreat FP16 captures of SDR displays as already sRGB gamma-encoded and skip the sRGB curve when converting them. Enable this if the stream looks washed out or its highlights are blown out while the display is in SDR mode and the desktop is captured in FP16 format (the log shows Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]). Leave this disabled otherwise, because it darkens the stream when the FP16 capture is linear scRGB. This option has no effect when the display is in HDR mode.
Note
Applies to Windows only.
Default
disabled
Example
fp16_sdr_gamma_encoded = enabled

encoder

DescriptionForce a specific encoder.
DefaultSunshine will use the first encoder that is available.
Example
encoder = nvenc
ChoicesnvencFor NVIDIA graphics cards
quicksyncFor Intel graphics cards
amdvceFor AMD graphics cards
vaapiUse VA-API (AMD, Intel)
vulkanUse Vulkan encoder (AMD, Intel, NVIDIA).
Note
Applies to Linux only.
softwareEncoding occurs on the CPU

NVIDIA NVENC Encoder

nvenc_preset

DescriptionNVENC encoder performance preset. Higher numbers improve compression (quality at given bitrate) at the cost of increased encoding latency. Recommended to change only when limited by network or decoder, otherwise similar effect can be accomplished by increasing bitrate.
Note
This option only applies when using NVENC encoder.
Default
1
Example
nvenc_preset = 1
Choices1P1 (fastest)
2P2
3P3
4P4
5P5
6P6
7P7 (slowest)

nvenc_twopass

DescriptionEnable two-pass mode in NVENC encoder. This allows to detect more motion vectors, better distribute bitrate across the frame and more strictly adhere to bitrate limits. Disabling it is not recommended since this can lead to occasional bitrate overshoot and subsequent packet loss.
Note
This option only applies when using NVENC encoder.
Default
quarter_res
Example
nvenc_twopass = quarter_res
ChoicesdisabledOne pass (fastest)
quarter_resTwo passes, first pass at quarter resolution (faster)
full_resTwo passes, first pass at full resolution (slower)

nvenc_spatial_aq

DescriptionAssign higher QP values to flat regions of the video. Recommended to enable when streaming at lower bitrates.
Note
This option only applies when using NVENC encoder.
Warning
Enabling this option may reduce performance.
Default
disabled
Example
nvenc_spatial_aq = disabled

nvenc_vbv_increase

DescriptionSingle-frame VBV/HRD percentage increase. By default Sunshine uses single-frame VBV/HRD, which means any encoded video frame size is not expected to exceed requested bitrate divided by requested frame rate. Relaxing this restriction can be beneficial and act as low-latency variable bitrate, but may also lead to packet loss if the network doesn't have buffer headroom to handle bitrate spikes. Maximum accepted value is 400, which corresponds to 5x increased encoded video frame upper size limit.
Note
This option only applies when using NVENC encoder.
Warning
Can lead to network packet loss.
Default
0
Range0-400
Example
nvenc_vbv_increase = 0

nvenc_realtime_hags

DescriptionUse realtime gpu scheduling priority in NVENC when hardware accelerated gpu scheduling (HAGS) is enabled in Windows. Currently, NVIDIA drivers may freeze in encoder when HAGS is enabled, realtime priority is used and VRAM utilization is close to maximum. Disabling this option lowers the priority to high, sidestepping the freeze at the cost of reduced capture performance when the GPU is heavily loaded.
Note
This option only applies when using NVENC encoder.
Note
Applies to Windows only.
Default
enabled
Example
nvenc_realtime_hags = enabled

nvenc_split_encode

DescriptionSplit the encoding of each video frame over multiple NVENC hardware units. Significantly reduces encoding latency with a marginal compression efficiency penalty. This option is ignored if your GPU has a singular NVENC unit.
Note
This option only applies when using NVENC encoder with HEVC or AV1.
Note
Applies to Windows only.
Default
driver_decides
Example
nvenc_split_encode = driver_decides
ChoicesdisabledDisabled
driver_decidesThe NVIDIA driver will automatically enable split frame encoding when the following conditions are met: 2+ NVENC units, resolution is at least 4K, and the preset is P1-P4.
enabledEnabled

nvenc_latency_over_power

DescriptionAdaptive P-State algorithm which NVIDIA drivers employ doesn't work well with low latency streaming, so Sunshine requests high power mode explicitly.
Note
This option only applies when using NVENC encoder.
Warning
Disabling this is not recommended since this can lead to significantly increased encoding latency.
Note
Applies to Windows only.
Default
enabled
Example
nvenc_latency_over_power = enabled

nvenc_opengl_vulkan_on_dxgi

DescriptionSunshine can't capture fullscreen OpenGL and Vulkan programs at full frame rate unless they present on top of DXGI. With this option enabled Sunshine changes global Vulkan/OpenGL present method to "Prefer layered on DXGI Swapchain". This is system-wide setting that is reverted on Sunshine program exit.
Note
This option only applies when using NVENC encoder.
Note
Applies to Windows only.
Default
enabled
Example
nvenc_opengl_vulkan_on_dxgi = enabled

nvenc_h264_cavlc

DescriptionPrefer CAVLC entropy coding over CABAC in H.264 when using NVENC. CAVLC is outdated and needs around 10% more bitrate for same quality, but provides slightly faster decoding when using software decoder.
Note
This option only applies when using H.264 format with the NVENC encoder.
Default
disabled
Example
nvenc_h264_cavlc = disabled

Intel QuickSync Encoder

qsv_preset

DescriptionThe encoder preset to use.
Note
This option only applies when using quicksync encoder.
Default
medium
Example
qsv_preset = medium
Choicesveryfastfastest (lowest quality)
fasterfaster (lower quality)
fastfast (low quality)
mediummedium (default)
slowslow (good quality)
slowerslower (better quality)
veryslowslowest (best quality)

qsv_coder

DescriptionThe entropy encoding to use.
Note
This option only applies when using H.264 with the quicksync encoder.
Default
auto
Example
qsv_coder = auto
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - higher quality
cavlccontext adaptive variable-length coding - faster decode

qsv_slow_hevc

DescriptionThis options enables use of HEVC on older Intel GPUs that only support low power encoding for H.264.
Note
This option only applies when using quicksync encoder.
Caution
Streaming performance may be significantly reduced when this option is enabled.
Default
disabled
Example
qsv_slow_hevc = disabled

AMD AMF Encoder

amd_usage

DescriptionThe encoder usage profile is used to set the base set of encoding parameters.
Note
This option only applies when using amdvce encoder.
Note
The other AMF options that follow will override a subset of the settings applied by your usage profile, but there are hidden parameters set in usage profiles that cannot be overridden elsewhere.
Default
ultralowlatency
Example
amd_usage = ultralowlatency
Choicestranscodingtranscoding (slowest)
webcamwebcam (slow)
lowlatency_high_qualitylow latency, high quality (fast)
lowlatencylow latency (faster)
ultralowlatencyultra low latency (fastest)

amd_rc

DescriptionThe encoder rate control.
Note
This option only applies when using amdvce encoder.
Warning
The vbr_latency option generally works best, but some bitrate overshoots may still occur. Enabling HRD allows all bitrate based rate controls to better constrain peak bitrate, but may result in encoding artifacts depending on your card.
Default
vbr_latency
Example
amd_rc = vbr_latency
Choicescqpconstant qp mode
cbrconstant bitrate
vbr_latencyvariable bitrate, latency constrained
vbr_peakvariable bitrate, peak constrained

amd_enforce_hrd

DescriptionEnable Hypothetical Reference Decoder (HRD) enforcement to help constrain the target bitrate.
Note
This option only applies when using amdvce encoder.
Warning
HRD is known to cause encoding artifacts or negatively affect encoding quality on certain cards.
Default
disabled
Example
amd_enforce_hrd = disabled

amd_max_au_size

DescriptionMaximum Access Unit (frame) size for rate control, in bits. This is a last-resort control for capping oversized encoded frames that would otherwise exceed Sunshine's four-block FEC capacity and be sent without FEC protection.
Note
This option only applies to H.264 and HEVC when using amdvce encoder. AV1 does not support this option.
Note
The FEC ceiling depends on the negotiated packet size and fec_percentage, not the average bitrate or frame rate. The approximate encoded-payload ceiling is 4 * floor(25500 / (100 + fec_percentage)) * (packet_size - 16) * 8 bits, before allowing for the short frame header or codec-header replacements. With 20% FEC and 1024-byte packets, 6400000 bits provides conservative headroom.
Warning
Setting this unnecessarily low can reduce image quality, especially for keyframes. Leave it empty unless oversized frames are actually causing FEC to be skipped.
DefaultEmpty, uses encoder default.
Example
amd_max_au_size = 6400000

amd_quality

DescriptionThe quality profile controls the tradeoff between speed and quality of encoding.
Note
This option only applies when using amdvce encoder.
Default
balanced
Example
amd_quality = balanced
Choicesspeedprefer speed
balancedbalanced
qualityprefer quality

amd_preanalysis

DescriptionPreanalysis can increase encoding quality at the cost of latency.
Note
This option only applies when using amdvce encoder.
Default
disabled
Example
amd_preanalysis = disabled

amd_vbaq

DescriptionVariance Based Adaptive Quantization (VBAQ) can increase subjective visual quality by prioritizing allocation of more bits to smooth areas compared to more textured areas.
Note
This option only applies when using amdvce encoder.
Default
enabled
Example
amd_vbaq = enabled

amd_coder

DescriptionThe entropy encoding to use.
Note
This option only applies when using H.264 with the amdvce encoder.
Default
auto
Example
amd_coder = auto
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - faster decode
cavlccontext adaptive variable-length coding - higher quality

VideoToolbox Encoder

vt_coder

DescriptionThe entropy encoding to use.
Note
This option only applies when using macOS.
Default
auto
Example
vt_coder = auto
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - faster decode
cavlccontext adaptive variable-length coding - higher quality

vt_software

DescriptionForce Video Toolbox to use software encoding.
Note
This option only applies when using macOS.
Default
auto
Example
vt_software = auto
Choicesautolet ffmpeg decide
disableddisable software encoding
allowedallow software encoding
forcedforce software encoding

vt_realtime

DescriptionRealtime encoding.
Note
This option only applies when using macOS.
Warning
Disabling realtime encoding might result in a delayed frame encoding or frame drop.
Default
enabled
Example
vt_realtime = enabled

VA-API Encoder

vaapi_blbrc

DescriptionBlock level based bitrate control (BLBRC) can assign different bitrate on a per-block basis. May improve quality on supported devices.
Note
This option only applies when using the VA-API encoder.
Default
disabled
Example
vaapi_blbrc = enabled

vaapi_quality

DescriptionThe quality profile controls the tradeoff between speed and quality of encoding.
Note
This option only applies when using the VA-API encoder.
Default
auto
Example
vaapi_quality = auto
Choicesautodriver default quality
speedprefer speed
balancedbalanced
qualityprefer quality

vaapi_rc

DescriptionThe encoder rate control.
Note
This option only applies when using the VA-API encoder.
Warning
The automatic setting may override the driver-default rate control method to VBR and force vaapi_strict_rc_buffer enabled on certain configurations. Selecting another rate control manually will override this behaviour.
Default
auto
Example
vaapi_rc = vbr
Choicesautodriver default (or whitelisted override)
avbraverage variable bitrate
cbrconstant bitrate
cqpconstant qp mode
icqintelligent qp mode
qvbrquality-defined variable bitrate
vbrvariable bitrate

vaapi_strict_rc_buffer

DescriptionEnabling this option can avoid dropped frames over the network during scene changes, but video quality may be reduced during motion.
Note
This option only applies for H.264 and HEVC when using VA-API encoder on AMD GPUs (or when overriding the default rate control on other devices).
Default
disabled
Example
vaapi_strict_rc_buffer = enabled

Vulkan Encoder

vk_tune

DescriptionEncoder tuning preset. Low latency modes reduce encoding delay at the cost of quality.
Note
This option only applies when using Vulkan encoder.
Default
2
Example
vk_tune = 1
Options0 (default)Let the driver decide
1 (hq)High Quality
2 (ll)Low Latency
3 (ull)Ultra Low Latency
4 (lossless)Lossless

vk_rc_mode

DescriptionRate control mode for encoding. Auto lets the driver decide.
Note
This option only applies when using Vulkan encoder.
Default
2
Example
vk_rc_mode = 4
Options0Auto (driver decides)
1CQP (Constant QP)
2CBR (Constant Bitrate)
4VBR (Variable Bitrate)

vk_quality

DescriptionDetermines encoder tradeoff between quality and speed.
Note
This option only applies when using Vulkan encoder.
Default
balanced
Example
vk_quality = quality
OptionsspeedSpeed (prefer speed)
balancedBalanced (default)
qualityQuality (prefer quality)

Software Encoder

sw_preset

DescriptionThe encoder preset to use.
Note
This option only applies when using software encoder.
Note
From FFmpeg.

A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.

Use the slowest preset that you have patience for.
Default
superfast
Example
sw_preset = superfast
Choicesultrafastfastest
superfast
veryfast
faster
fast
medium
slow
slower
veryslowslowest

sw_tune

DescriptionThe tuning preset to use.
Note
This option only applies when using software encoder.
Note
From FFmpeg.

You can optionally use -tune to change settings based upon the specifics of your input.
Default
zerolatency
Example
sw_tune = zerolatency
Choicesfilmuse for high quality movie content; lowers deblocking
animationgood for cartoons; uses higher deblocking and more reference frames
grainpreserves the grain structure in old, grainy film material
stillimagegood for slideshow-like content
fastdecodeallows faster decoding by disabling certain filters
zerolatencygood for fast encoding and low-latency streaming