Cloud gaming services like GeForce NOW and Xbox Cloud Gaming are convenient, but they come with subscription fees, game library limitations, and dependency on external servers. What if you could stream your own PC games to any device — phone, tablet, TV, or laptop — using your own hardware?
Enter Sunshine and Moonlight: an open-source, self-hosted game streaming solution that gives you complete control. Sunshine is a game streaming host that runs on your gaming PC or server, while Moonlight is the client app available on nearly every platform. Together, they deliver low-latency, high-quality game streaming over your local network or the internet.
This guide will walk you through everything you need to know: installing Sunshine on your host PC, setting up Moonlight clients, optimizing performance, and even streaming remotely via Tailscale.
What Are Sunshine and Moonlight?
Sunshine is an open-source implementation of NVIDIA’s GameStream protocol. It captures your PC’s screen and audio, encodes it in real-time using hardware acceleration (NVENC, AMF, or QuickSync), and streams it over the network.
Moonlight is the client application that receives the stream. Originally created to work with NVIDIA’s now-discontinued GameStream, it now works perfectly with Sunshine and supports:
- Windows, macOS, Linux
- Android and iOS
- Raspberry Pi
- Apple TV, Amazon Fire TV
- Even web browsers via Moonlight Embedded
Why Choose Sunshine + Moonlight Over Commercial Solutions?
- Zero subscription fees — your hardware, your rules
- Full game library — stream any game you own, not just what’s in a service’s catalog
- Low latency — especially on local networks
- Privacy — no telemetry, no data collection
- Flexibility — stream entire desktop sessions, not just games
- Cross-platform — works on virtually any device
Prerequisites
Before you begin, you’ll need:
Host PC (Streaming Server)
- Operating System: Windows 10/11, Linux, or macOS
- GPU with hardware encoding:
- NVIDIA (GTX 900 series or newer) — NVENC
- AMD (RX 400 series or newer) — AMF
- Intel (6th gen or newer) — QuickSync
- Network: Wired Ethernet connection recommended
- Open ports (if streaming remotely): 47984-47990 TCP/UDP
Client Device
- Any device capable of running Moonlight
- Stable network connection (Wi-Fi 5 or better recommended)
- For best experience: Bluetooth or USB game controller
Recommended Hardware
For a dedicated streaming server, consider a compact setup:
- Mini PC: Intel NUC 12 or 13 or Beelink SER6 Max — both offer excellent QuickSync encoding
- Gaming PC upgrade: NVIDIA RTX 4060 or higher for best encoding quality
- Network: Gigabit Ethernet switch for local streaming
Step 1: Install Sunshine on Your Host PC
Windows Installation
- Download Sunshine
Visit the Sunshine GitHub releases page and download the latest Windows installer (sunshine-windows-installer.exe).
- Run the Installer
Double-click the installer and follow the prompts. Sunshine will install as a Windows service and start automatically.
- Access the Web UI
Open your browser and navigate to:
https://localhost:47990
You’ll see a certificate warning (self-signed certificate) — this is normal. Accept and proceed.
- Create Admin Account
On first launch, create a username and password for the Sunshine web interface.
Linux Installation (Ubuntu/Debian)
| |
For other distributions, check the official documentation.
Docker Installation (Advanced)
If you prefer containerization:
| |
Note: Host network mode is required for game streaming protocols to work properly.
Step 2: Configure Sunshine
Access the Sunshine web UI at https://localhost:47990.
Audio Configuration
- Navigate to Configuration → Audio/Video
- Set Audio Sink to your primary audio device
- Enable Virtual Audio Device if you want to stream audio without it playing on the host PC
Video Encoding Settings
Encoder: Select based on your GPU
- NVIDIA:
nvenc_h264ornvenc_hevc(HEVC offers better quality at same bitrate) - AMD:
amf_h264oramf_hevc - Intel:
qsv_h264orqsv_hevc
- NVIDIA:
Resolution: Match your monitor or set maximum client resolution (1080p or 4K)
Framerate: 60 FPS for smooth gaming (120 FPS if your client supports it)
Bitrate:
- Local network (1080p60): 20-30 Mbps
- Local network (4K60): 80-100 Mbps
- Remote streaming: 10-15 Mbps
Adding Applications
Sunshine can auto-detect installed games, but you can also add custom applications:
- Go to Applications tab
- Click Add New
- Fill in:
- Application Name: Display name in Moonlight
- Command: Full path to executable
- Working Directory: Game installation folder
- Image: Optional cover art
Example for Steam:
Application Name: Steam Big Picture
Command: "C:\Program Files (x86)\Steam\steam.exe" -bigpicture
Working Directory: C:\Program Files (x86)\Steam\
Network Configuration
- UPnP: Enable if your router supports it (automatic port forwarding)
- External Port: Default 47989 — change if needed
- LAN IP: Sunshine auto-detects this — verify it’s correct
Step 3: Install Moonlight Client
Download Moonlight for your target device:
- Windows/macOS/Linux: Moonlight PC
- Android: Google Play Store
- iOS/tvOS: App Store
- Raspberry Pi/Embedded: Moonlight Embedded
Pairing Process
- Open Moonlight on your client device
- Sunshine host should appear automatically if on the same network
- Click the host name
- Enter the PIN displayed in Moonlight into the Sunshine web UI (Configuration → PIN)
- Click Pair
The pairing generates certificates for secure communication.
Step 4: Optimize Streaming Performance
Network Optimization
For Local Streaming:
- Use Ethernet: Both host and client if possible
- Disable Wi-Fi power saving on client devices
- QoS settings: Prioritize game streaming traffic on your router
- 5 GHz Wi-Fi: If wireless is required, use 5 GHz or Wi-Fi 6
For Remote Streaming:
- Static IP or DDNS: Set up dynamic DNS if your ISP doesn’t provide static IP
- Port forwarding: Forward 47984-47990 TCP/UDP to your Sunshine host
- Upload speed: Minimum 15 Mbps upload for 1080p60 streaming
Sunshine Performance Tweaks
Enable Hardware Scheduling (Windows + NVIDIA):
- Settings → Display → Graphics → Hardware-accelerated GPU scheduling
Set Process Priority:
- Sunshine web UI → Configuration → Advanced
- Set
min_threadsto number of CPU cores - Increase encoder priority to “High”
Disable Desktop Capture Optimizations:
- For best quality, disable Windows Game Bar and other capture tools
AMD Users: Install latest Adrenalin drivers for best AMF encoding
Moonlight Client Settings
- Resolution/FPS: Match what Sunshine is configured for
- Bitrate:
- Local: 30-50 Mbps for 1080p60
- Remote: 10-15 Mbps (adaptive)
- Video decoder: Use hardware decoding (automatic on most devices)
- Audio: Enable surround sound if your setup supports it
- Input latency: Disable V-Sync for lower latency
Step 5: Remote Streaming with Tailscale
For secure remote access without port forwarding, use Tailscale:
Install Tailscale
On Host PC:
| |
On Client Device: Install Tailscale app from official website or app store.
Configure Moonlight for Tailscale
Get your Sunshine host’s Tailscale IP:
1tailscale ip -4In Moonlight, add a host manually using the Tailscale IP
Pair as normal
Now you can stream from anywhere with Tailscale installed, securely and without opening ports.
Troubleshooting Common Issues
Black Screen on Client
Cause: Display capture permissions or encoding issues
Fix:
- Check Sunshine logs: Web UI → Troubleshooting → Logs
- Try different encoder (e.g., switch from HEVC to H.264)
- Update GPU drivers
- Windows: Grant display capture permissions to Sunshine service
High Latency / Stuttering
Causes: Network congestion, insufficient bitrate, encoding overhead
Fixes:
- Lower resolution or framerate
- Reduce bitrate by 25%
- Check network stability (
pingyour Sunshine host) - Close background applications on host
- Use wired Ethernet connection
Audio Crackling
Cause: Buffer underruns or incorrect audio device
Fix:
- Increase audio buffer size in Sunshine settings
- Change audio sink to a different device
- Disable audio enhancements in Windows sound settings
Controller Not Working
Cause: Controller not properly mapped
Fix:
- Pair controller directly with client device (Bluetooth or USB)
- Moonlight will forward inputs to host automatically
- Check controller mappings in Moonlight settings
Can’t Find Host on Network
Causes: Firewall, mDNS issues, or network isolation
Fixes:
- Add host manually using IP address in Moonlight
- Windows: Allow Sunshine through Windows Firewall
- Check Windows Firewall → Allow an app → Sunshine
- Verify both devices are on same subnet (not guest network)
Advanced: Stream Desktop Without Monitor (Headless)
To stream your gaming PC without a monitor attached:
Virtual Display Adapter
Use a dummy HDMI plug:
- 4K HDMI Dummy Plug tricks your PC into thinking a monitor is connected
Software Virtual Display
Windows: Use Virtual Display Driver
Linux: Configure a virtual display in X11/Wayland config
Performance Comparison: Sunshine vs GeForce NOW
| Feature | Sunshine (Self-Hosted) | GeForce NOW |
|---|---|---|
| Cost | Free (hardware cost only) | $9.99-$19.99/month |
| Latency (local) | 5-15ms | N/A |
| Latency (remote) | 20-50ms | 30-80ms |
| Game library | Unlimited (your games) | Limited catalog |
| Session length | Unlimited | 1-6 hours |
| Privacy | Complete | Data collected |
| Quality control | Full control | Limited presets |
Security Best Practices
- Use Tailscale instead of port forwarding when possible
- Strong passwords on Sunshine web UI
- Keep Sunshine updated — check for releases monthly
- Certificate pinning: Moonlight remembers host certificates
- Firewall rules: Only allow necessary ports
- Disable UPnP if not needed to prevent automatic port exposure
Alternative Use Cases
Beyond gaming, Sunshine + Moonlight can:
- Remote desktop access: Stream your entire desktop
- Video editing workstation: Access GPU-accelerated apps from laptop
- Home media server UI: Stream Plex/Jellyfin interface to TV
- CAD/3D rendering: Remote access to workstation-class hardware
Conclusion
Sunshine and Moonlight provide a powerful, flexible, and completely free alternative to commercial game streaming services. With proper setup and network optimization, you can achieve near-native gaming performance on any device, anywhere.
The initial setup takes 30-60 minutes, but once configured, you’ll have a personal cloud gaming service that puts you in complete control — no subscriptions, no limitations, just your games, your way.
Start with local streaming to dial in your settings, then expand to remote access via Tailscale when you’re ready. The combination of modern GPU encoding and efficient network protocols makes self-hosted game streaming better than ever in 2026.
Next steps:
- Experiment with different bitrates and encoders to find your sweet spot
- Set up automatic game detection for Steam, Epic, and GOG libraries
- Configure wake-on-LAN to start your gaming PC remotely
- Join the Sunshine Discord for community support and advanced tips
Happy streaming!