# How to install Hermes Agent on a Linux VPS

> Hermes Agent by Nous Research is an AI agent that learns from its own work and runs non-stop. For maximum stability, we recommend installing it on a Hukot.net VPS.

Source: https://www.hukot.net/community/en/tutorials/how-to-install-hermes-agent-on-a-linux-vps
Updated: 2026-11-25

Hermes Agent by Nous Research is an open-source AI agent that learns from its own work: it remembers procedures, runs commands, works with files, schedules recurring tasks and answers through Telegram, Discord, Slack or e-mail. On a VPS it is available around the clock.

For maximum stability, we recommend installing it on a [Hukot.net VPS](https://www.hukot.net/en/linux-vps/): your server is ready within 60 seconds of ordering, and your data stays in a datacentre in the Czech Republic.

## Prerequisites

- A VPS with Ubuntu 24.04 / 26.04 LTS or Debian 12 / 13 and SSH access with `sudo` rights. Set up key-based login with [SSH with public-key authentication](tutorial:26).
- We recommend at least 8 GB of RAM (the VPS-L08G plan): besides the agent, the installer also downloads the Chromium browser for working with the web. If the agent runs out of memory, [switch to a higher plan](tutorial:272) right in the administration and pay only the difference.
- An API key from a model provider (for example OpenRouter, OpenAI or Anthropic), a Nous Portal account, or your own model in Ollama on a GPU-VPS.

> [!WARNING]
> The agent can run commands and read files on the server. Install it under a separate user without `sudo` rights, and never as root.

## Installation

### A user for Hermes

1. Create the user `hermes` and install the packages the installer needs. A user without `sudo` couldn't install them by itself:

   ```bash
   sudo adduser hermes
   sudo apt install -y git curl tar libatomic1 dbus-user-session
   ```

2. Allow the user's services to keep running after logout and after a server restart:

   ```bash
   sudo loginctl enable-linger hermes
   ```

Managing users is covered in more detail in [Adding and removing users in Linux](tutorial:92).

### Hermes Agent

1. Switch to the user `hermes`:

   ```bash
   sudo -iu hermes
   export XDG_RUNTIME_DIR=/run/user/$(id -u)
   ```

   Switching with `sudo` doesn't create a full login session, so set `XDG_RUNTIME_DIR` every time. Without it, the systemd user service that Hermes will run under can't be managed. Return to your own user with `exit`.

2. Run the official installer and reload the shell settings:

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

   The installer downloads Python and the other dependencies into `~/.hermes` by itself, and puts the `hermes` command into `~/.local/bin`.

3. The installer starts the setup wizard. At **How do you want to power Hermes?** choose **Use my own API key or a subscription** and pick the model provider and model. If you are just trying it out, **Free, start now** with the free model is enough.

If you skipped the wizard, run it again with:

```bash
hermes setup
```

The settings are in `~/.hermes/config.yaml`, API keys and tokens in `~/.hermes/.env`. Make the file with the keys readable only by the user `hermes`:

```bash
chmod 600 ~/.hermes/.env
```

### Running in the background

The gateway is the part of Hermes that runs non-stop: it serves the chat channels and scheduled tasks. As the user `hermes`, install it as a service and start it:

```bash
hermes gateway install
hermes gateway start
```

## Your own model in Ollama

If you don't want to send data to a model provider, connect Hermes to Ollama. The model then runs on your own [Hukot.net GPU-VPS](https://www.hukot.net/en/gpu-vps/) with 24 to 96 GB of VRAM, and you don't pay per token.

::: tutorial 284 Before you start
Install the graphics card driver and Ollama following this tutorial (Open WebUI isn't needed), then continue here on the same server.
:::

Hermes needs a context of at least 64,000 tokens; by default, Ollama offers far fewer.

1. As your own user (not `hermes`), open the settings of the Ollama service:

   ```bash
   sudo systemctl edit ollama
   ```

2. Paste into the file that opens:

   ```ini
   [Service]
   Environment="OLLAMA_CONTEXT_LENGTH=64000"
   ```

3. Save the file, restart Ollama and download a model that supports tool calling:

   ```bash
   sudo systemctl restart ollama
   ollama pull qwen3:14b
   ```

4. As the user `hermes`, open the model picker, choose **Custom endpoint (self-hosted / VLLM / etc.)**, skip the API key and enter the model name `qwen3:14b`:

   ```bash
   hermes model
   ```

5. Enter `http://127.0.0.1:11434/v1` as the address.

> [!NOTE]
> Hermes connects to Ollama through its OpenAI-compatible interface, so the address ends with `/v1`. With [OpenClaw](tutorial:280) it's the other way round.

A longer context takes more graphics card memory. While a reply is being generated, check with `ollama ps` that the `PROCESSOR` column says `100% GPU`. If it doesn't, choose a smaller model. On GPU-VPS2 and GPU-VPS5 the larger `qwen3:30b` fits too; more models are listed in [Which VPS plan to choose for OpenClaw and Hermes Agent](tutorial:287).

## Accessing the dashboard

Start the web dashboard as the user `hermes` whenever you need it. It listens only on `127.0.0.1:9119`:

```bash
hermes dashboard --no-open
```

Open an SSH tunnel from your computer:

```bash
ssh -N -L 9119:127.0.0.1:9119 <user>@<server-ip>
```

Replace `<user>` with your user on the server and `<server-ip>` with its IP address. While the tunnel is running, the dashboard is at `http://127.0.0.1:9119/`.

> [!DANGER]
> Don't run the dashboard on a public address (`--host 0.0.0.0`), and don't open the API port `8642` to the internet either. Both can be used to control the agent.

## Security

1. Keep the default command approval (`smart`): the agent runs safe commands by itself, denies dangerous ones and asks about uncertain ones. Don't use the `off` mode or the `--yolo` switch on a server.

2. By default, the chat channels reject everyone who isn't on the list of allowed users. Don't use the `GATEWAY_ALLOW_ALL_USERS=true` setting.

3. Keep only SSH open on the firewall. See [Setting up firewall with UFW on linux](tutorial:96).

4. Secure SSH logins further with [How to disable SSH root login](tutorial:128) and [How To Protect SSH – Fail2ban](tutorial:31).

## Verification

As the user `hermes`, check the settings, dependencies and the state of the service:

```bash
hermes doctor
hermes gateway status
```

Send the agent its first message in the terminal interface, which you start with `hermes`. Follow what the gateway is doing in the log:

```bash
journalctl --user -u hermes-gateway -f
```

## Updates

Update Hermes as the user `hermes`. The `--backup` switch backs up the installation before updating:

```bash
hermes update --backup
hermes gateway restart
```

> [!TIP]
> Before a bigger update, create a snapshot in your Hukot.net VPS administration. If something breaks after the update, you can restore the server to its previous state.

## Why choose our VPS?

Unlike public clouds, we guarantee that your data stays in the Czech Republic, with top-class connectivity. Combined with Hermes Agent, you get an assistant that gets better every day and runs reliably 24/7 without having to keep your home PC switched on.

::: cta
## Want an AI agent that learns with you?

Order a Hukot.net VPS and have Hermes Agent running on it today.

[Choose a VPS configuration](https://www.hukot.net/en/linux-vps/)
:::
