Skip to content

安装 hermes / ubuntu 24.04 server

sh
sudo apt update

sudo apt install -y \
  git \
  curl \
  xz-utils \
  ca-certificates \
  openssl

安装前建议配置 mihomo,否则 github clone 会很漫长

sh
# 测试下载地址
curl -I https://hermes-agent.nousresearch.com/install.sh

# 安装下载
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

安装后检查

sh
source ~/.bashrc

which hermes
hermes --version
hermes doctor

ls -lah ~/.hermes/

开启 web

sh
cd ~/.hermes/hermes-agent

~/.hermes/bin/uv pip install \
  --python ./venv/bin/python \
  -e ".[web,pty]"

# 测试
hermes dashboard --no-open

cd ~/.hermes/hermes-agent
source venv/bin/activate

HASH=$(python -c "from plugins.dashboard_auth.basic import hash_password; print(hash_password('1'))")

# 确认密码是否生效
echo "$HASH"

# 退出
deactivate

# 只执行一次
cat >> ~/.hermes/.env <<EOF
HERMES_DASHBOARD_BASIC_AUTH_USERNAME=admin
HERMES_DASHBOARD_BASIC_AUTH_PASSWORD_HASH=$HASH
HERMES_DASHBOARD_BASIC_AUTH_SECRET=$(openssl rand -base64 32)
EOF

chmod 600 ~/.hermes/.env

# 测试
hermes dashboard \
  --host 0.0.0.0 \
  --port 9119 \
  --no-open

使用 systemd service

sh
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/hermes-dashboard.service
[Unit]
Description=Hermes Agent Web Dashboard
After=network-online.target
Wants=network-online.target

[Service]
Type=simple

EnvironmentFile=%h/.hermes/.env

# 让 Hermes 运行时的 HTTP 客户端可以交给 Mihomo 判断:
# GitHub / Playwright 等指定域名 -> PROXY
# 其他 -> Mihomo MATCH,DIRECT
Environment=HTTP_PROXY=http://127.0.0.1:7890
Environment=HTTPS_PROXY=http://127.0.0.1:7890
Environment=ALL_PROXY=socks5h://127.0.0.1:7890
Environment=http_proxy=http://127.0.0.1:7890
Environment=https_proxy=http://127.0.0.1:7890
Environment=all_proxy=socks5h://127.0.0.1:7890
Environment=NO_PROXY=127.0.0.1,localhost
Environment=no_proxy=127.0.0.1,localhost

ExecStart=%h/.hermes/hermes-agent/venv/bin/python \
  -m hermes_cli.main dashboard \
  --host 0.0.0.0 \
  --port 9119 \
  --no-open

Restart=unless-stopped
RestartSec=5

[Install]
WantedBy=default.target
sh
systemctl --user daemon-reload

systemctl --user enable --now hermes-dashboard
# Created symlink /home/qin/.config/systemd/user/default.target.wants/hermes-dashboard.service → /home/qin/.config/systemd/user/hermes-dashboard.service.

systemctl --user status hermes-dashboard

sudo loginctl enable-linger qin

# 检查
loginctl show-user qin | grep Linger
# 应该是: Linger=yes

如果 playwright 安装失败

cd ~/.hermes/hermes-agent

npx playwright install --with-deps chromium