10 min read

Sunshine + Moonlight: Build Your Own Cloud Gaming Service

Stream your own gaming PC to any device, anywhere, with Sunshine, Moonlight, and Localtonet. No subscription, no server rental, your own hardware

Sunshine ยท Moonlight ยท Game Streaming ยท Cloud Gaming ยท 2026

GeForce NOW and Xbox Cloud Gaming charge a monthly fee to rent a GPU you may already own. Sunshine, an open-source implementation of NVIDIA's discontinued GameStream protocol, turns your own gaming PC into that same kind of streaming server, paired with the free Moonlight client on almost any screen you own. The part most guides gloss over is what happens when you leave your home network: Sunshine talks over seven different ports, and the one you must never expose is the one every beginner tries first. This guide covers installing Sunshine, pairing Moonlight locally, and reaching your PC from anywhere with Localtonet, the right way.

๐ŸŽฎ Stream your own PC to any device, anywhere ๐Ÿ†“ Free and open source, no subscription ๐ŸŒ UDP-native tunneling, no router configuration

Why Rent a GPU You Already Own

Cloud gaming services solved a real problem: not everyone owns a powerful gaming PC. But if you already do, and it spends most of the day idle while you are at work or traveling, a subscription to stream someone else's hardware stops making sense.

Sunshine and Moonlight solve the same problem from the other direction. Your PC does the rendering, exactly like it always has, and the stream travels to whatever screen you happen to be holding.

The hardware you need is very likely the gaming PC already sitting under your desk.

What Are Sunshine and Moonlight?

Sunshine is the host, the software that runs on your gaming PC and captures, encodes, and streams your screen. Moonlight is the client, a free app you install on the device you want to play from. Together they reimplement NVIDIA's GameStream protocol, the same one that originally shipped with GeForce Experience before NVIDIA discontinued it.

โšก Hardware-accelerated encoding Uses NVENC on Nvidia GPUs, QuickSync on Intel, and AMF on AMD, so encoding barely touches your frame rate. A software fallback exists for GPUs without a hardware encoder.
๐Ÿ“ฑ Runs on almost anything Moonlight has clients for Windows, macOS, Linux, Android, iOS, Apple TV, Android TV, LG webOS smart TVs, Raspberry Pi, and a browser version.
๐Ÿ”ง Configured entirely through a web UI Sunshine's own interface handles app lists, encoder settings, and client pairing, no config file editing required for a first setup.
๐Ÿ†“ Completely free Both Sunshine and Moonlight are open source. No subscription, no per-hour GPU rental.

Install Sunshine and Pair Moonlight Locally

1

Install Sunshine on your gaming PC

Download the installer for your OS from the LizardByte Sunshine releases page. The Windows installer configures the firewall rules for you automatically.

2

Open the Sunshine web UI

Visit https://localhost:47990 on the same machine. Your browser will warn about an insecure certificate, this is expected, Sunshine self-signs it. Write down the username and password shown on first run, it is not shown again.

3

Confirm your encoder

Sunshine tries encoders in order and picks the first one that works. Check the Configuration tab to confirm it selected NVENC, QuickSync, or AMF rather than falling back to software encoding.

4

Install Moonlight and pair on the same network

Install Moonlight on your phone, laptop, or streaming device while it is still on the same Wi-Fi as your PC. Add the host, enter the PIN Sunshine displays, and confirm you can stream before going any further. iOS and tvOS require this local pairing step by platform policy.

Two Ways to Reach Sunshine From Outside Your Home

Once local pairing works, you have two real options for streaming away from home. Pick based on how many devices you need to reach it from.

๐Ÿ” Option A: Localtonet VPN Manager (recommended)

VPN Manager creates a private mesh network between your gaming PC and every device you add to it, each one gets a Virtual IP, and traffic between them never touches the public internet. Sunshine's seven ports simply work, the same way they do on your home Wi-Fi, because as far as Sunshine and Moonlight are concerned, your phone across the country and your PC are on the same network. There is nothing to expose publicly and no port list to manage. This is the better option if the devices you stream from are ones you control and can install the Localtonet Client on.

๐ŸŒ Option B: Direct TCP/UDP tunnels (for streaming to someone else's device)

If you want to let a friend connect from a device where installing the Localtonet Client is not practical, you can tunnel Sunshine's ports directly. This requires more setup and, unlike VPN Manager, involves exposing ports publicly, so treat it as the option for occasional access rather than the default.

โš ๏ธ Most tutorials skip this step: never tunnel port 47990

Port 47990 is Sunshine's web UI, the same page that shows pairing PINs and configuration. Sunshine's own documentation is explicit: do not expose this port to the internet. Only tunnel the streaming ports listed below.

PortProtocolPurposeTunnel it?
47984TCPLegacy HTTPSYes
47989TCPWeb / pairing handshakeYes
47990TCPSunshine configuration UINo, never
48010TCPVideo (RTSP)Yes
47998UDPControlYes
47999UDPAudioYes
48000UDPVideoYes
48002UDPInputYes
Reserve every port before you pair

Most Moonlight clients cannot be told to use a non-standard port, they expect Sunshine's default numbers. That means each tunnel above needs Localtonet's Reserved Port add-on set to the same external port as the internal one: 47984 stays 47984, 47998 stays 47998, and so on. Without a reservation, the public port can change on restart and Moonlight will fail to find your host.

1

Create one tunnel per row in the table above

Go to localtonet.com/tunnel/tcpudp, select TCP or UDP to match the port, set the local IP to 127.0.0.1, and enter the port.

2

Reserve each port from Add-ons

Set the reserved external port equal to the local port for every tunnel, so the numbers match Moonlight's expectations exactly.

3

Add the host manually in Moonlight

Use Moonlight's "Add PC Manually" option and enter your Localtonet public address instead of a LAN IP. Pair with the PIN Sunshine shows, same as the local pairing step.

๐Ÿ›  Tips for a Smoother Stream

๐Ÿ“ถ Upload speed matters more than download Your PC is the one sending video out. A stable 20+ Mbps upload comfortably supports 1080p60 streaming with headroom to spare.
๐ŸŽ›๏ธ Match bitrate to your connection Start around 20,000 kbps for 1080p60 and drop it if you see stutter on a slower connection, rather than guessing at resolution first.
๐Ÿ”Œ Wire your host machine if you can Wi-Fi on the streaming PC adds latency and jitter before the stream even leaves the house. Ethernet on the host machine is worth it.
๐Ÿ–ฅ๏ธ Keep Sunshine and your GPU driver current Encoder support and latency improvements land in both regularly, an outdated driver is a common cause of encoder fallback to software mode.

Self-Hosted Streaming vs. Cloud Gaming Subscriptions

FeatureGeForce NOW / Xbox Cloud GamingSunshine + Moonlight + Localtonet
Monthly costSubscription tier requiredFree, beyond hardware you already own
Game libraryLimited to supported titlesAnything installed on your own PC
Save files and modsTied to the provider's environmentExactly what is already on your PC
Session limitsTime caps on lower tiersLimited only by your own PC being on
Setup effortNone, sign up and goAn evening of one-time setup

The honest trade-off: a cloud gaming subscription is genuinely the easier path if you do not already own a capable gaming PC, there is no hardware to buy and nothing to configure. Self-hosting wins the moment you already have the PC, since every dollar of the subscription is then paying for something you own twice over.

Troubleshooting Common Issues

SymptomLikely causeFix
Moonlight cannot find the host remotelyA tunnel's public port does not match the reserved local portRecheck each Reserved Port setting against the table above, they must match exactly
Pairing PIN never appearsPort 47989 (or the web UI at 47990) is not reachableConfirm the 47989 tunnel is running; never rely on 47990 for this, it should not be tunneled at all
Stream connects but freezes or stuttersInsufficient upload bandwidth or Wi-Fi on the hostWire the host machine with Ethernet and lower the bitrate in Moonlight's stream settings
Encoder falls back to software modeOutdated GPU driver or unsupported GPU generationUpdate the GPU driver; confirm your card meets Sunshine's minimum generation for NVENC or QuickSync

Frequently Asked Questions

Do I need an Nvidia GPU to use Sunshine?

No. Sunshine supports hardware encoding on Nvidia (NVENC), Intel (QuickSync), and AMD (AMF) GPUs, plus a software encoder as a fallback on anything else, though software encoding uses more CPU and adds latency.

Should I use VPN Manager or direct port tunnels?

VPN Manager for your own devices, it avoids exposing any Sunshine port publicly and needs no port reservation. Direct tunnels only make sense when you need to stream to a device you cannot install the Localtonet Client on, such as a friend's PC.

Why can't I just tunnel port 47990 and use the web UI remotely?

Sunshine's own documentation explicitly warns against exposing it. That page controls pairing and configuration, and anyone who reaches it could pair their own device with your PC. Manage configuration locally or over VPN Manager instead.

Can I stream to my phone on mobile data?

Yes, as long as your home upload speed and your phone's mobile connection can both sustain the bitrate. Expect to lower the bitrate compared to a Wi-Fi connection.

Why does Moonlight require pairing on the same network first?

It is the officially recommended setup order, and mandatory on iOS and tvOS by platform policy. It also confirms your Sunshine and Moonlight setup works before you add tunneling into the mix.

Can I stream multiple PCs from one account?

Yes. Install Sunshine and the Localtonet Client on each PC, they each authenticate with their own device token, and Moonlight can pair with as many hosts as you add.

Does my PC need to stay on for streaming to work?

Yes, Sunshine and the Localtonet Client both need to be running on the host PC. Running both as background services means they are ready the moment the PC is on, without manually starting anything.

Ready to Stream Your Own PC Anywhere?

Install Sunshine, pair Moonlight on your home network, then reach your PC from anywhere with a Localtonet VPN or tunnel. Free to start, no credit card required.

Get Started Free โ†’

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

support