---
title: "リモートのLinux VPSサーバー環境にHermes Agentを導入・デプロイして常時運用する方法"
description: "本ガイドでは、常時安定した稼働を維持するために、信頼性の高いリモートLinux VPSサーバー環境上にHermes Agentをインストールして、バックグラウンドサービスとして実行・デプロイする詳細な手順を解説します。また、カスタムTelegramボットと連携させて双方向の指示・操作を行う統合手順も説明。"
canonical_url: "https://techvoyage.dev/ja/article/how-to-setup-hermes-on-remote-server"
last_updated: "2026-10-20T09:53:48.440Z"
---

## なぜリモートVPSでHermes Agentをホストするのか？

Hermes Agentはバックグラウンド処理の実行、タスクスケジューリング、そしてWebhook呼び出しへの応答が可能なため、24時間365日常時スタンバイ状態にあるマシンが必要です。ローカルマシンでは、停電やインターネット接続の切断、ハードウェアリソースの枯渇といった問題が発生するリスクがあります。リモートサーバー（VPS）であれば、99%以上の稼働率（Uptime）が保証され、必要に応じていつでも計算リソースを簡単にスケールアップできます。

Hetzner、Hostinger、Contaboなど、リーズナブルな価格で利用できる仮想専用サーバー（VPS）プロバイダーは数多く存在します。筆者は以前からContaboを愛用していますが、これまでのところ非常に安定して稼働しています。

## Linux VPS上でのHermes Agentの設定手順

### ステップ1: VPSへの接続

ターミナルを開き、SSHコマンドでリモートマシンにログインします:

```bash
ssh root@your_server_ip
```

![ターミナルでのLinux VPSサーバーへのSSH接続画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/vps-terminal-ssh-connection.webp)

サーバーのパッケージを最新の状態に更新します:

```bash
sudo apt update && sudo apt upgrade -y
```

新しいユーザー（`hermes`またはお好みのユーザー名）を追加します:

```bash
sudo adduser hermes 
sudo passwd hermes
```

セキュリティ向上のため、`root`ユーザーによるパスワードログインを無効化します:

1. SSHの設定ファイルを開きます:

```bash
sudo nano /etc/ssh/sshd_config
```

1. `PermitRootLogin`という行を探し、値を`no`に変更します:

```text
PermitRootLogin no
```

1. ファイルを保存し、SSHサービスを再起動します:

```bash
sudo systemctl restart ssh
```

### ステップ2: Hermes Agentのインストール

以下のコマンドを実行します:

```bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
```

![ターミナルでのHermes Agentインストールスクリプトの実行](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-agent-installation-terminal.webp)

インストール完了後、以下のコマンドを入力して正しくインストールされたか確認します:

```bash
hermes --version
```

`hermes setup`を実行して、Hermes Agentの基本設定を行います:
![セットアップを開始するためのターミナルでのhermes setupコマンド実行画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-agent-setup-wizard.webp)

使用するLLMプロバイダーを選択します。まずは`DeepSeek`から開始し、後から他のモデルを追加できます。
![HermesセットアップでのLLMプロバイダー（DeepSeek）の選択](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-llm-provider-selection.webp)

`DeepSeek`のAPIキーを入力します:
![ターミナルでのDeepSeek APIキーの入力画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-enter-api-key.webp)![LLMプロバイダーのAPIキーの正常な確認メッセージ画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-api-key-success.webp)
Hermes Agentの実行環境として`local machine`を選択します:
![Hermes Agent実行環境としてのlocal machineの選択](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-select-local-machine.webp)
連携チャンネル一覧から`Telegram`を選択します。その他のチャンネルは後から設定可能です。
![Hermesセットアップでの通信チャンネル（Telegram）の選択](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-select-telegram-channel.webp)

### ステップ3: Telegramとの連携・統合

Telegramボットを使用するため、`[2]`を選択します。
![Telegramボット連携を設定するオプションの選択画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-bot-integration-option.webp)

スマートフォンやPCで`Telegram`を開き、「BotFather」を検索します。
![Telegramアプリ内でのBotFatherの検索画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-search-botfather.webp)

「Open」をクリックしてBotFatherとのチャットを開きます。
![TelegramでのBotFatherとのチャット画面の展開](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-open-botfather-chat.webp)

「Create a New Bot」（または`/newbot`コマンド）をクリックします。
![新規Telegramボット作成のためのBotFatherへの/newbotコマンド送信画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/botfather-create-new-bot.webp)

指示に従ってボットの名前とユーザー名を入力し、ボットを作成します。
![作成した新規Telegramボットの名前とユーザー名の設定画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/botfather-bot-details-configured.webp)

生成されたトークンをコピー（「Copy」をクリック）し、ターミナルに貼り付けます。
![新しく作成されたTelegramボットのHTTP APIトークンのコピー画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/botfather-copy-http-api-token.webp)

ご自身の`Telegram`ユーザーアカウントIDを調べ、「Allowed user list」（アクセス許可リスト）に追加します:

- `Telegram`で「@raw_data_bot」を検索します。
![ユーザーIDを取得するためのTelegramでのraw data botの検索画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-search-raw-data-bot.webp)
- 「RawDataBot」を開き、「Start（開始）」ボタンをクリックします。チャットに返信されたデータ内の「P.S. Your ID:」の後にユーザーIDが表示されます。
![ユーザーアカウントIDを表示するためのRawDataBotの開始画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-raw-data-bot-user-id.webp)
- ユーザーIDをコピーしてターミナルに入力（貼り付け）します。

今回はクラウド上で運用するため、サーバー起動時に自動でサービスが開始されるようにします。
![Hermes systemdサービスの自動起動（autostart）オプションの設定画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-autostart-service-option.webp)
他の設定項目はすべてデフォルト（推奨値）のまま進めます:
![ターミナルでのセットアップ構成のデフォルト値の維持](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-leave-defaults-1.webp)![Hermes構成でのデフォルトセットアップオプションの適用完了](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/hermes-setup-leave-defaults-2.webp)

## Telegramボットを使ったHermes Agentの動作テスト

以下のコマンドを実行して、`hermes gateway`を起動します:

```bash
hermes gateway
```

`Telegram`を開き、作成したボット「@tech_cloud_hermes_bot」を検索してチャットに追加します。

- チャットに「/new」と入力して送信し、新しい`Hermes Agent`セッションを開始します。
![新規Hermes Agentセッションを開始するためのTelegramでの/newコマンド入力](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-chat-hermes-new-session.webp)
- 「/commands」と入力すると、利用可能なすべてのコマンドが一覧表示されます。
![利用可能なHermesコマンドを表示するためのTelegramでの/commands入力](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-chat-hermes-commands-list.webp)
- 「/model」と入力すると、利用可能なLLMモデルの一覧が表示されます。
![有効なLLMモデル一覧を表示するためのTelegramでの/model入力画面](https://inimages.techvoyage.dev/articles/How%20to%20Setup%20Hermes%20on%20Remote%20Server/telegram-chat-hermes-model-selection.webp)

## Hermes Gatewayをバックグラウンドサービスとして常時実行する

systemdのサービスファイルを作成します:

```shell
sudo nano /etc/systemd/system/hermes-gateway.service
```

以下の内容を貼り付けます。なお、`/home/hermes`の部分の`hermes`はご自身で設定したユーザー名に書き換えてください:

```ini
[Unit]
Description=Hermes Gateway
After=network.target

[Service]
User=hermes
WorkingDirectory=/home/hermes
ExecStart=/home/hermes/.local/bin/hermes gateway
Restart=always
RestartSec=10
Environment=PATH=/home/hermes/.local/bin:/usr/local/bin:/usr/bin:/bin

[Install]
WantedBy=multi-user.target
```

作成したサービスを有効化し、起動します:

```shell
sudo systemctl daemon-reload
sudo systemctl enable hermes-gateway
sudo systemctl start hermes-gateway
sudo systemctl status hermes-gateway
```

## おわりに

本記事では、Hermes Agentの基本的なセットアップ方法と、Telegramを利用した双方向の通信設定について解説しました。リモートサーバー上でHermes Agentを常時稼働させることで、24時間365日いつでも応対してくれる本物のデジタルアシスタントを手にすることができます。
