在 Raspberry Pi 上安装
2 分钟内在 Raspberry Pi 上安装 wantasticd:一条命令,扫描二维码,点击 Claim Device。包含 Pi Zero / Pi 1 的注意事项。
你的 Pi 将 wantasticd 作为服务运行,在控制台中显示为 Online,可从任何地方访问。
开始之前
- Raspberry Pi 2、3、4、5、400、Zero 2 W 或 CM3/CM4/CM5。(Pi Zero、Zero W 和 Pi 1 需要使用下方的 WireGuard 方式。)
- Raspberry Pi OS、Ubuntu、DietPi 或其他使用 systemd 的系统。
- SSH 或具有 sudo 权限的终端。
- 一部手机或一个浏览器,用于登录 Wantastic 控制台。
快速安装(2 分钟)
一条命令即可安装 wantasticd 并显示二维码。用手机认领 Pi 即可,无需令牌。
- 1复制下方命令,粘贴到设备的终端中。如果 sudo 要求输入密码,请输入。
- 2设备会打印 Claim URL 和二维码。用手机扫描二维码,或在浏览器中打开 Claim URL。
- 3登录 Wantastic 控制台。Claim Wantastic Device 窗口会打开,密钥已自动填好。点击 Claim Device。
- 4终端打印 "Device claimed"。按 Ctrl+C,然后运行下方的重启命令。
- 5在控制台中打开 Devices。设备显示为 Online。
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkeysudo systemctl restart wantasticd$ pi@raspberrypi:~ $ curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey…Skipping login. Run 'wantasticd login' to authenticate.…Generated device claim key: /etc/wantastic/device-claim-key.jsonPublic key: Vd3hK1oQ7mR2sT9uW4xY6zA8bC0dE2fG4hJ6kL8mN0P=Server URL: https://console.wantastic.appClaim URL: https://console.wantastic.app/#desktop?claim_public_key=Vd3hK1oQ…%3D&wantastic_server=https%3A%2F%2Fconsole.wantastic.app1█▀▀▀▀▀█ ▄▀▄ ▀█▄ █▀▀▀▀▀██ ███ █ ▀█▄▀▄█ █ ███ ██ ▀▀▀ █ ▄▀█ ▀▄ █ ▀▀▀ █▀▀▀▀▀▀▀ ▀ ▀ █ ▀ ▀▀▀▀▀▀▀▀█▄▀▄▀▀█▀▄█▀▄▀▀▄█▀▄▀█▄█▀▀▀▀▀█ █▄▀▄▀█ ▀▄█ ▄▀▀▀▀▀▀▀▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀2026/10/29 09:14:03 Waiting for claim. Press Ctrl+C to stop.2026/10/29 09:15:12 Device claimed. Configuration saved to /etc/wantastic/config.conf2^C$ pi@raspberrypi:~ $ sudo systemctl restart wantasticd3
- 1打开此链接,或扫描二维码
- 2已认领:现在按 Ctrl+C
- 3重启一次服务
- 1Claim public key 已自动填写
- 2Wantastic server 保持默认即可
- 3点击 Claim Device
警告: Pi Zero、Pi Zero W 和 Pi 1 使用较旧的 CPU(ARMv6),无法运行 wantasticd。用 uname -m 检查:如果输出 armv6l,则必须使用“其他安装方式”中的纯 WireGuard 方式。
提示: 手边没有手机?从终端复制 Claim URL,在任意电脑上打开即可。
注意: 在显示二维码之前,安装程序可能会打印 "Skipping login" 或服务错误。这在新设备上是正常的。认领并重启后服务即可正常工作。
检查是否正常工作
- 1运行 wantasticd status。它会显示 Status: Connected 和一个 VPN IP。
- 2在控制台中打开 Devices。设备显示为 Online。
wantasticd status$ pi@raspberrypi:~ $ wantasticd statusStatus: Connected1Version: v1.0.54+377f3c0Mode: TUN (wantastic0)VPN IPs: 10.200.0.14/322Public key: q7ZkV3m1yH0dTn8pXo2bLwR4sE6uJ9cA1fG5hK8iN0M=Server: wg.wantastic.app:51820Exit node: falseLocal access: falseAuto update: trueTraffic: ↓ 18.4 KiB ↑ 9.2 KiBPeers: 2 (direct 1, relay 1)Uptime: 4m12s
- 1隧道已建立
- 2你的覆盖网络地址
- 1按名称搜索
- 2状态显示 Online
- 3覆盖网络 IP 与 wantasticd status 一致
- 4Last seen 持续更新
管理服务
sudo systemctl status wantasticd # is it running?
sudo systemctl restart wantasticd # restart
sudo systemctl stop wantasticd # stop the tunnel
sudo journalctl -u wantasticd -f # live logs提示: Pi 没有时钟电池。如果它在无网络的情况下启动,网络和时间恢复后会立即连接。
其他安装方式
仅在自动化或特殊情况下才需要这些方式。上面的快速安装是最简单的方法。
当你用脚本安装大量设备,或无人能扫描二维码时,请使用令牌。在控制台中创建一次令牌即可:Account → Secrets → + New Secret → Generate。用它替换 <TOKEN>。
curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --token <TOKEN>像对待密码一样对待令牌。在其过期之前,任何持有它的人都能向你的账户添加设备。
- 1打开 Secrets 选项卡
- 2点击 + New Secret
- 3为其命名
- 4点击 Generate
- 5复制新密钥
验证结果
常见问题
安装程序在 Pi Zero、Zero W 或 Pi 1 上停止。Error: downloaded binary does not report target version v1.0.54+377f3c0install.sh
该 Pi 使用 ARMv6 CPU。wantasticd 需要 ARMv7 或更新的架构。
使用“其他安装方式”中的纯 WireGuard 方式,或使用 Pi Zero 2 W 或更新的型号。
一键命令立即因权限错误而失败。Error: /usr/local/bin is not writable, but / is already read-write. Run this installer as root.install.sh
缺少 sudo。安装程序需要 root 权限。
使用下方的确切命令。sudo 要放在 sh 前面,而不是 curl 前面。
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey服务无法启动,或反复重启。Failed to load configuration: validate config: private key requiredjournalctl -u wantasticd
wantasticd 已安装,但设备尚未认领,因此其配置文件为空。
认领设备,然后重启服务。
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd控制台显示设备已认领,但服务仍然无法连接。wantasticd genkey
genkey 运行时未使用 sudo。它把配置保存在了你的主目录(~/.config/wantastic)中,而服务不会读取该目录。
使用 sudo 重新运行 genkey 并认领新密钥。然后在 Devices 中删除旧的、未使用的设备条目。
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd你已点击 Claim Device,但终端始终没有打印 "Device claimed"。Claim polling not ready: claim config rejected (401): invalid signature or timestamp out of windowwantasticd genkey
设备时钟不准确。只有当时钟与实际时间相差在 30 秒以内时,认领才能成功。
修正时钟。genkey 会继续等待,并自行完成。
sudo timedatectl set-ntp true
date出现了第二个接口(wantastic1),或日志显示端口冲突。Port 51820 in use, using random port服务日志
genkey 仍在终端中运行,而服务也在运行。现在有两个副本在争用。
在运行 genkey 的终端中按 Ctrl+C,然后重启服务。
sudo systemctl restart wantasticdwantasticd status 打印 Offline。Status: Offline — daemon not running (start: sudo systemctl start wantasticd (OpenWrt: /etc/init.d/wantasticd start))wantasticd status
后台服务已停止、已崩溃或仍在启动中。status 命令不会启动服务。
启动服务。
sudo systemctl start wantasticdstatus 显示 Running (tunnel down),或 peers 显示 (server) 为 HANDSHAKE never。Device health check failed: …服务日志
网络阻止了到中心节点(wg.wantastic.app)的出站 UDP 51820 端口,或 DNS 不可用。
在防火墙中放行出站 UDP 51820,然后重启服务。
nslookup wg.wantastic.app
sudo systemctl restart wantasticd你想把设备迁移到另一个账户,或重新进行认领。Config already exists at /etc/wantastic/config.conf — skipping login.install.sh
即使重新运行安装程序,设备也会保留其配置。你必须先移除旧配置。
将旧配置移到别处,然后用新密钥重新认领设备。
sudo mv "/etc/wantastic/config.conf" "/etc/wantastic/config.conf.bak"
sudo wantasticd genkey --force
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd令牌安装在下载后立即失败。Login failed: registration rejected (401): invalid or expired login tokeninstall.sh / wantasticd login
令牌错误、已过期、已用完(达到 Max Uses)或已被删除。
不使用令牌,改为认领设备。
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd认领或登录被拒绝。Login failed: account has reached its device limit — upgrade your plan or remove an existing devicewantasticd login / 控制台
你的套餐设备数量已满。控制台显示 "You have reached the maximum number of devices for your plan."
在 Devices 中删除一台不再使用的设备(设备行 → Delete),或升级套餐。然后重新认领。
继续阅读
仍然无法解决?
请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。