Building your own cloud gaming service is simpler than it sounds. With two open-source, free tools โ Sunshine (host) and Moonlight (client) โ you turn a rented cloud GPU into a personal console, streaming games at 4K@60 with sub-30ms latency to any device. This tutorial walks you through the whole thing, from zero to a running game.
โก What you'll do
1) Launch a GPU instance; 2) install NVIDIA drivers; 3) install and configure Sunshine on the host; 4) open the required ports; 5) pair Moonlight on your device; 6) tune bitrate, resolution, and latency. All billed by the hour, in reais.
Before you start: how the pieces fit
Sunshine runs on the machine that has the GPU (the host, in the cloud). It captures the screen and encodes the video using the card's hardware encoder โ NVENC on NVIDIA GPUs. That dedicated chip is what keeps latency low: the CPU isn't bogged down compressing video.
Moonlight is the client you install on your device (Windows, Mac, Linux, Android, iOS). It receives the stream, displays it on your screen, and sends back your keyboard, mouse, or controller input. Any GPU with a hardware encoder works as the host โ every card we offer (RTX 3070/3080/3090, RTX 4080/4090, RTX 5090, RTX A6000, RTX 6000) has NVENC.
Step 1 โ Launch a GPU instance
In the Console, create an instance with the GPU that suits what you'll play. For 1080p/1440p, an RTX 3080/3090 or 4080 handles it; for 4K with ray tracing, go for an RTX 4090 or 5090. Billing is hourly, in reais via Pix, so you only run it during the session. Not sure which to pick? See how to choose your GPU.
๐ก Linux vs. Windows
The platform provisions Ubuntu/Linux images by default. On Linux you play via Proton/Steam, which has excellent compatibility today. If a specific game requires Windows, bringing up that environment may require your own license and configuration.
Step 2 โ Install the GPU drivers
Connect to the instance and install the latest NVIDIA driver. On Ubuntu, this usually does it:
# Ubuntu โ install the recommended NVIDIA driver
sudo ubuntu-drivers autoinstall
sudo reboot
# After reboot, confirm:
nvidia-smi
If nvidia-smi shows your GPU, the driver is working and NVENC is available to Sunshine.
Step 3 โ Install and configure Sunshine
Download the Sunshine package for your distribution (official .deb files exist) and install it:
# Example on Ubuntu (adjust the .deb version)
sudo apt install -y ./sunshine.deb
# Start the service
sunshine
Sunshine opens a web admin interface (by default at https://localhost:47990). Open it, set a username and password, and under Configuration confirm the selected encoder is NVENC. This panel is also where you generate the pairing PIN that Moonlight will ask for.
Step 4 โ Open the required ports
Sunshine uses a set of ports for control, video, and audio. The main ones are TCP 47984, 47989, 48010 and UDP 47998โ48000. Allow them in the instance firewall:
# Example with ufw (adjust for your network)
sudo ufw allow 47984:48010/tcp
sudo ufw allow 47998:48000/udp
sudo ufw reload
Also make sure those ports are allowed in the instance's security/network group in the Console, so your client can reach the host.
Step 5 โ Pair Moonlight on your device
Install Moonlight on the device you'll play from (it's free for Windows, Mac, Linux, Android, and iOS). Open the app and:
- Add the host manually using your instance's public IP;
- Moonlight will ask for a PIN โ generate it in the Sunshine web UI and confirm;
- Done: the host appears in the list and you can start the Desktop or a configured game.
Step 6 โ Tune bitrate, resolution, and latency
In Moonlight, open settings and tune for your connection:
| Scenario | Resolution / FPS | Suggested bitrate |
|---|---|---|
| Excellent connection | 4K @ 60 | 80โ150 Mbps |
| Good connection | 1440p @ 60 | 40โ80 Mbps |
| Modest connection | 1080p @ 60 | 20โ40 Mbps |
If you see stutter or artifacts, lower the bitrate first, then the resolution. Use a wired connection when possible and the HEVC/H.265 codec (or AV1 if your card supports it) for better quality per bit. With the instance's Brazil-local latency, sub-30ms end-to-end is commonly achievable.
๐งฉ Easier alternative: Parsec
If you prefer plug-and-play, Parsec is a commercial, managed alternative that simplifies pairing and setup. Sunshine + Moonlight remains the open-source, free, and most tunable route.
Honest caveats
- Kernel-level anti-cheat: games like Valorant (Vanguard) and some Easy Anti-Cheat titles often block cloud/VM and may not run. Single-player and many multiplayer games work fine.
- Windows vs. Linux: it's Linux by default (play via Proton/Steam). For Windows, plan on your own license and configuration.
- It's hourly: great for occasional sessions or one-off marathons โ shut the instance down when you finish so you don't pay for idle time.
Build your cloud gaming rig now
Get R$25 free and launch a GPU with NVENC to test Sunshine + Moonlight today.
Get Started Free โFrequently asked questions
What's the difference between Sunshine and Moonlight?
Sunshine is the host server that runs on the GPU machine and captures/streams the video using the card's hardware encoder (NVENC on RTX cards). Moonlight is the free client you install on your device (Windows, Mac, Linux, Android, iOS) to receive the stream and send your input back. Both are open-source and free.
Do I need a specific GPU to use Sunshine?
Sunshine works with any GPU that has a hardware video encoder โ NVENC on NVIDIA cards (RTX 3070/3080/3090, RTX 4080/4090, RTX 5090, RTX A6000, RTX 6000), plus AMD and Intel equivalents. That encoder is what enables low-latency streaming.
Is there an easier alternative to Sunshine?
Yes. Parsec is a commercial, managed alternative that simplifies setup and pairing โ useful if you prefer a plug-and-play solution over configuring host, ports, and client manually. Sunshine + Moonlight remains the open-source, free, and highly tunable option.
Conclusion
With Sunshine + Moonlight, building a personal cloud gaming rig is a few-minutes job: launch the GPU, install the driver, configure the host, open the ports, and pair the client. The result is a genuinely powerful machine, yours for the session, streaming high quality to any device โ billed by the hour, in reais, with Brazil-local latency. Want to understand the economics behind it? See why renting an RTX 4090 is cheaper than buying.
Read next: Playing AAA in the cloud: the full math ยท How to choose your GPU