Skip to main content
Network configuration controls how Sunshine communicates with Moonlight clients, including port settings, encryption, and access restrictions.

Port Configuration

number
default:"47989"
Base port for the Sunshine service. Other ports are automatically offset from this value.Port Range: 1029-65514Default Ports:
  • 47989 - Base port
  • 47990 - HTTPS Web UI
  • 48010 - Video/Audio streaming
Changing the port will offset all other Sunshine ports accordingly.

Network Interface Binding

string
default:"ipv4"
Set the address family that Sunshine will use.Options:
  • ipv4 - IPv4 only
  • both - IPv4 and IPv6
string
default:"All interfaces"
Bind Sunshine to a specific IP address. Leave empty to bind to all interfaces.Useful for systems with multiple network interfaces when you want to restrict Sunshine to one.
The address must be valid for the system and match the configured address family.

UPnP and External Access

boolean
default:"disabled"
Automatically open ports for streaming over the internet using UPnP.
Only enable if you need remote streaming over the internet and your router supports UPnP.
string
default:"Auto-detect"
Manually specify external IP address. Leave empty for automatic detection.

Web UI Access Control

string
default:"lan"
Control which devices can access the HTTPS Web UI.Options:
  • pc - Only localhost can access
  • lan - Only LAN devices can access
  • wan - Anyone can access (not recommended)
Setting to wan exposes your Web UI to the internet. Ensure you have a strong password.

Encryption Settings

number
default:"0"
Encryption mode for streaming over local network.Options:
  • 0 - No encryption (best performance)
  • 1 - Encryption if client supports it
  • 2 - Encryption mandatory (reject unencrypted)
Encryption can reduce streaming performance, especially on less powerful hardware.
number
default:"1"
Encryption mode for streaming over the internet.Options:
  • 0 - No encryption (not recommended)
  • 1 - Encryption if client supports it (recommended)
  • 2 - Encryption mandatory
It’s recommended to use encryption for internet streaming to protect your data.

Connection Timeouts

number
default:"10000"
How long to wait (in milliseconds) for data from Moonlight before shutting down the stream.

Example Configurations

Local Network Only (Default)

Internet Streaming with UPnP

IPv6 Dual Stack

Restricted to Specific Interface

Maximum Security

Firewall Configuration

If you’re having connection issues, ensure these ports are open in your firewall:
  • TCP 47984-47990 - HTTP/HTTPS and control
  • UDP 47998-48000 - Video stream
  • UDP 48010 - Audio stream
  • UDP 48100-48110 - Control and input

Router Port Forwarding

For internet streaming without UPnP, manually forward these ports in your router:
  1. Log into your router’s admin interface
  2. Find the Port Forwarding section
  3. Forward these ranges to your host PC’s local IP:
    • TCP: 47984-47990
    • UDP: 47998-48010
    • UDP: 48100-48110
Assign a static IP or DHCP reservation to your host PC to prevent port forwarding from breaking.

Troubleshooting

  • Check firewall allows Sunshine ports
  • Verify origin_web_ui_allowed is not set to pc
  • Ensure client and host are on same network
  • Try disabling encryption temporarily: lan_encryption_mode = 0
  • Enable UPnP: upnp = enabled
  • OR manually forward ports in router
  • Check external IP is correct: external_ip
  • Verify ISP doesn’t block ports
  • Enable encryption: wan_encryption_mode = 1 or 2
  • Increase ping timeout: ping_timeout = 15000
  • Check network stability
  • Reduce bitrate in audio/video settings
  • Enable FEC (forward error correction)
  • Check origin_web_ui_allowed setting
  • Verify port 47990 (or base port + 1) is not blocked
  • Try accessing via https://localhost:47990
  • Check SSL certificate is valid
  • Verify router supports UPnP and it’s enabled
  • Check router logs for UPnP requests
  • Manually forward ports as fallback
  • Some ISPs block UPnP

Network Performance Tips

Local Network

  • Use wired Ethernet for best performance
  • Disable encryption for lower latency
  • Use 5GHz WiFi if wireless is required
  • Ensure router supports QoS

Internet Streaming

  • Enable UPnP for easier setup
  • Use encryption to protect data
  • Reduce bitrate for slower connections
  • Consider VPN as alternative to port forwarding

Next Steps

Applications

Configure games and apps to stream

Audio/Video Settings

Optimize streaming quality