- Implementation of a local streaming ecosystem by combining a sending server and a receiving client.
- Advanced operating system and network optimization to eliminate input lag and FPS drops.
- Configure remote access via VPN or open ports to play from anywhere in the world.

How to install and configure Sunshine to stream games from Windows? Imagine being able to play a few rounds of your most demanding PC games lying on the living room sofa or even from another city, but with a fluidity almost identical to playing in front of the monitor. Thanks to open-source tools like Sunshine and Moonlight, this is no longer science fiction, but an accessible reality for anyone with a decent computer and a stable connection.
Although simpler options exist, this combo is the absolute king because minimize latency as much as possibleallowing us to play competitive titles without experiencing that annoying input lag. Basically, we're talking about setting up our own cloud gaming service, but without relying on external servers and taking advantage of the raw power of our own graphics card.
Understanding the ecosystem: Sunshine, Moonlight and their variants

For all of this to work, we need two fundamental pieces. On one hand we have Sunshine, which acts as the serverIt's the program we install on the powerful PC to capture images and sound and send them over the network. On the other hand, there's Moonlight, which is the client; the application that we install on the device where we want to play (whether it's an Android TV, an iPhone, a Steam Deck or even another laptop).
If you're looking for something more advanced, there are forks like Apollo and ArtemisThe great advantage of Apollo is that it creates a virtual monitor on the receiving deviceThis allows you to turn off the host PC's screens to save energy and resources, thus avoiding the hassle of having to manually configure resolutions on the physical monitor.
Step by step: Installation and start-up

The first step is to download Sunshine from its official repository on GitHub. Once installed, we must Run it with administrator privileges and access your control panel through your web browser (usually at the address https://localhost:47990There we will create a username and password to protect access.
Next, we install Moonlight on the client device. Upon opening it, the program should automatically detect the PC if they are on the same network. To link them, Moonlight will give us a four-digit PIN code which we must enter in the "Pin" tab of the Sunshine web interface on the host PC. Once this is done, the connection is established and we can launch the desktop or specific games.
A vital detail for the controllers to work is installing the driver. ViGEmBus on the server PCWithout this controller, Moonlight is very likely to not recognize inputs from the Xbox or PlayStation controller, leaving us with the perfect video but without control over the character.
Extreme optimization to eliminate lag

If you want a truly premium experience, you can't leave Windows with its factory settings. To avoid FPS drops, it's recommended to Disable Windows Game Mode and the dynamic refresh rate (DRR). It's also a good idea to put the power plan in High performance and close any unnecessary applications that is consuming bandwidth in the background.
Regarding networking, the golden rule is Connect the host PC via Ethernet cableTo further reduce latency, we can access the network adapter properties and disable options such as Flow Control, the green Ethernet and interrupt moderation. If you use Windows, an advanced trick is to change the process priority sunshine.exe a real-time using a PowerShell scriptensuring that the system doesn't take away resources while you play.
Video settings and codecs according to the hardware
Image quality depends entirely on your GPU's encoder. In Sunshine, we must force the use of the specific hardware: NVENC for NVIDIA cardsAMF for AMD or QuickSync for Intel. If you have an AMD card, configure the use of AMF in ultralowlatency mode And rate control in VBR is essential to avoid visual artifacts.
In the Moonlight client, the choice of codec is key. H.265 (HEVC) or AV1 They are much more efficient than H.264, offering superior quality while consuming less bandwidth, although they require more decoding power. To avoid screen tearing, it is recommended Disable V-Sync and Frame Pacing in competitive games, although for single-player games it's better to leave them active for smoother gameplay.
How to play from away from home (WAN)
To stream over the internet, we have two options. The simplest is to use a VPNs like Tailscale or ZeroTierIt creates a secure virtual network between your devices without touching the router. It's the ideal option for those who don't want technical complications, although it may add a few milliseconds of latency.
If you're looking for maximum performance, the ideal thing to do is Port Forwarding on the routerWe must open TCP ports 47984 and 47989, and UDP ports 47998, 47999, 48000, and 48002, pointing them to the PC's local IP address. To turn on the computer remotely, we can activate the Wake-on-LAN in the BIOS or use a smart plug configured to boot the PC when it receives power.
By combining an optimized network, the use of drivers like ViGEmBus, and the correct selection of codecs for our GPU, we can transform any monitor in the house into a top-tier gaming station. The secret lies in... balancing resolution and bitrate Depending on the strength of your connection, always prioritize Ethernet over Wi-Fi to ensure a smooth and uninterrupted experience. Now you know how to install and configure Sunshine to stream games from Windows.
Index