Build Your Own Low-Latency Gaming Cloud with Sunshine, Moonlight, and Tailscale
Turn your gaming PC into a private cloud with Sunshine, Moonlight, and Tailscale. Learn local setup, secure remote play, tuning tips, and common fixes.
You already own the GPU. The trick is turning it into a private game-streaming node you control. This guide shows you how to use Sunshine as the host, Moonlight as the client, and Tailscale as the secure remote path — so you can play your PC library from another room or from outside the house without renting someone else’s cloud box.
Why this stack works
Sunshine runs on your gaming PC and handles capture, encoding, app launching, and pairing. Moonlight runs on the device in your hands and handles decoding, display, audio, and input. Tailscale is optional on your home network, but it’s the cleanest way to reach your host remotely — it builds a private tailnet between devices instead of asking you to expose services to the open internet.
| Layer | Tool | Job |
|---|---|---|
| Host PC | Sunshine | Capture, encode, pair clients, expose apps |
| Client device | Moonlight | Decode stream, display video/audio, send input |
| Remote networking | Tailscale | Private connectivity between host and client |
What you need before you start
- A gaming PC that can stay powered on during sessions
- Sunshine installed on the host (we’ll cover this below)
- Moonlight installed on the client device you want to play from
- A local network for initial pairing
- Tailscale on both devices (for remote play away from home)
- Ethernet for the host is strongly recommended; 5 GHz Wi-Fi on the client at minimum
- iOS/tvOS users: you must pair on the same local network first
How the setup fits together
Sunshine captures your host display using OS-level capture methods, then encodes the stream using your GPU’s hardware encoder — NVENC for NVIDIA, AMF for AMD, QuickSync for Intel — falling back to software encoding if needed. Moonlight decodes it, displays it, and sends your controller, mouse, keyboard, or touch input back to the host.
If you’re on the same LAN, the traffic stays local. If you’re away from home, Tailscale bridges the two devices over a private path, with the best results coming from a direct peer-to-peer connection rather than a relayed one.
Install Sunshine on the host
- Download and install Sunshine on your gaming PC.
- Open the Sunshine Web UI at
https://localhost:47990. Your browser will show a certificate warning because Sunshine uses a self-signed certificate — that’s normal, click through it. - Create your admin username and password.
- In the Web UI, go to the Audio/Video tab and verify that Sunshine detects your GPU encoder. It supports hardware encoding across AMD, Intel, and NVIDIA where available.
- Check the Applications section — Sunshine comes preloaded with Desktop and Steam Big Picture entries, which is enough to start testing.
Pair Moonlight on the local network
- Install Moonlight on your tablet or remote device. Moonlight supports phones, tablets, laptops, Apple TV, and more.
- Put the client on the same network as your host for the first pairing. In most cases, your PC appears automatically after a few seconds. If it doesn’t, click Add Host and enter your PC’s local IP address.
- Click the host entry in Moonlight. Moonlight will show you a PIN. In Sunshine, open the PIN tab and enter that code there.
- Launch Steam or Desktop and confirm that video, audio, and controls all work before moving on to remote access.
iOS and Apple TV users: you must pair on the same local network. Remote pairing is not supported on Apple platforms.
Add secure remote play with Tailscale
Tailscale avoids the “which ports do I forward?” trap entirely. It builds a private mesh network between your devices.
- Install Tailscale on your host and client, then sign them into the same tailnet.
- Confirm both devices appear online in the Tailscale dashboard. Each device gets a Tailscale IP (100.x.y.z) and a DNS name.
- In Moonlight on your client, click Add Host and enter your PC’s Tailscale IP or MagicDNS hostname (e.g.,
gaming-pc.tailnet-name.ts.net). Auto-discovery doesn’t work across the Tailscale tunnel, so manual entry is required. - Check your connection quality. On either device, run:
If you seetailscale statusdirect, you’re on the best path — peer-to-peer, lowest latency. If you seerelay, traffic is routed through an intermediate server, which adds latency. For gaming, aim for a direct connection. You can also test with:tailscale ping <device-name>
If Tailscale is stuck on relays, it’s usually a firewall blocking UDP. Most of the time you don’t need to open ports manually, but in stricter networks, allowing outbound UDP 3478 and 41641 can help Tailscale establish a direct path.
Tuning and troubleshooting
Tune for stability, not max settings
Moonlight can stream at 4K HDR and 120 FPS on capable hardware, but those are ceilings, not defaults. Start with a resolution and frame rate that matches your client display and network quality, then increase only if the stream stays stable. Lower bitrate with smooth playback beats high bitrate with stutter every time.
If both host and client support it, HEVC or AV1 encoding can improve quality per bit compared to H.264. H.264 remains the safest baseline if you’re troubleshooting across mixed devices.
For real-time streaming, stability matters more than headline bandwidth. Test your path with iperf3 when you suspect network issues:
# On the Sunshine host
iperf3 -s
# On the client
iperf3 -c <HostIpAddress> -t 60 -u -R -b 50M
Watch packet loss and jitter. Both should be very low — ideally packet loss below 5% and jitter under 1 ms. If the stream stutters, reduce bitrate first, then resolution or FPS, before blaming the hardware.
Common issues
| Problem | What to check |
|---|---|
| Host doesn’t appear in Moonlight | Pair on the same LAN first, then add host manually by IP |
| Pairing PIN fails | Enter the PIN in Sunshine’s PIN tab, not Configuration |
| Remote play is slow or unstable | Check if Tailscale shows direct or relay; lower bitrate; test with iperf3 |
| Black screen on tablet when game starts | Game may be launching on the physical monitor. Switch the game to Windowed mode or set your virtual display as primary in Windows |
| Controller works in Steam but not games | Adjust Steam controller support settings; on Windows, install ViGEmBus for virtual gamepad support |
| Need full desktop, not just game library | Sunshine includes a Desktop app entry for full desktop streaming |
Optional hardware that improves the experience
The gear matters less than a stable network and hardware decoding support on your client. That said, a good controller and a tablet with a nice screen go a long way.
Recommended gear:
- Samsung Galaxy Tab S6 Lite — great screen, perfect Moonlight client
- 8BitDo Pro 2 Controller — comfortable, solid latency, works across platforms
Essential tools:
- Sunshine — self-hosted game stream host
- Moonlight — open-source GameStream client for all platforms
- Tailscale — zero-config mesh VPN for secure remote gaming
That’s the setup: your own library, your own hardware, your own network path — optimized for low latency, not magic. Pair locally first, check for a direct Tailscale connection when remote, and tune for stability over vanity settings.