Skip to content

Instantly share code, notes, and snippets.

@Haswf
Forked from imyelo/frpc.service
Created August 22, 2020 16:05
Show Gist options
  • Select an option

  • Save Haswf/bd288ab4e96cd593ce3a3cabc37bb0e1 to your computer and use it in GitHub Desktop.

Select an option

Save Haswf/bd288ab4e96cd593ce3a3cabc37bb0e1 to your computer and use it in GitHub Desktop.
run frp client as a service on windows and ubuntu / debian
# 1. put frpc and frpc.ini under /usr/local/frpc/
# 2. put this file (frpc.service) at /etc/systemd/system
# 3. run `sudo systemctl daemon-reload && sudo systemctl start frpc.service`
# Then we can manage frpc with `sudo service frpc {start|stop|restart|status}`
# See also: https://nosame.net/use-frp-to-reverse-proxy-your-nas/
# Alternative for server:
# - Offical: https://github.com/fatedier/frp/blob/a4cfab6/conf/systemd/frpc%40.service
[Unit]
Description=frp client
Wants=network-online.target
After=network.target network-online.target
[Service]
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini
[Install]
WantedBy=multi-user.target
: 1. download [nssm](https://github.com/kirillkovalenko/nssm) and set its diretory into the global PATH environment value
: 2. replace the path below with where you placed frpc
nssm install frpc "D:\Tools\frpc\frpc.exe" "-c D:\Tools\frpc\frpc.ini"
nssm set frpc DisplayName "frp client"
nssm start frpc
nssm stop frpc
nssm remove frpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment