managing twingate

Sunshine Remote Game Streaming with Twingate

Stream PC games remotely using Sunshine and secure your connection with Twingate Zero Trust network access.

Sunshine Remote Streaming Quick Start

Goal: Get remote game streaming working over Twingate in under 30 minutes

What You’ll Need:

  • Windows PC with gaming GPU (Nvidia, AMD, or Intel)
  • Twingate account (sign up free)
  • Remote device to stream to (laptop, phone, tablet)

Overview

Sunshine is an open-source, self-hosted game streaming server that implements the Nvidia GameStream protocol. It’s actively maintained by LizardByte and works with the popular Moonlight client for low-latency remote gaming.

This guide shows you how to set up Sunshine on your gaming PC and secure remote access through Twingate, eliminating the need for port forwarding or exposing your home network. Why Twingate? Traditional game streaming requires opening ports on your router (security risk) or complex VPN setups. Twingate provides Zero Trust access—your gaming PC stays completely private while you stream securely from anywhere.

Architecture

[Remote Device]
↓ (Twingate Client)
[Twingate Cloud]
[Twingate Connector on Gaming PC]
[Sunshine Service]

How it works: The Twingate Connector on your gaming PC creates a secure outbound connection to Twingate Cloud. When you stream remotely, your client connects through this encrypted tunnel—no inbound ports, no port forwarding, no exposed services.


Step 1: Install Sunshine (5 minutes)

Using Windows Package Manager

Open PowerShell as Administrator and run:

winget install LizardByte.Sunshine

Manual Installation

Alternatively, download the installer directly:

  • Sunshine Releases
  • Find the latest release and choose Sunshine-Windows-AMD64-installer.exe from the assets list
  • Double click the installer and follow the prompts

Verify Installation

Initial Configuration

  • Open the Sunshine web UI at http://localhost:47990
  • Create a username and password when prompted
  • Navigate to ConfigurationVideo/Audio
  • Set your Encoder based on your GPU:
    • Nvidia GPU → NVENC
    • AMD GPU → AMF
    • Intel GPU → QuickSync

Step 2: Setup Twingate Connector (10 minutes)

Select or Create a Remote Network

  • Log in to the Twingate Admin Console
  • Navigate to Remote Networks
  • Either select an existing Remote Network or create a new one:
    • Click Add Remote Network
    • Select a location that best describes your deployment
    • Give it a descriptive name (e.g., “Home Network”)
    • Click Add Remote Network

Add or Select a Connector

  • From your Remote Network page, go to the Connectors tab
  • Either:
    • Select an existing unconfigured Connector, or
    • Click Add Connector to create a new one

Deploy Connector on Your Gaming PC

We recommend deploying the Connector using WSL for Windows systems. Why WSL? It runs natively on Windows with minimal resource overhead and doesn’t require Docker Desktop’s additional background services and VM layer.

  • Install WSL (if not already installed):

    wsl --install
  • Install Ubuntu from the Microsoft Store:

  • Deploy the Connector:

    • In your Connector’s configuration page, select Linux deployment method
    • Generate tokens
    • Copy the installation command with your unique tokens
    • Run the command in your WSL Ubuntu terminal
  • Verify the Connector is online:

    • Return to your Remote Network’s Connectors tab
    • Status should show green “Online”
Option B: Docker Deployment
  • Install Docker Desktop for Windows

  • Follow the Docker Connector installation guide (Docker Section)

    • In your Connector’s configuration page, select Docker deployment method
    • Generate tokens
    • Copy the installation command with your unique tokens
    • Run the command
  • Use the tokens provided in the Admin Console


Step 3: Add Sunshine as a Twingate Resource (5 minutes)

Find Your PC’s IP Address

Open Command Prompt or PowerShell and run:

ipconfig

Look for your IPv4 Address under your active network adapter (typically starts with 192.168. or 10.).

Create the Resource

  • In Twingate Admin Console, navigate to ResourcesAdd Resource

  • Configure the resource:

    • Name: Sunshine Gaming PC
    • Address: Your PC’s private IP (e.g., 192.168.1.100)
    • Protocols:
      • TCP ports: 47984-47990 (Web UI + HTTPS)
      • UDP ports: 47998-48000 (Streaming)
    • Click Add Resource

Assign Access to the Resource

  • Navigate to the Resources tab in the Admin Console
  • Find and click on your Sunshine Gaming PC resource
  • Go to the Access section
  • Click Add Access and select the group that you want to give access
  • Save the changes

Step 4: Install Twingate Client (3 minutes)

Install the Twingate Client on your remote device (the device you’ll stream games to):

Downloads

  • Windows/Mac: twingate.com/download
  • iOS: App Store → Search “Twingate”
  • Android: Play Store → Search “Twingate”

Sign In and Connect

  • Open the Twingate Client application
  • Sign in with your Twingate account
  • Click Connect to establish the secure connection
  • Verify your “Sunshine Gaming PC” resource appears in the resources list

Step 5: Install Moonlight Client (3 minutes)

Moonlight is the streaming client that connects to Sunshine. Install it on your remote device:

Downloads (All Platforms)

  • Windows/Mac/Linux: Moonlight Releases
    • Find the latest release and download the appropriate installer for your OS
  • iOS: App Store → “Moonlight Game Streaming”
  • Android: Play Store → “Moonlight Game Streaming”

After installation, launch Moonlight on your remote device.


Step 6: Pair and Start Gaming (5 minutes)

Connect to Your Gaming PC

  • Ensure Twingate Client is connected on your remote device
  • In Moonlight, click the ”+” button or “Add PC”
  • Enter your gaming PC’s private IP address (e.g., 192.168.1.100)
  • Moonlight will automatically discover your Sunshine server

Complete Pairing

  • Moonlight will display a 4-digit PIN code
  • On your gaming PC, open the Sunshine web UI: http://localhost:47990
  • Navigate to the PIN section in the menu
  • Enter the PIN from Moonlight
  • Click Pair

Launch and Stream

  • In Moonlight, you’ll see available apps including “Desktop”
  • Click “Desktop” to stream your full desktop
  • Or click any game you’ve added to stream that specific game
  • Start gaming remotely! 🎮

Adding Games to Sunshine

To add specific games to your Sunshine library:

  • Open Sunshine web UI: http://localhost:47990
  • Navigate to Applications
  • Click Add Application
  • Configure:
    • Application Name: (e.g., “Elden Ring”)
    • Command: Full path to game executable
    • Working Directory: Game folder path
  • Save the application

The game will now appear in your Moonlight client alongside Desktop.


Troubleshooting

Can’t Connect to Gaming PC in Moonlight

  • Verify Twingate Client shows “Connected” status
  • Confirm the Resource shows as available in Twingate Client
  • Try using 127.0.0.1 instead of your private IP address
  • Check that Sunshine service is running on your gaming PC

Pairing Fails

  • Ensure you’re entering the PIN in Sunshine web UI while connected via Twingate
  • Verify Sunshine service is running:
    sc query SunshineService
  • Try restarting the Sunshine service from the system tray icon

Poor Streaming Performance

  • Lower the bitrate in Moonlight settings (start with 15-20 Mbps for 1080p)
  • Ensure your gaming PC uses a wired ethernet connection
  • Check your remote location’s internet speed (upload/download)
  • Close bandwidth-intensive applications on both devices
  • Consider lowering resolution or frame rate in Moonlight settings

Black Screen or No Display

  • Make sure a monitor is connected to your gaming PC, or
  • Set up a virtual display driver for headless streaming
  • Verify the correct display is being captured in Sunshine settings

Games Won’t Launch

  • Check the game executable path in Sunshine Applications settings
  • Verify the working directory is set to the game folder
  • Some games require administrator privileges — run Sunshine as administrator
  • Check game-specific compatibility at the Sunshine wiki

Next Steps

Optimize Your Setup

  • Configure display resolution and refresh rate in Sunshine settings
  • Adjust encoder settings for quality vs. performance
  • Set up virtual displays for headless streaming with IddSampleDriver

Enable HDR Streaming

  • Configure HDR in Sunshine settings (requires compatible displays)
  • Adjust color space settings for your specific hardware

Add More Gaming PCs

  • Install Sunshine on additional PCs
  • Deploy more Twingate Connectors
  • Create separate Twingate Resources for each PC

Explore Advanced Features

  • Mouse/keyboard capture modes
  • Audio configuration and device selection
  • Custom resolution and frame rate settings
  • Multi-monitor streaming configurations


For comprehensive Sunshine documentation and advanced configuration, visit the official Sunshine documentation.

Last updated 16 days ago