Sunshine

Self-hosted game-stream host for Moonlight clients

Remote Access & VPN ★ 41.5k stars Medium setup GPL-3.0

Sunshine is an open-source, self-hosted game streaming host compatible with Moonlight clients. It streams desktop and games with low latency and hardware encoding.

Key features

  • Low-latency game streaming
  • Hardware encoding
  • Moonlight client compatible
  • Cross-platform host

Pros & cons

Strengths

  • Low-latency streaming
  • Hardware encoding support
  • Works with any GPU

Trade-offs

  • Requires Moonlight clients
  • Network tuning often needed

Sunshine replaces

Last reviewed Aug 26, 2026 · 980 words

On a wired gigabit LAN, Sunshine streams 1080p at 60 fps to a Moonlight client at 20 Mbps with roughly 5 to 10 ms of added latency, which is close enough to sitting at the PC that you stop noticing within a session. It is free, GPL-3.0, and works with NVIDIA, AMD, Intel, and Apple silicon encoders. The 2 things that wreck the experience are Wi-Fi on the host machine and a PC with no display attached, and neither is fixed by any setting in the app.

Pairing takes 5 minutes; the ports take longer

Install Sunshine on the gaming PC (Windows, Linux, or macOS; the Moonlight client runs on nearly everything, including Steam Deck, Apple TV, Android, iOS, and Raspberry Pi). The first visit to https://localhost:47990 sets the web UI username and password; the Sunshine docs cover the per-OS install. Open Moonlight on the client, which discovers the host by mDNS on the same network, click it, and it shows a 4-digit PIN; type that PIN into the Sunshine web UI's PIN tab. Done, for that client.

If a firewall sits between them (Windows Defender usually prompts, Linux hosts usually do not), the list is TCP 47984, 47989, 47990, and 48010, plus UDP 47998, 47999, and 48000. Every "Moonlight sees the host but hangs on connect" thread ends with one of those UDP ports blocked.

A headless PC needs a display, real or fake

Sunshine captures a screen, so the GPU must be driving one. A PC in a cupboard with no monitor plugged in gives you a black stream or a 640x480 desktop. The cheapest fix is a dummy HDMI or DisplayPort plug for about $8, which the GPU treats as a monitor; set its resolution to whatever you want to stream. On Windows a virtual display driver does the same in software, and the Apollo fork of Sunshine bundles one and adds the resolution to the stream automatically, which is why a lot of Windows users have quietly moved to it. On Linux with NVIDIA, a fake screen in xorg.conf works.

Linux capture has one more step. For KMS capture (the fast path, and the only one that works under Wayland without a compositor plugin), Sunshine needs a capability:

sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))

The packaged installs usually do this for you, but a manual build will not, and the symptom is a stream of the login screen instead of your session.

Pick the encoder your GPU is good at

Sunshine picks a hardware encoder automatically: NVENC on NVIDIA, Quick Sync on Intel, AMF on AMD under Windows and VAAPI under Linux, VideoToolbox on macOS, with software x264 as the fallback that you do not want because it eats the CPU your game needs. Codec matters as much as encoder. H.264 works everywhere; HEVC gives the same quality at lower bitrate and every phone from the last several years decodes it; AV1 is better still but needs a recent GPU on the host (RTX 40-series, RDNA 3, Arc) and a client that decodes it, which rules out most TVs. Set the codec in Moonlight, not Sunshine, and start with HEVC.

Bitrate: Moonlight's default of 20 Mbps for 1080p60 is right for most LANs. For 4K push to 40 to 80 Mbps, and for a 120 Hz client (Steam Deck OLED, a gaming phone) match the frame rate on both ends, because a 60 fps stream on a 90 Hz screen judders in a way a 60 Hz screen never shows.

Away from home, Sunshine has no relay and no account; it is your network or nothing. The clean answer is Tailscale on host and client, which makes the PC appear on a private IP with no port forwarding, and Moonlight connects to it as if local. The catch is physics: your home upload speed caps the bitrate, so a 20 Mbps upload plan means a 10 to 15 Mbps stream at best, and a hotel Wi-Fi with 60 ms of jitter is unplayable for shooters and fine for a turn-based game. Drop to 720p, enable HEVC, and expect the stream quality to reflect the worse of the 2 connections. The port-forward route is a fallback that exposes the pairing endpoint to the internet, and I would not choose it when Tailscale takes 10 minutes. The broader options are in remote access three ways.

Docker is the wrong default for this one

There is an official lizardbyte/sunshine container, and it is useful for exactly one situation: a Linux server with a spare GPU that you want as a dedicated streaming desktop. It needs the GPU passed through and a display server running inside or beside it, and most people who try it are really looking for Games on Whales or Steam Headless, which bundle a virtual desktop, Steam, and Sunshine into one deployment. If the gaming PC is a normal Windows or Linux desktop, install Sunshine on it natively; the container adds friction and removes nothing.

What I'd do

Sunshine natively on the gaming PC, Ethernet to the router, dummy plug or Apollo's virtual display so it runs with the monitor off, and PIN pairing from every Moonlight client in the house. HEVC at 20 Mbps for 1080p, 40 to 60 for the TV at 4K. Tailscale on host and phone for the odd session away, with expectations set by whatever upload speed the ISP sold me. Since NVIDIA killed GameStream in 2023 this pairing has been the only serious open-source option, and with 40,554 stars and a busy release cadence it is also a well-maintained one.

Compare Sunshine

4 head-to-head comparisons.

Similar remote access & vpn apps