Connect to remote Surge servers using host and token flags or environment variables for distributed download management
Surge supports connecting to remote servers, allowing you to manage downloads on a different machine from your terminal. This is perfect for controlling a home server, NAS, or cloud instance.
Connect to a Surge server running on your local network:
# Get the token from the remote server firstssh[email protected] "surge token"# Connect from your laptopsurge connect 192.168.1.10:1700 --token <token>
Connect to a Surge server on a cloud provider:
# Uses HTTPS automatically for public hostnamesurge connect surge.example.com:1700 --token <token>
Connect to a Surge Docker container:
# Get token from containerdocker compose exec surge surge token# Connect to containersurge connect localhost:1700 --token <token>
Secure Tokens: Treat tokens like passwords - never commit them to version control
Firewall Rules: Restrict access to port 1700 to trusted IPs only
VPN Access: For remote servers, consider using a VPN instead of exposing the port publicly
Rotate Tokens: Periodically restart the server with a new token
Never expose your Surge server to the public internet without proper authentication and HTTPS. Use a reverse proxy like nginx or Caddy for production deployments.