Introduction
Moonlight is an open source implementation of NVIDIA's GameStream protocol that lets you stream games and applications from a powerful PC to almost any device on your network. Originally a reverse-engineering effort of the Shield streaming protocol, it has grown into the go-to client for self-hosted game streaming when paired with Sunshine as the host.
What Moonlight Does
- Streams games and desktop applications from a host PC to clients over a local network or the internet
- Supports up to 4K resolution at 120 fps with HDR on compatible hardware
- Provides hardware-accelerated video decoding on the client for minimal CPU usage
- Works with gamepad, keyboard, and mouse input forwarded to the host with low latency
- Available on Windows, macOS, Linux, iOS, Android, ChromeOS, and Steam Link
Architecture Overview
The host (Sunshine or NVIDIA GameStream) captures the screen using GPU hardware encoders (NVENC, AMF, or VA-API), encodes the video as H.264 or HEVC, and streams it over RTSP to the client. Moonlight decodes the stream using platform-native hardware decoders and renders the frames. Input events are sent back over a low-latency control channel. The entire pipeline is optimized to keep end-to-end latency under 30 ms on a good LAN.
Self-Hosting & Configuration
- Pair with the host by entering the PIN displayed in Moonlight into the host's web UI
- Video settings (resolution, frame rate, bitrate) are configured in Moonlight's settings panel
- For internet streaming, configure port forwarding or use a VPN like Tailscale or ZeroTier
- Audio can be streamed alongside video or kept on the host
- Custom apps and games can be added to the host's app list via Sunshine's web interface
Key Features
- Sub-30 ms latency on a local gigabit network with hardware encoding and decoding
- HDR passthrough for vivid colors on supported displays and GPUs
- Multi-controller support for local co-op gaming on the client device
- Clipboard sharing and remote desktop mode for productivity use
- HEVC and AV1 codec support for better quality at lower bitrates
Comparison with Similar Tools
- Steam Remote Play — Built into Steam; easy setup but limited to Steam library and higher latency
- Parsec — Low-latency cloud gaming service; commercial with a free tier, closed source
- Sunshine — The recommended host companion for Moonlight; open source replacement for NVIDIA GameStream
- NVIDIA GameStream — The original proprietary host; deprecated in favor of Sunshine
- Remote Desktop (RDP/VNC) — General-purpose remote access; not optimized for gaming latency or frame rates
FAQ
Q: Do I need an NVIDIA GPU to use Moonlight? A: No. When paired with Sunshine as the host, Moonlight works with NVIDIA, AMD, and Intel GPUs. The original NVIDIA GameStream required an NVIDIA GPU, but Sunshine removed that limitation.
Q: Can I stream over the internet? A: Yes, but it requires port forwarding or a VPN. A VPN like Tailscale is the simplest approach and avoids exposing ports to the public internet.
Q: What is the difference between Moonlight and Sunshine? A: Moonlight is the client that receives and displays the stream. Sunshine is the host that captures, encodes, and sends the stream. They work together as a pair.
Q: Does Moonlight support mouse and keyboard input? A: Yes. Moonlight forwards mouse, keyboard, and gamepad input to the host. You can use it as a full remote desktop replacement for gaming or productivity.