Adding Applications
Applications are configured through the Sunshine Web UI or by editing theapps.json file.
Via Web UI (Recommended)
- Open Sunshine Web UI at
https://localhost:47990 - Navigate to Applications or Configuration > Applications
- Click Add New or similar button
- Fill in the application details
- Save the application
Via apps.json File
Theapps.json file is located in your Sunshine configuration directory. It contains a JSON array of application objects.
Application Fields
The display name shown in Moonlight.
The command or executable to launch.
Log file path for application output (useful for debugging).
Working directory for the application. Defaults to the executable’s directory if not specified.
Commands to run detached (don’t wait for completion). Useful for launchers that spawn child processes.
Path or URL to cover image displayed in Moonlight.
Run with elevated privileges (Windows only, requires Sunshine service).
Skip global prep commands for this application.
Commands to run before/after launching the application.Each entry can have:
do- Command to run before launchundo- Command to run after exitelevated- Run with elevated privileges (Windows)
Common Application Examples
Desktop
Steam Big Picture
- Windows
- Linux/FreeBSD
- macOS
Steam Game (URI Method)
- Windows
- Linux/FreeBSD
- macOS
Steam Game (Direct Executable)
- Windows
- Linux
Epic Games Store Game
Preparation Commands
Preparation commands allow you to change system settings before launching an application and restore them afterward.Change Resolution and Refresh Rate
- Windows (Built-in)
- Windows (QRes)
- Linux (X11)
- Linux (Wayland)
- macOS
Sunshine has built-in Windows display configuration. See the Audio/Video Configuration page for Windows-specific settings like
dd_resolution_option and dd_refresh_rate_option.Environment Variables
Sunshine provides environment variables you can use in commands:Resolution width requested by the client
Resolution height requested by the client
Frame rate requested by the client
Whether client requested HDR (“true” or “false”)
The unique identifier of the currently running application
The name of the currently running application
Cover Images
Cover images are displayed in the Moonlight app selection screen.Image Format
- Supported formats: PNG, JPG, JPEG
- Recommended size: 1280x720 or 1920x1080
- Aspect ratio: 16:9
Image Location
Relative Paths: Place images in the Sunshine configuration directory:Platform-Specific Considerations
Windows
Elevated Privileges
Elevated Privileges
If Sunshine is installed as a service (default), you can run applications with administrator privileges:This launches without UAC prompt when using Sunshine service.
Path Escaping
Path Escaping
Use double backslashes in JSON:
Linux (Flatpak)
macOS
Use
open command for applications and URLs:Complete Example
Here’s a complete application configuration with resolution changes:Troubleshooting
Application won't launch
Application won't launch
- Check
outputlog for errors - Verify executable path and working directory
- Test command manually in terminal
- Check if elevated privileges are needed
Wrong resolution
Wrong resolution
- Verify prep-cmd syntax
- Check environment variables are available
- Enable “Optimize game settings” in Moonlight
- Test prep-cmd manually
Steam games don't launch
Steam games don't launch
- Use URI method:
steam://rungameid/<appid> - Add to detached commands
- Ensure Steam is running
- Check game AppID is correct
Cover image not showing
Cover image not showing
- Check image path is correct
- Verify image format (PNG/JPG)
- Use absolute path or URL
- Restart Moonlight client
Prep commands fail
Prep commands fail
- Check command syntax
- Test commands manually
- Verify tools are installed
- Check elevated permissions if needed
Best Practices
Use URI Methods
For Steam/Epic games, use launcher URIs instead of direct executables for better compatibility
Test Commands
Always test prep commands manually before adding to configuration
Add Logging
Use the
output field to capture logs for troubleshootingEnvironment Variables
Use
SUNSHINE_CLIENT_* variables for dynamic resolution changesNext Steps
General Settings
Configure global prep commands
Audio/Video
Optimize streaming quality for your applications

