Need help with sunshine?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

190 Stars 36 Forks GNU General Public License v3.0 290 Commits 40 Opened issues


Host for Moonlight Streaming Client

Services available


Need anything else?

Contributors list


Sunshine is a Gamestream host for Moonlight




Ubuntu 20.04:

sudo apt install cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev


  • git clone --recurse-submodules
  • cd sunshine && mkdir build && cd build
  • cmake ..
  • make
    : It is suggested to use the
    -j C#
    flags with this command,
    being the number of cores your PC has


sunshine needs access to uinput to create mouse and gamepad events: - Add user to group 'input': "usermod -a -G input username - Create a file: "/etc/udev/rules.d/85-sunshine-input.rules" - The contents of the file is as follows: KERNEL=="uinput", GROUP="input", mode="0660" - assets/sunshine.conf is an example configuration file. Modify it as you see fit and use it by running: "sunshine path/to/sunshine.conf" - path/to/build/dir/sunshine.service is used to start sunshine in the background: -

cp sunshine.service $HOME/.config/systemd/user/
- Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable -
systemctl --user start sunshine
  • assets/apps.json is an example of a list of applications that are started just before running a stream


* If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
    * groups
* If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
    * pacmd list-sources | grep "name:"
    * Copy the name to the configuration option "audio_sink"
    * restart sunshine

Windows 10


MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost


  • git clone --recurse-submodules
  • cd sunshine && mkdir build && cd build
  • cmake -G"Unix Makefiles" ..
  • make


  • OPTIONAL Gamepad support: Download and run 'ViGEmBusSetup1.16.116.exe' from []

Static build


MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost git-lfs


  • git lfs install
  • git clone --recurse-submodules
  • cd sunshine && mkdir build && cd build
  • cmake -DSUNSHINE_STANDALONE=ON -G"Unix Makefiles" ..
  • make



  • run "sunshine path/to/sunshine.conf"
  • In Moonlight: Add PC manually
  • When Moonlight request you insert the correct pin on sunshine, either:
    • Type in the URL bar of your browser:
    • wget
      • The x's are the IP of your instance,
        is the pin
  • Click on one of the Applications listed
  • Have fun :)


  • The Windows key is not passed through by Moonlight, therefore Sunshine maps Right-Alt key to the Windows key
  • If you set Video Bitrate to 0.5Mb/s:
    • Sunshine will use CRF or QP to controll the quality of the stream. (See example configuration file for more details)
    • This is less CPU intensive and it has lower average bandwith requirements compared to manually setting bitrate to acceptable quality
    • However, it has higher peak bitrates, forcing Sunshine to drop entire frames when streaming 1080P due to their size.
    • When this happens, the video portion of the stream appears to be frozen.
    • This is rare enough that using this for the desktop environment is tolerable (in my opinion), however for gaming not so much.


Application List:

  • You can use Environment variables in place of values
    • $(HOME) will be replaced by the value of $HOME
    • $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME)
  • env: Adds or overwrites Environment variables for the commands/applications run by Sunshine.
    • "Variable name":"Variable value"
  • apps: The list of applications
    • Example:
      "name":"An App",
      "cmd":"command to open app",
    • name: Self explanatory
    • output : The file where the output of the command is stored
      • If it is not specified, the output is ignored
    • prep-cmd: A list of commands to be run before/after the application
      • If any of the prep-commands fail, starting the application is aborted
      • do: Run before the application
        • If it fails, all 'undo' commands of the previously succeeded 'do' commands are run
      • undo : Run after the application has terminated
        • This should not fail considering it is supposed to undo the 'do' commands.
        • If it fails, Sunshine is terminated
    • cmd : The main application
      • If not specified, a processs is started that sleeps indefinitely
  1. When an application is started, if there is an application already running, it will be terminated.
  2. When the application has been shutdown, the stream shuts down as well.
  3. In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application, instead it simply starts a stream.

Linux ```json { "env":{ "DISPLAY":":0", "DRI_PRIME":"1", "XAUTHORITY":"$(HOME)/.Xauthority", "PATH":"$(PATH):$(HOME)/.local/bin" }, "apps":[ { "name":"Low Res Desktop", "prep-cmd":[ { "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" } ] }, { "name":"Steam BigPicture",

    "cmd":"steam -bigpicture",


json { "env":{ "PATH":"$(PATH);C:\Program Files (x86)\Steam" }, "apps":[ { "name":"Steam BigPicture",
        {"do":"steam \"steam://open/bigpicture\""}

} ```

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.