馃摎 Reference guide

Set Up Sunshine on Windows 11 for Moonlight

Install Sunshine on a Windows 11 PC, set the web password, pair Moonlight with a PIN, and keep streaming on the home network.

Category: Gaming

TL;DR

Sunshine on a Windows 11 PC lets Moonlight play that PC鈥檚 games somewhere else on your network. Install Sunshine, set a strong web password, and pair with a PIN. This page is the PC. Handheld client setup is in the AYN Thor guide.

What you need

Install Steam on the host when you want Steam Big Picture. Other games can be added on their own.

Install Sunshine

  1. Open the Sunshine releases page and download the current Windows installer. On an Intel or AMD PC, use the 64-bit .msi. Uninstall an older copy that was not installed from an MSI before you run the new one.
  2. Run the installer. Leave the service and the firewall parts selected. The service is what keeps Sunshine running in the background. Do not start a second copy next to it.
  3. If Windows asks which networks to allow, choose private networks.
  4. Reboot once when you are done. A controller often needs that reboot before it shows up in a stream.

Confirm the service from an administrator Command Prompt if the tray icon never appears:

sc.exe query SunshineService

You want the state to read RUNNING.

Set the web password

  1. Right-click the tray icon and choose Open Sunshine, or open https://localhost:47990 in a browser on the PC.
  2. The browser warns that the certificate is not trusted. Sunshine uses a self-signed certificate. Continue, on this PC, to the page you just installed.
  3. The first launch asks for a username and a password. Use a long password that you do not use for anything else, and save both somewhere you can look them up. If you lose them, reset them with the command at the end of this page.
  4. Sign in when the page asks you to.

Anyone who can open this page and sign in can pair a new client that reaches the PC. That is the whole reason the password exists.

Stay safe

  • Use a long, unique password on the Sunshine web page. Anyone who can sign in can pair a new client to the PC.
  • Do not port-forward port 47990 or the streaming ports, and do not turn on UPnP. Opening those ports publishes the PC past your home network.
  • For play away from home, put both the PC and the client on a VPN. Pair them on the home LAN first. Proton VPN (affiliate link) is one WireGuard or OpenVPN option.

Leave UPnP off under Configuration, then Network. UPnP asks the router to publish the stream. The web page should stay reachable from your LAN only.

Pair a client

  1. Install Moonlight on the client and join it to the same network as the PC. For a handheld, follow the AYN Thor guide from the client install onward.
  2. Moonlight should list the PC after a few seconds. If it does not, add the PC by its LAN address. 192.0.2.50 is only the shape of an address. Use the IPv4 address from ipconfig on the host, from the Ethernet adapter when there is a cable.
  3. Select the PC. Moonlight shows a PIN.
  4. On the host, open PIN in the Sunshine page, type the PIN, type a device name, and submit.
  5. You should get a success message. Then start an app from Moonlight.

Sunshine already lists Desktop and Steam Big Picture. Start Desktop first when Windows is locked, sign in, and then start the game or Big Picture. A program that exits immediately ends the stream. Add other games under Applications. Restart Moonlight if a new entry does not show up.

Two live network adapters on the host are a common reason the PC never appears. Unplug the slower one, or disconnect Wi-Fi when Ethernet is already up. Turn a VPN off for the at-home test, including a switch that blocks the local network. Turn it back on when you leave the house.

Picture and the encoder

Set the first stream in the client, not in a pile of host toggles.

A PC with no monitor needs a dummy plug on the GPU you want to encode with. Keep that display awake during the stream. On a desktop Moonlight window, Ctrl+Alt+Shift+Q quits the stream and leaves the game running.

If it doesn鈥檛 work

netsh advfirewall firewall add rule name="GameStream UDP" dir=in protocol=udp localport=5353,47998-48010 action=allow
netsh advfirewall firewall add rule name="GameStream TCP" dir=in protocol=tcp localport=47984,47989,48010 action=allow
sc.exe stop SunshineService
cd /d "%ProgramFiles%\Sunshine"
.\sunshine.exe --creds USER PASS
sc.exe start SunshineService

Uninstall from Windows Settings, then Apps. Remove the two GameStream rules first if you added them:

netsh advfirewall firewall delete rule name="GameStream UDP"
netsh advfirewall firewall delete rule name="GameStream TCP"

Sources

Spot something wrong or outdated? Leave a comment below. Every comment is reviewed to keep these posts accurate.

By commenting, you agree to our Terms of use and confirm this is your own work. Short quotes are fine with a credit and link. Copied, unsafe, or abusive comments are removed. See something copied? Say so here.