在NAS上创建frp镜像及容器

网络, 建站  ·  2026-02-24

使用 DaoCloud 镜像(最推荐)

bash


# 直接拉取 DaoCloud 加速镜像
docker pull m.daocloud.io/docker.io/snowdreamtech/frpc:0.67.0

# 拉取成功后,重新打标签为原镜像名(方便使用原命令)
docker tag m.daocloud.io/docker.io/snowdreamtech/frpc:0.67.0 snowdreamtech/frpc:0.67.0

# 然后运行容器(使用原镜像名)
docker run -d \
  --name frpc \
  --restart=always \
  --network host \
  -v /home/anytimes/frp/frpc.toml:/etc/frp/frpc.toml \
  m.daocloud.io/docker.io/snowdreamtech/frpc:0.67.0



服务器端开机运行frps方法
创建/etc/systemd/system/frps.service

[Unit]
Description=FRP Server Service
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/usr/frp
ExecStart=/usr/frp/frps -c /usr/frp/frps.toml
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target

重启服务
# 3. 重新加载并启动
sudo systemctl daemon-reload
sudo systemctl enable frps
sudo systemctl start frps
sudo systemctl status frps
# 查看所有 frps 相关服务
sudo systemctl list-unit-files | grep frps

# 查看当前生效的 frps 服务路径
sudo systemctl status frps | head -5

# 查看 frps 进程
ps aux | grep frps

 
评论
大百科. All Rights Reserved. Theme Jasmine by Kent Liao.