---
title: "手动安装 tarball | Wantastic Docs"
description: "在任意 Linux CPU（包括 ppc64、s390x 和 loong64）上从发布归档手动安装 wantasticd，用 genkey 认领，并添加你自己的服务。"
url: "https://wantastic.app/zh/docs/install-manual"
category: "Install wantasticd"
reading_time: "5 分钟"
---

# 手动安装 tarball

在任意 Linux CPU（包括 ppc64、s390x 和 loong64）上从发布归档手动安装 wantasticd，用 genkey 认领，并添加你自己的服务。

> **Outcome:** wantasticd 已从你选择的归档文件安装并完成认领，由你控制的服务保持运行。

## Before you start

- 在带有 /dev/net/tun 的 Linux 机器上拥有 root 权限。
- curl 或 wget，或其他将文件复制到该机器的方式。
- 一部手机或一个浏览器，用于登录 Wantastic 控制台。

## 快速安装（5 分钟）

适用于安装程序无法识别的 CPU、离线机器、只读系统或你自己的工具链。将 <arch> 替换为发布矩阵中的归档名称（amd64、arm64、arm、386、mips、mipsle、mips64、mips64le、riscv64、ppc64le、ppc64、s390x、loong64）。

1. 用第一个代码块下载归档文件并安装二进制文件。./wantasticd version 必须输出版本号。
2. 运行 sudo wantasticd genkey。扫描二维码或打开 Claim URL，登录后点击 Claim Device。
3. 终端打印 "Device claimed" 后，按 Ctrl+C。
4. 用第二个代码块（systemd）创建服务。其他 init 系统请参阅下一节。
5. 在控制台中打开 Devices。设备显示为 Online。

下载、安装并认领:

```bash
TAG=$(curl -fsSL https://get.wantastic.app/latest | cut -d+ -f1)
curl -fsSLO https://get.wantastic.app/$TAG/wantasticd-linux-<arch>.tar.gz
tar -xzf wantasticd-linux-<arch>.tar.gz && ./wantasticd version
sudo install -m 755 wantasticd /usr/local/bin/wantasticd
sudo wantasticd genkey
```

出现 "Device claimed" 后：按 Ctrl+C，然后创建 systemd 服务:

```bash
sudo tee /etc/systemd/system/wantasticd.service >/dev/null <<'EOF'
[Unit]
Description=Wantastic Overlay Networking Daemon
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/wantasticd connect --config "/etc/wantastic/config.conf"
Restart=on-failure
RestartSec=5
KillMode=process

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && sudo systemctl enable --now wantasticd
```

*安装并认领: genkey 打印 Claim URL 和二维码后进入等待。你在控制台中点击 Claim Device 后，它会打印 "Device claimed"。然后按 Ctrl+C 并重启服务。*

```
$ $ sudo wantasticd genkey
…
…
Generated device claim key: /etc/wantastic/device-claim-key.json
Public key: Vd3hK1oQ7mR2sT9uW4xY6zA8bC0dE2fG4hJ6kL8mN0P=
Server URL: https://console.wantastic.app
Claim URL: https://console.wantastic.app/#desktop?claim_public_key=Vd3hK1oQ…%3D&wantastic_server=https%3A%2F%2Fconsole.wantastic.app

█▀▀▀▀▀█ ▄▀▄ ▀█▄ █▀▀▀▀▀█
█ ███ █ ▀█▄▀▄█ █ ███ █
█ ▀▀▀ █ ▄▀█ ▀▄ █ ▀▀▀ █
▀▀▀▀▀▀▀ ▀ ▀ █ ▀ ▀▀▀▀▀▀▀
▀█▄▀▄▀▀█▀▄█▀▄▀▀▄█▀▄▀█▄
█▀▀▀▀▀█ █▄▀▄▀█ ▀▄█ ▄▀
▀▀▀▀▀▀▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀

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.conf
^C
$ $ sudo systemctl daemon-reload && sudo systemctl enable --now wantasticd
```

*Console: Claim Wantastic Device。Claim URL 和二维码会自动填入密钥，你只需点击 Claim Device。*

1. Claim public key 已自动填写
2. Wantastic server 保持默认即可
3. 点击 Claim Device

> **Tip:** 机器无法访问互联网？在另一台电脑上下载归档文件，用 scp 复制过去。不过 genkey 仍需要互联网才能完成认领。

## 其他 init 系统

每种服务都运行相同的命令：wantasticd connect --config /etc/wantastic/config.conf。

### OpenRC

/etc/init.d/wantasticd:

```sh
#!/sbin/openrc-run
description="Wantastic Overlay Networking Daemon"
command="/usr/local/bin/wantasticd"
command_args="connect --config /etc/wantastic/config.conf"
command_background=true
pidfile=/run/wantasticd.pid
depend() { need net; }
```

> 然后：chmod +x /etc/init.d/wantasticd && rc-update add wantasticd default && rc-service wantasticd start

### procd（OpenWrt）

/etc/init.d/wantasticd:

```sh
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
start_service() {
  procd_open_instance
  procd_set_param command /usr/local/bin/wantasticd connect --config /etc/wantastic/config.conf
  procd_set_param respawn 3600 5 0
  procd_set_param term_timeout 15
  procd_set_param file /etc/wantastic/config.conf
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}
```

> 然后：chmod +x /etc/init.d/wantasticd && /etc/init.d/wantasticd enable && /etc/init.d/wantasticd start

### SysV

/etc/init.d/wantasticd:

```sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: wantasticd
# Required-Start: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
PIDFILE=/var/run/wantasticd.pid
case "$1" in
  start) start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --exec /usr/local/bin/wantasticd -- connect --config /etc/wantastic/config.conf ;;
  stop)  start-stop-daemon --stop --pidfile $PIDFILE; rm -f $PIDFILE ;;
  restart) $0 stop; sleep 1; $0 start ;;
  *) echo "Usage: $0 {start|stop|restart}"; exit 1 ;;
esac
```

> 然后：chmod +x，并用 update-rc.d wantasticd defaults（Debian）或 chkconfig --add wantasticd（RHEL）注册服务。

> **Warning:** 自动更新会通过 systemd、launchd、procd、OpenRC 或 /etc/init.d/wantasticd restart 重启代理。如果你使用其他方式（supervisord、runit、s6、自定义循环），请在命令中添加 --no-auto-update 并手动更新。

## 检查是否正常工作

1. 运行 wantasticd status。它会显示 Status: Connected 和一个 VPN IP。
2. 在控制台中打开 Devices。设备显示为 Online。

检查:

```bash
wantasticd status
```

*wantasticd status: Status: Connected 加上 VPN IP 表示隧道已建立。*

```
$ $ wantasticd status
Status:        Connected
Version:       v1.0.54+377f3c0
Mode:          TUN (wantastic0)
VPN IPs:       10.200.0.14/32
Public key:    q7ZkV3m1yH0dTn8pXo2bLwR4sE6uJ9cA1fG5hK8iN0M=
Server:        wg.wantastic.app:51820
Exit node:     false
Local access:  false
Auto update:   true
Traffic:       ↓ 18.4 KiB  ↑ 9.2 KiB
Peers:         2 (direct 1, relay 1)
Uptime:        4m12s
```

*Console: Devices 窗口：新设备以其名称出现，并在几秒钟内变为 Online。*

1. 按名称搜索
2. 状态显示 Online
3. 覆盖网络 IP 与 wantasticd status 一致
4. Last seen 持续更新

## 其他安装方式

仅在自动化或特殊情况下才需要这些方式。上面的快速安装是最简单的方法。

### 使用令牌

不使用 genkey，而是用 Account → Secrets 中的令牌登录。--no-connect 会保存配置后退出。

令牌登录:

```bash
sudo wantasticd login --no-connect --token <TOKEN>
# self-hosted portal:
# sudo wantasticd login --no-connect --portal-url https://wantastic.example.com --token <TOKEN>
```

> 像对待密码一样对待令牌。在其过期之前，任何持有它的人都能向你的账户添加设备。

*Console: Account → Secrets → + New Secret。密钥的值就是令牌。*

1. 打开 Secrets 选项卡
2. 点击 + New Secret
3. 为其命名
4. 点击 Generate
5. 复制新密钥

## Verify the result

- wantasticd version 输出预期的版本号。
- /etc/wantastic/config.conf 存在且不为空。
- 你的服务开机自启，wantasticd status 显示 Connected。
- 设备在 Devices 中显示为 Online。

## Common issues

### 二进制文件无法运行。

```
cannot execute binary file: Exec format error
```

- **Where:** shell
- **Likely cause:** 归档文件与 CPU 不匹配。
- **Fix:** 检查 uname -m，并从发布矩阵下载匹配的归档文件。

检查 CPU:

```bash
uname -m
```

### 下载返回 404。

```
curl: (22) The requested URL returned error: 404
```

- **Where:** curl
- **Likely cause:** 归档名称有拼写错误，或 TAG 仍包含 +sha 部分。
- **Fix:** 从发布矩阵中原样复制归档名称，并按示例使用 cut -d+ -f1。

### 服务找不到配置。

```
Config not found at /etc/wantastic/config.conf. Run `wantasticd genkey --out <key>` to create a claim key and wait for claim, or pass --wait-claim with an existing key.
```

- **Where:** wantasticd connect
- **Likely cause:** genkey 运行时未使用 sudo，因此配置被保存到了 ~/.config/wantastic。
- **Fix:** 使用 sudo 运行 genkey，并重新认领设备。

以 root 身份认领:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

### genkey 或 login 无法保存配置。

```
Failed to prepare config path: parent /etc/wantastic is not a directory
```

- **Where:** wantasticd genkey / login
- **Likely cause:** 存在一个旧的普通文件 /etc/wantastic。旧版本曾将其用作配置文件。
- **Fix:** 将旧文件移到别处，然后重新认领。

修复:

```bash
sudo mv /etc/wantastic /etc/wantastic.old
sudo wantasticd genkey
```

### 你已点击 Claim Device，但终端始终没有打印 "Device claimed"。

```
Claim polling not ready: claim config rejected (401): invalid signature or timestamp out of window
```

- **Where:** wantasticd genkey
- **Likely cause:** 设备时钟不准确。只有当时钟与实际时间相差在 30 秒以内时，认领才能成功。
- **Fix:** 修正时钟。genkey 会继续等待，并自行完成。

开启网络对时:

```bash
sudo timedatectl set-ntp true
date
```

### 服务一启动就立即停止。

```
Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist
```

- **Where:** 服务日志
- **Likely cause:** 内核 TUN 驱动未加载。
- **Fix:** 加载 TUN 驱动，然后重启服务。

加载 TUN:

```bash
sudo modprobe tun
sudo systemctl restart wantasticd
```

- **Verify:** ls -l /dev/net/tun 显示该设备。

### 出现了第二个接口（wantastic1），或日志显示端口冲突。

```
Port 51820 in use, using random port
```

- **Where:** 服务日志
- **Likely cause:** genkey 仍在终端中运行，而服务也在运行。现在有两个副本在争用。
- **Fix:** 在运行 genkey 的终端中按 Ctrl+C，然后重启服务。

重启:

```bash
sudo systemctl restart wantasticd
```

### status 显示 Running (tunnel down)，或 peers 显示 (server) 为 HANDSHAKE never。

```
Device health check failed: …
```

- **Where:** 服务日志
- **Likely cause:** 网络阻止了到中心节点（wg.wantastic.app）的出站 UDP 51820 端口，或 DNS 不可用。
- **Fix:** 在防火墙中放行出站 UDP 51820，然后重启服务。

测试 DNS 并重启:

```bash
nslookup wg.wantastic.app
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd peers 显示 (server) 有最近的握手（例如 "8s ago"）。

## Continue with

- [Choose your install method](https://wantastic.app/zh/docs/install-overview): Find your device in one table and copy one command. Most devices install in 2 minutes: install, scan a QR code, click Claim Device.
- [Run in Docker (community pattern)](https://wantastic.app/zh/docs/install-docker): Run wantasticd in a Docker container built from the official release: build a small image, claim it once with genkey, then run it detached. Not an official image.
- [Install on MIPS routers](https://wantastic.app/zh/docs/install-mips-routers): Install wantasticd on MIPS routers and boards: one command tells you the CPU type, then copy the matching install block and claim the router with a QR code.
- [wantasticd CLI reference and operations](https://wantastic.app/zh/docs/wantasticd): The most used wantasticd commands first, then every command and flag, environment variables, config and state paths per OS, log lines, local access, exit node, and the claim flow (genkey / --wait-claim).
- [Update, roll back and uninstall](https://wantastic.app/zh/docs/update-and-uninstall): Update or uninstall wantasticd with one line per OS. Also: how auto-update works, turning it off, rolling back to the previous binary, and purging all data.
- [Installer errors (install.sh and install.ps1)](https://wantastic.app/zh/docs/errors-installer): Every message the Wantastic installers print when they stop, what it means and the easiest fix.
