The Ultimate Guide to Setting Up Sunshine and Moonlight

  • Synchronization of a broadcast server on the PC with a receiving client on any compatible device.
  • Advanced optimization of the local network and operating system to eliminate lag and FPS drops.
  • Implementation of virtual network solutions and port opening for low-latency internet gaming.

High-end gaming PC setup with orange RGB lighting and dark atmosphere, ideal for representing the host server.

Have you ever considered playing your most demanding PC games from the comfort of your couch, using your living room TV or even a tablet, without having to move your PC? Well, local streaming is the ideal solution. Thanks to tools like Sunshine and Moonlight , you can turn your computer into a powerful game server and stream the signal in real time to any corner of your house or even outside, maintaining stunning visual quality and near-instantaneous response.

The best part is that this system is the spiritual successor to NVIDIA GameStream, but with the advantage of being open source . This means you're not locked into a single hardware brand; whether you have an NVIDIA, AMD, or Intel graphics card, you can build this ecosystem. If you're looking for an experience that feels like you have your PC connected via HDMI cable but with the freedom to move around your house, you've come to the right place.

Steam Link and Moonlight
Related article:
Steam Link and Moonlight: Play PC games on Android

The main characters: Sunshine and Moonlight

A person relaxing on a sofa playing with a video game controller, illustrating the convenience of local streaming.

For this to work, we need two pieces of software that work together. On one hand, we have Sunshine , which is installed on the powerful PC (the host) and is responsible for capturing the image and sound to send them over the network. On the other hand, there's Moonlight , the application you install on the device where you want to play (the client), which receives the video and sends your controller or keyboard inputs back to the server.

If you're looking for something even more advanced, there are options like Apollo and Artemis . While Sunshine simply displays what's on your screen, Apollo can create a virtual monitor . This is fantastic because it allows you to have different resolutions between the host and the client without any hassle, and even turn off your PC's physical monitors to save power and resources while you play in the living room.

Turn your tablet into a cloud gaming console
Related article:
Turn your tablet into a cloud gaming console

Sunshine server startup

Close-up of a detailed RJ45 Ethernet cable, illustrating the importance of wired connections in reducing lag.

To begin, download Sunshine from its official repository and run it with administrator privileges . Once installed, access its control panel through your web browser (usually at localhost:47990) to create your username and password. In the applications section, you can add specific games or simply configure the entire desktop for complete control.

A crucial detail is the connection: while 5GHz Wi-Fi can be adequate, to avoid lag, the host PC must be connected via Ethernet . For Xbox or PlayStation controllers to work flawlessly, it's essential to install the ViGEmBus driver on the server; otherwise, the video will likely play perfectly, but the controller won't respond.

Host optimization in Windows to reduce lag

Black video game controller with bright blue light on a dark background, representing input devices.

If you want a silky-smooth experience, simply installing the program isn't enough; you need to get the most out of Windows . One of the first things you should do is clean up unnecessary processes. Disable Windows Game Mode so it doesn't interfere with Sunshine's priority, and turn off any power-saving options, setting the power plan to High Performance.

To prevent FPS fluctuations and micro-stuttering, it's recommended to limit the frames per second. You can use your GPU's control panel or, even better, the RivaTuner Statistics Server (RTSS) . Set the FPS limit to exactly match your client's refresh rate (for example, 60 FPS) and adjust the limiter to asynchronous mode to reduce input lag.

Games without lag
Related article:
Smooth gaming: how to get the most out of older devices

At the network level, go to Device Manager and, in the properties of your Ethernet card, disable Flow Control , Green Ethernet, and Interrupt Moderation. Additionally, increasing the receive and transmit (Rx/Tx) buffers to 1024 can make a significant difference in high-bitrate transmissions, preventing data packet loss.

Master settings in the Moonlight client

Young man playing intensely on a smartphone from a sofa in a cozy room, illustrating the client device.

On the receiving device, the first step is to pair the equipment using the PIN code requested by the application. To optimize the image, choose your screen's native resolution and a bitrate appropriate for your network. If you're using a wired connection, you can go up to 80-120 Mbps for 4K, but if you're using Wi-Fi, it's best to stay between 40 and 70 Mbps to avoid the annoying slow connection warning.

Regarding codecs, try different ones to see which gives you the fastest decoding time. HEVC (H.265) is usually the sweet spot between quality and performance, although if you have very modern hardware, the AV1 codec is the most efficient. A trick for Mac users is to disable location services and long-pressing to prevent the keyboard from locking up during gameplay.

Android game server with your Raspberry Pi
Related article:
Reduce latency in mobile games with internal settings

GPU-specific configurations

Sunshine allows you to adjust the encoder according to your brand. For AMD users , it's recommended to use ultralowlatency mode when using AMF and configure the rate control in vbr_latency. If you have NVIDIA , the NVENC encoder is the logical choice due to its very low latency and high compatibility.

For those seeking the most extreme performance, there's a trick: change the priority of the sunshine.exe process to Real-Time from the Task Manager. This ensures that the operating system gives absolute priority to streaming over any other secondary task.

How to play from anywhere in the world (WAN)

If you want to play your games while traveling, you have two options. The simplest and most secure is to use a virtual network VPN like Tailscale or ZeroTier. These tools create a virtual local network where your mobile device and PC appear to be in the same room, without needing to touch your router.

If you prefer maximum speed and have technical knowledge, port forwarding is the ideal solution . You must open TCP ports 47984 and 47989, and UDP ports 47998, 47999, 48000, and 48002 on your router. Keep in mind that this exposes your PC to the internet, so it's essential to use strong passwords on Sunshine.

Steam Link app for Android
Related article:
How to play your Steam games on Android using the Steam Link App: Complete and updated guide

To turn on your PC remotely, you can configure Wake-on-LAN (WoL) in the BIOS. If you're away from home and standard WoL isn't working, a very practical solution is to use a smart plug and enable the "Restore Power after AC Loss" option on your motherboard; this way, with a click from your mobile device, your PC will turn on automatically.

By implementing these improvements, from optimizing network buffers and prioritizing processes to choosing the right codec and managing the remote network, it's possible to transform a home computer into a professional game server. Combining finely tuned hardware with the flexibility of Sunshine and Moonlight results in a smooth gaming experience with stunning image quality and virtually imperceptible latency, regardless of whether the receiver is a handheld console, smart TV, or smartphone.

How to use Razer Nexus and Razer PC Remote Play to play PC games on mobile
Related article:
How to use Razer Nexus and Razer PC Remote Play to play PC games on mobile

Add as preferred source in Google