|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +Headless game streaming server for Moonlight clients |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +**Install** from the Arch User Repository |
| 8 | + |
| 9 | +```yay -S moonshine``` |
| 10 | + |
| 11 | +**Enable** the user service (start now and on boot) |
| 12 | + |
| 13 | +```sudo systemctl enable --now moonshine@$USER``` |
| 14 | + |
| 15 | +**Allow** the service to run when you are not logged in |
| 16 | + |
| 17 | +```sudo loginctl enable-linger $USER``` |
| 18 | + |
| 19 | +**Run** the server directly with a config file (builds from source) |
| 20 | + |
| 21 | +```moonshine [/path/to/config.toml]``` |
| 22 | + |
| 23 | +**Pair** a Moonlight client by submitting its PIN |
| 24 | + |
| 25 | +```curl -X POST "http://localhost:47989/submit-pin" -d "uniqueid=0123456789ABCDEF&pin=[PIN]"``` |
| 26 | + |
| 27 | +# SYNOPSIS |
| 28 | + |
| 29 | +**moonshine** _config.toml_ |
| 30 | + |
| 31 | +# DESCRIPTION |
| 32 | + |
| 33 | +**moonshine** is a Linux-only headless streaming host compatible with [Moonlight](https://moonlight-stream.org/) clients. It streams games (or any application) from your PC to phones, tablets, and other devices, and sends keyboard, mouse, and controller input back to the host. |
| 34 | + |
| 35 | +Unlike desktop-sharing hosts, each stream runs in its own isolated Wayland compositor session, separate from your local desktop. The host remains usable while streaming, and no physical monitor or HDMI dummy plug is required. |
| 36 | + |
| 37 | +Video is hardware-encoded (H.264, H.265, and experimental AV1) via Vulkan on NVIDIA RTX, AMD RDNA2+, or Intel Arc GPUs. Audio uses low-latency Opus (stereo or 5.1/7.1). HDR (10-bit) is supported when the game and client allow it. Clients need Moonlight v6.0.0 or newer. systemd is required to launch and manage application processes. |
| 38 | + |
| 39 | +# PARAMETERS |
| 40 | + |
| 41 | +_config.toml_ |
| 42 | + |
| 43 | +> Path to the TOML configuration file. Created automatically with defaults if it does not exist. The AUR package defaults to **$XDG_CONFIG_HOME/moonshine/config.toml**. |
| 44 | +
|
| 45 | +**-V**, **--version** |
| 46 | + |
| 47 | +> Print version and exit. |
| 48 | +
|
| 49 | +# CONFIGURATION |
| 50 | + |
| 51 | +**$XDG_CONFIG_HOME/moonshine/config.toml** (typically **~/.config/moonshine/config.toml**) |
| 52 | + |
| 53 | +> Main configuration. Define applications and optional scanners. |
| 54 | +
|
| 55 | +Example application entry: |
| 56 | + |
| 57 | +``` |
| 58 | +[[application]] |
| 59 | +title = "Steam" |
| 60 | +boxart = "/path/to/steam.png" |
| 61 | +command = ["/usr/bin/steam", "steam://open/bigpicture"] |
| 62 | +pre_command = [ |
| 63 | + ["/usr/bin/systemctl", "stop", "conflicting.service"], |
| 64 | +] |
| 65 | +post_command = [ |
| 66 | + ["/usr/bin/nvidia-smi", "pstate", "performance"], |
| 67 | +] |
| 68 | +``` |
| 69 | + |
| 70 | +Steam library scanner (auto-discovers installed games): |
| 71 | + |
| 72 | +``` |
| 73 | +[[application_scanner]] |
| 74 | +type = "steam" |
| 75 | +library = "$HOME/.local/share/Steam" |
| 76 | +command = ["/usr/bin/steam", "-bigpicture", "steam://rungameid/{game_id}"] |
| 77 | +``` |
| 78 | + |
| 79 | +Desktop scanner (from .desktop files): |
| 80 | + |
| 81 | +``` |
| 82 | +[[application_scanner]] |
| 83 | +type = "desktop" |
| 84 | +directories = [ |
| 85 | + "$HOME/.local/share/applications", |
| 86 | + "/usr/share/applications", |
| 87 | +] |
| 88 | +include_terminal = false |
| 89 | +resolve_icons = true |
| 90 | +``` |
| 91 | + |
| 92 | +**MOONSHINE_LOG** |
| 93 | + |
| 94 | +> Environment filter for tracing (default level: **error**). Passed to the Rust tracing EnvFilter. |
| 95 | +
|
| 96 | +First-time pairing: connect with Moonlight, then open **http://localhost:47989/pin** on the host (or use the curl example above) to submit the PIN. |
| 97 | + |
| 98 | +# CAVEATS |
| 99 | + |
| 100 | +Linux and systemd only. Requires a GPU with Vulkan video encoding. AV1 encoding is experimental and can grow frame sizes over time on some NVIDIA drivers; prefer H.264 or H.265 until fixed. Not safe on public networks: the GameStream protocol is not fully encrypted at the application layer — use a VPN (**tailscale**, **wg**/WireGuard) for remote access and never expose ports to the internet. |
| 101 | + |
| 102 | +# HISTORY |
| 103 | + |
| 104 | +**Moonshine** is a Rust reimplementation of a Moonlight-compatible host focused on isolated headless sessions on Linux. It builds on ideas from Sunshine (GameStream host API), Inputtino (input devices), and magic-mirror (Vulkan/Wayland compositor streaming). |
| 105 | + |
| 106 | +# SEE ALSO |
| 107 | + |
| 108 | +[systemctl](/man/systemctl)(1), [loginctl](/man/loginctl)(1), [steam](/man/steam)(1), [tailscale](/man/tailscale)(1), [wg](/man/wg)(8), [yay](/man/yay)(8) |
| 109 | + |
| 110 | +# RESOURCES |
| 111 | + |
| 112 | +```[Source code](https://github.com/hgaiser/moonshine)``` |
| 113 | + |
| 114 | +```[Homepage](https://github.com/hgaiser/moonshine)``` |
| 115 | + |
| 116 | +```[Documentation](https://github.com/hgaiser/moonshine#readme)``` |
| 117 | + |
| 118 | +<!-- verified: 2026-07-20 --> |
0 commit comments