Prerequisites
Compiler Requirements
It is recommended to use one of the following compilers:| Compiler | Version |
|---|---|
| GCC | 13+ |
| Clang | 17+ |
| Apple Clang | 15+ |
Common Tools
All platforms require:- CMake >= 3.25
- Git (for cloning with submodules)
- Ninja or Make (build system)
- Node.js and npm (for Web UI)
Clone the Repository
First, clone the repository with all submodules:--recurse-submodules flag is crucial as Sunshine depends on several third-party libraries included as submodules.
Platform-Specific Dependencies
Linux
Linux
Debian/Ubuntu
Fedora
Arch Linux
Optional: CUDA Toolkit (for NVFBC capture)
Sunshine requires CUDA Toolkit for NVIDIA’s NvFBC (NVIDIA Framebuffer Capture) feature.The CUDA version you use will determine compatibility with various GPU generations. At the time of writing, CUDA ~12.9 is recommended. See CUDA compatibility for more info.
KMS Capture Permissions
If you are using KMS capture, you need to set capabilities on the binary:Windows
Windows
Install MSYS2
- Download and install MSYS2
- Launch the appropriate shell:
- AMD64: MSYS2 UCRT64
- ARM64: MSYS2 CLANGARM64
Update MSYS2
Set Toolchain Variable
Install Dependencies
Optional: .NET SDK (for WiX installer)
To create a WiX installer, install the .NET SDK.macOS
macOS
FreeBSD
FreeBSD
Install Dependencies
Build Instructions
Basic Build
Once dependencies are installed:Build with Custom Options
CMake options can be specified with-D flags:
CMake Build Options
Sunshine provides numerous build options incmake/prep/options.cmake:
Common Options
| Option | Default | Description |
|---|---|---|
BUILD_DOCS | ON | Build Doxygen documentation |
BUILD_TESTS | ON | Build unit tests |
BUILD_WERROR | OFF | Treat compiler warnings as errors |
SUNSHINE_ENABLE_TRAY | ON | Enable system tray icon |
NPM_OFFLINE | OFF | Use offline npm packages |
BOOST_USE_STATIC | ON (OFF on macOS) | Use static Boost libraries |
Linux-Specific Options
| Option | Default | Description |
|---|---|---|
SUNSHINE_ENABLE_CUDA | ON | Enable CUDA/NVENC support |
SUNSHINE_ENABLE_DRM | ON | Enable KMS/DRM capture |
SUNSHINE_ENABLE_VAAPI | ON | Enable VAAPI encoding |
SUNSHINE_ENABLE_WAYLAND | ON | Enable Wayland capture |
SUNSHINE_ENABLE_X11 | ON | Enable X11 capture |
SUNSHINE_ENABLE_PORTAL | ON | Enable XDG Desktop Portal capture |
SUNSHINE_BUILD_APPIMAGE | OFF | Build for AppImage packaging |
SUNSHINE_BUILD_FLATPAK | OFF | Build for Flatpak packaging |
Publisher Options
For custom builds, you can set publisher metadata:| Option | Description |
|---|---|
SUNSHINE_PUBLISHER_NAME | Publisher name |
SUNSHINE_PUBLISHER_WEBSITE | Publisher website URL |
SUNSHINE_PUBLISHER_ISSUE_URL | Support/issue tracker URL |
Creating Packages
Sunshine uses CPack for package creation.Remote Build (GitHub Actions)
You can build Sunshine remotely using GitHub Actions:- Fork the Sunshine repository
- Go to the Actions tab in your fork
- Enable workflows if prompted
- Manually trigger the CI workflow
- Download artifacts from the workflow run summary
- Building on platforms you don’t have access to
- Testing cross-platform compatibility
- Creating release packages
Build Troubleshooting
CMake Version Issues
If your system’s CMake is too old:Submodule Issues
If you forgot to clone with--recurse-submodules:
Build Failures
-
Clean build directory:
-
Check compiler version:
-
Verify all dependencies are installed:
Node.js/npm Issues
If Web UI build fails:Next Steps
Architecture
Learn about Sunshine’s internal architecture
Contributing
Start contributing to the project

