English | 简体中文
Bash script for automated deployment of Syncthing Relay Server v2.0.13, supporting multiple Linux distributions.
- ✅ Auto-detect system architecture (amd64, arm64, arm, 386)
- ✅ Support multiple Linux distributions (Ubuntu, Debian, CentOS, Fedora, Rocky Linux, AlmaLinux, Arch, Manjaro, openSUSE, Alpine)
- ✅ Support systemd and OpenRC service management
- ✅ One-click install and uninstall
- ✅ Optional relay token configuration (auto-generate 32-char token if empty)
- ✅ Auto-create systemd/OpenRC service
- ✅ Auto-start on boot
- ✅ Log management
- Linux operating system
- Root privileges (use sudo)
- systemd or OpenRC service manager
- Network connection (for downloading files)
- Download the script:
wget https://raw.githubusercontent.com/your-repo/syncthing-relaysrv-ctl/main/relaysrv-ctl.sh
chmod +x relaysrv-ctl.sh- Run the install command:
sudo ./relaysrv-ctl.sh install- Enter relay token when prompted (optional, leave empty to auto-generate a 32-char random token)
sudo ./relaysrv-ctl.sh uninstallDuring uninstallation, you'll be asked whether to delete configuration files and logs. The script itself will not be deleted.
./relaysrv-ctl.sh help| File/Directory | Path |
|---|---|
| Binary file | /usr/local/bin/strelaysrv |
| Symlink | /usr/local/bin/relaysrv |
| systemd service | /etc/systemd/system/syncthing-relaysrv.service |
| Config dir | /etc/syncthing-relaysrv/ |
| Config file | /etc/syncthing-relaysrv/config |
| Log dir | /var/log/syncthing-relaysrv/ |
# Check service status
sudo systemctl status syncthing-relaysrv
# View real-time logs
sudo journalctl -u syncthing-relaysrv -f
# Restart service
sudo systemctl restart syncthing-relaysrv
# Stop service
sudo systemctl stop syncthing-relaysrv
# Start service
sudo systemctl start syncthing-relaysrv
# Disable auto-start on boot
sudo systemctl disable syncthing-relaysrv
# Enable auto-start on boot
sudo systemctl enable syncthing-relaysrv# Check service status
sudo rc-service syncthing-relaysrv status
# Restart service
sudo rc-service syncthing-relaysrv restart
# Stop service
sudo rc-service syncthing-relaysrv stop
# Start service
sudo rc-service syncthing-relaysrv startEdit the configuration file:
sudo nano /etc/syncthing-relaysrv/configModify the TOKEN value, then restart the service:
sudo systemctl restart syncthing-relaysrv# View real-time logs (systemd)
sudo journalctl -u syncthing-relaysrv -f
# View log files
sudo tail -f /var/log/syncthing-relaysrv/relaysrv.log
sudo tail -f /var/log/syncthing-relaysrv/relaysrv-error.log- x86_64 (amd64)
- aarch64/arm64
- armv7l (arm)
- i386/i686 (386)
- Ubuntu / Debian
- CentOS / RHEL / Rocky Linux / AlmaLinux
- Fedora
- Arch Linux / Manjaro
- openSUSE
- Alpine Linux
The service is configured with the following security restrictions:
NoNewPrivileges=true- Prevent privilege escalationPrivateTmp=true- Private temporary directoryProtectSystem=strict- Read-only system directoriesProtectHome=true- Protect home directories- Configuration file permissions set to 600
- Check service status:
sudo systemctl status syncthing-relaysrv- View detailed logs:
sudo journalctl -u syncthing-relaysrv -n 100 --no-pagerBy default, the relay server uses port 22067. If the port is already in use:
sudo lsof -i :22067If the download fails, it may be due to network issues or restricted GitHub releases access. You can try:
- Check network connection
- Use a proxy
- Manually download the file and place it in
/usr/local/bin/strelaysrv
MIT License