Sunshine is an open-source, self-hosted game streaming host: software installed on a gaming computer that captures the screen, encodes it as video in real time and streams it, together with audio, to client devices running Moonlight. It sits beside cloud gaming in the same family of technologies, but instead of renting a remote data-center server, the player turns their own PC into the streaming server.
Sunshine implements a host compatible with the NVIDIA GameStream protocol, which Moonlight was originally built for. When NVIDIA retired GameStream support from GeForce Experience, Sunshine became the most common way to keep using Moonlight, and it also works with AMD and Intel graphics, not only NVIDIA cards. It is sometimes described simply as a Sunshine game stream host.
How Sunshine streams a game
Sunshine streams a game by running a capture, encode and transmit loop for every frame. It grabs the rendered desktop or game output, passes it to a video encoder, packetizes the result and sends it over the network, while it receives input from the client and injects it back into the host system.
- Capture: the host grabs frames through Desktop Duplication on Windows, or KMS, X11 or Wayland capture on Linux.
- Encode: a hardware encoder compresses each frame to H.264, HEVC or AV1.
- Transmit: video and audio travel mostly over UDP, with forward error correction to tolerate packet loss.
- Input: Moonlight sends mouse, keyboard, touch and gamepad events back, and Sunshine creates virtual input devices on the host.
- Decode: the client decodes the stream in hardware and shows it with minimal buffering.
Because every stage adds delay, the total motion-to-photon latency depends on the encoder, the network and the client decoder. On a wired local network the added delay is commonly in the range of a few milliseconds to about 20 ms, which most players do not notice outside competitive shooters.
Encoders, codecs and platform support
Sunshine relies on the graphics card’s dedicated video encoder so that streaming costs little game performance. A software encoder exists as a fallback, but it loads the CPU heavily and suits only low resolutions or weak hosts.
| Encoder | Hardware | Notes |
|---|---|---|
| NVENC | NVIDIA GeForce and RTX cards | Mature, low latency, AV1 on newer generations |
| AMF | AMD Radeon cards | HEVC recommended, AV1 on recent models |
| Quick Sync | Intel integrated and Arc graphics | Efficient, AV1 on Arc and newer chips |
| VA-API | AMD and Intel on Linux | Standard Linux video acceleration interface |
| Software (x264, x265) | Any CPU | High CPU load, last resort |
Codec choice is a trade-off between efficiency and compatibility. HEVC and AV1 deliver better image quality at the same bitrate than H.264, but the client must decode them in hardware. Sunshine runs on Windows and Linux, with macOS support considered less complete, and supports HDR streaming when host, encoder and client all handle 10-bit video.
| Codec | Efficiency | Client support |
|---|---|---|
| H.264 | Baseline, needs the most bitrate | Nearly universal |
| HEVC (H.265) | Roughly 30-40% better than H.264 | Most modern devices, needed for HDR |
| AV1 | Best efficiency of the three | Recent GPUs, phones and TVs only |
Sunshine compared with other ways to stream games
Sunshine belongs to the local or self-hosted streaming category, and its value becomes clear next to commercial cloud gaming and other remote play tools in the same Topic.
| Option | Where the game runs | Key difference |
|---|---|---|
| Sunshine with Moonlight | Player’s own PC | Open source, any game or desktop, any GPU vendor |
| Steam Remote Play | Player’s own PC | Built into Steam, simpler, fewer tuning options |
| PlayStation Remote Play | Player’s PlayStation console | Console only, Sony clients |
| GeForce NOW | Data-center server | Subscription, no local hardware needed |
| Shadow PC | Rented full cloud PC | Complete remote Windows machine |
The main advantage of Sunshine is control and cost: no subscription, no game library restrictions and full access to the host’s installed games, launchers and mods. The main limitation is that the host PC must be powered on and reachable, and image quality outside the home depends on the host’s upload bandwidth.
Setting up and tuning a Sunshine host
A Sunshine host is configured through a local web interface, by default on port 47990, where the administrator sets credentials, pairs clients and defines applications. Pairing uses a PIN shown in Moonlight and entered on the host, which establishes a trusted certificate between the two devices.
- Applications list: entries such as Desktop or Steam Big Picture, optionally with commands that run before and after a session, for example changing the display resolution.
- Network ports: TCP 47984, 47989 and 48010 plus UDP 47998-48000 must be reachable; for internet use a VPN such as WireGuard is safer than opening ports.
- Virtual gamepads: on Windows a virtual controller driver lets games see an Xbox-style pad.
- Display matching: streaming at the client’s native resolution and refresh rate avoids scaling blur.
Bitrate is the most important quality setting. As a rough guide, 20-40 Mbps for 1080p at 60 fps and 50-80 Mbps for 4K over HEVC give clean images on a wired network, while Wi-Fi often needs lower values to stay stable.
Limitations and common problems
Most Sunshine problems come from the network or the host display configuration, not from the software itself. The table lists typical symptoms and fixes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Stutter and dropped frames | Congested Wi-Fi or excessive bitrate | Wired connection, lower bitrate, 5 GHz or 6 GHz band |
| Black screen | No active display or wrong capture method | Dummy display plug or virtual display driver |
| Blurry image | Resolution mismatch or low bitrate | Match client resolution, raise bitrate |
| Cannot connect remotely | Ports closed or carrier-grade NAT | VPN mesh or proper port forwarding |
| Game rejects input | Anti-cheat blocks virtual devices | Check game support, use another title |
Security deserves attention: exposing the web interface to the internet is a real risk, so it should stay on the local network. Some games with strict anti-cheat also treat virtual input with suspicion.
The idea in brief
Sunshine is a free program that turns a gaming computer into a personal streaming station. The computer runs the game, and Sunshine sends the picture and sound to another screen, such as a laptop, phone, tablet or television, much like a live video call.
When the player presses a button on the far device, the press travels back to the computer instantly. The result is that heavy games can be played on light devices, as long as the home network is fast and steady.
A practical scenario
A player keeps a desktop PC with an RTX graphics card in a home office but prefers to play on the living-room television. She installs Sunshine on the PC, connects it to the router by cable and pairs a Moonlight client on the television box with a four-digit PIN.
She streams at 4K and 60 fps using HEVC at 60 Mbps, adds Steam Big Picture as an application and sets a pre-launch command that switches the PC display to 3840 x 2160. Her controller connects to the television box, and Sunshine presents it to games as a virtual Xbox pad. Measured added latency stays near 10 ms, so action games feel responsive, and the result is console-like play on the couch without buying a second gaming machine.