Skip to main content

Overview

Sunshine can run as a systemd service on Linux, providing automatic startup, process management, and logging integration. Two service types are available:
  • sunshine.service - Unprivileged service for XDG Portal or X11 capture
  • sunshine-kms.service - Privileged service for KMS (Kernel Mode Setting) capture

Prerequisites

  • Linux system with systemd
  • Sunshine installed from package manager
  • User account with appropriate permissions

Service Types

Runs as your user account with access to your display session. Best for:
  • Desktop installations
  • X11 or Wayland capture
  • Standard gaming setups

System Service

Runs as a system service with elevated privileges. Best for:
  • Headless servers
  • KMS capture
  • Multi-user environments

Installation

Service Configuration

Standard Service (sunshine.service)

Example service file for unprivileged capture:
sunshine.service

KMS Service (sunshine-kms.service)

Example service file for KMS capture:
sunshine-kms.service

Custom Service File

To customize the service, create an override:
Add customizations:

Service Management

Enable Service (Start on Boot)

Start Service Immediately

Enable and Start Together

Stop Service

Restart Service

Disable Service

Monitoring

Check Service Status

Example output:

View Service Logs

Log Filtering

Troubleshooting

Service Won’t Start

Display Not Available

Add:
Then reload and restart:

Service Crashes on Start

Increase startup delay:
Add:

Permission Denied Errors

Add user to required groups:

Service Stops After Logout

Enable lingering for your user:
This keeps user services running after logout.

Advanced Configuration

Resource Limits

Control resource usage:

Restart Behavior

Environment Variables

Dependencies

Control service startup order:

Multiple Instances

Run multiple Sunshine instances:

Create Instance Service

Edit for instance support:
sunshine@.service

Start Instances

System-Wide Service

For system-level installation (not recommended for most users):
Manage system service: