Skip to main content
Sunshine uses CMake as its build system and requires CMake version 3.25 or higher. This guide covers building on all supported platforms.

Prerequisites

Compiler Requirements

It is recommended to use one of the following compilers:

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:
The --recurse-submodules flag is crucial as Sunshine depends on several third-party libraries included as submodules.

Platform-Specific Dependencies

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.
Install CUDA:

KMS Capture Permissions

If you are using KMS capture, you need to set capabilities on the binary:
This is required for KMS capture to work. Some post-install scripts handle this automatically.
Cross-compilation is not supported on Windows. You must build on the target architecture (AMD64 or ARM64).

Install MSYS2

  1. Download and install MSYS2
  2. Launch the appropriate shell:
    • AMD64: MSYS2 UCRT64
    • ARM64: MSYS2 CLANGARM64

Update MSYS2

Close and reopen the shell, then:

Set Toolchain Variable

Install Dependencies

Additional packages for UCRT64:
For ARM64: Install Node.js separately for the Web UI.

Optional: .NET SDK (for WiX installer)

To create a WiX installer, install the .NET SDK.
You can use either Homebrew or MacPorts for dependency management.

Install Homebrew

If not already installed:

Install Dependencies

Optional: Install Documentation Tools

Fix OpenSSL Headers (if needed)

Sunshine support for FreeBSD is experimental and may be incomplete or not work as expected.

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 in cmake/prep/options.cmake:

Common Options

Linux-Specific Options

Publisher Options

For custom builds, you can set publisher metadata: Example:

Creating Packages

Sunshine uses CPack for package creation.

Remote Build (GitHub Actions)

You can build Sunshine remotely using GitHub Actions:
  1. Fork the Sunshine repository
  2. Go to the Actions tab in your fork
  3. Enable workflows if prompted
  4. Manually trigger the CI workflow
  5. Download artifacts from the workflow run summary
This is useful for:
  • 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

  1. Clean build directory:
  2. Check compiler version:
  3. 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