LizardByte/Sunshine: The Open-Source Game Streaming Host


LizardByte/Sunshine: The Open-Source Game Streaming Host

LizardByte/Sunshine

2025-09-23

Sunshine is a self-hosted game stream host designed to work with clients like Moonlight. Think of it as a server-side application that captures your desktop, including games, and streams it over your network to a client device. While Moonlight works with NVIDIA's GameStream, that service has been deprecated. Sunshine steps in to fill that gap, offering a powerful, open-source alternative.

From a software engineering standpoint, Sunshine is great because

It's open-source
This means you can inspect the code, modify it, and contribute to the project. It's a fantastic example of a community-driven project that solves a real problem.

Cross-platform compatibility
It's built with multiple technologies (Python, C++, Docker) which allows it to run on Windows, Linux, and macOS. This flexibility is a huge plus.

Low-latency streaming
The core of the project is C++ for performance-critical parts, ensuring low latency and high frame rates for a smooth gaming experience. Python is used for the web UI and other management tasks, which makes it easy to use and configure.

There are a few ways to install Sunshine, but from a software engineer's perspective, the Docker method is often the most convenient and reproducible. It's a great way to avoid dependency conflicts on your host system.

This is the most straightforward way to run Sunshine and is especially useful for server environments. You'll need Docker installed on your machine.

Pull the image

docker pull lzdb/sunshine:latest

Run the container
This command will start the Sunshine container. Make sure to adjust the paths (/path/to/config) and permissions as needed.

docker run -it --network=host \
  -v /path/to/config:/config \
  --device /dev/dri:/dev/dri \
  --name sunshine \
  lzdb/sunshine:latest

--network=host
This allows the container to use the host's network, which is necessary for streaming.

-v /path/to/config:/config
This mounts a local directory to the container's config directory, so your settings and key bindings persist.

--device /dev/dri:/dev/dri
This is crucial for hardware acceleration, giving the container direct access to your GPU for encoding. This part might vary depending on your GPU and OS.

You can also build and run Sunshine natively. This is a bit more involved but gives you full control. You'll need to install dependencies like Python and a C++ compiler.

Clone the repository

git clone https://github.com/LizardByte/Sunshine.git
cd Sunshine

Install dependencies
This step varies by OS. For Ubuntu, for example, you might use

sudo apt update
sudo apt install python3 python3-pip cmake g++ libsdl2-dev

Build and run
Follow the instructions in the project's README.md to build the application. This usually involves using cmake and make.

Once Sunshine is up and running, it's mostly configured through its web UI. Let's imagine a common task
adding a new game to stream. From an automation or scripting perspective, you could interact with its configuration files directly.

The apps.json file is where Sunshine stores its application list. Here’s a simplified example of what it looks like

[
  {
    "id": 1,
    "name": "Steam",
    "image": "steam.png",
    "executable": "C:\\Program Files (x86)\\Steam\\Steam.exe",
    "arguments": "-tenfoot",
    "status": "active"
  },
  {
    "id": 2,
    "name": "Elden Ring",
    "image": "elden_ring.png",
    "executable": "C:\\Games\\EldenRing\\eldenring.exe",
    "arguments": "",
    "status": "active"
  }
]

As a software engineer, you could write a Python script to manage this file programmatically. This is useful for building a launcher, integrating with other tools, or even a simple script to add new games.

import json

def add_new_game(name, executable_path, args=""):
    """
    Adds a new game entry to the Sunshine configuration file.
    """
    config_file_path = "/path/to/your/sunshine/config/apps.json"

    new_app = {
        "id": 3, # You would generate a unique ID
        "name": name,
        "image": f"{name.lower().replace(' ', '_')}.png",
        "executable": executable_path,
        "arguments": args,
        "status": "active"
    }

    try:
        with open(config_file_path, "r+") as f:
            data = json.load(f)
            data.append(new_app)
            f.seek(0)
            json.dump(data, f, indent=4)
            print(f"Successfully added '{name}' to Sunshine configuration.")

    except FileNotFoundError:
        print(f"Error: The file {config_file_path} was not found.")
    except json.JSONDecodeError:
        print("Error: Invalid JSON format in the configuration file.")

# Example usage:
add_new_game("Cyberpunk 2077", "C:\\Games\\Cyberpunk2077\\bin\\x64\\Cyberpunk2077.exe")

This kind of script demonstrates how you can interact with the system at a deeper level than just the UI, which is a common task in software engineering.

Networking and Streaming
You'll learn about streaming protocols, codecs (like H.264 and HEVC), and network communication.

Multi-language Project
It's a great example of a project that leverages the strengths of multiple languages
C++ for performance, and Python for ease of use and rapid development.

Open-Source Collaboration
Contributing to or just studying a project like this gives you valuable experience with real-world, collaborative software development.


LizardByte/Sunshine




Simplifying LLM Tooling with IBM's mcp-context-forge

Think of mcp-context-forge as a central hub for your Large Language Model (LLM) applications. In a typical setup, your LLM might need to access various tools


Architecting Autonomous Chatbots: A Deep Dive into AstrBot, Docker, and Python Plugins

Think of it as the "Swiss Army Knife" for building AI agents that actually live where people talk—whether that's Discord


Hummingbot for Engineers: Automating Crypto Trading with Code

Alright, fellow engineers, let's talk about Hummingbot!Imagine you want to participate in the fast-paced world of cryptocurrency trading


Scaling with Plane: Deploying an Open-Source Linear Alternative with Docker

You've pointed out a very exciting project. Plane is a powerful, open-source project management tool designed to be a streamlined alternative to Jira or Linear


Technical Breakdown: How TrendRadar's NLP Features Streamline Software Engineering Tasks

Here is a friendly, detailed breakdown, focusing on the technical value and implementation steps.The sansan0/TrendRadar project is essentially a sophisticated AI-driven news aggregation and monitoring system


Winapps: Seamlessly Integrate Windows Apps into Your Linux Workflow

Imagine you're a Linux user, maybe you're developing on a powerful Ubuntu machine because of its excellent command-line tools and development environment


From Code to Components: Integrating with InvenTree as a Developer

Let's dive into InvenTree from a software engineer's perspective. It's a fantastic open-source inventory management system


From Zero to Code: Integrating Local LLMs with ollama-python

This library is essentially a friendly Python interface for the Ollama system, which allows you to run large language models (LLMs) locally on your machine


Windows in a Box: Simplified Testing with Docker

Cross-Platform Testing If you're building an application that needs to work on multiple operating systems, you can use this Docker image to quickly and easily test how your software behaves on Windows without needing a dedicated virtual machine or physical machine


Scaling Faceless Channels: How Engineers Can Use MoneyPrinterV2 for Rapid Prototyping

Here is a breakdown of what it is, why it's interesting to us devs, and how you can get it running.At its core, MoneyPrinterV2 is a Python-based automation tool designed to generate "faceless" short-form videos (like TikToks