Always-on agents · Set it up anywhere

Running an always-on agent on Debian

Debian is the host I would pick for an agent I never want to think about, and the reason is also its one problem: stable means old. This guide covers only what is different on Debian from the generic Linux steps, with every command run in a fresh Debian 13 container on 20 October 2026.

In short

On Debian 13 the generic Linux steps work unchanged; what differs is package age. Stable ships Python 3.13.5, which every agent framework accepts, and Node 20.19, which OpenClaw does not. Take Node from the vendor's installer or a trusted upstream repository, keep the install minimal, run the agent as a system service or a lingering user service, and let unattended-upgrades handle security patches.

Part of the Always-on agents series, post 15 of 33.

This is the second of the distribution guides, and it leans on the Linux core page for everything the distributions share: the dedicated user, the virtual environment, the service with a restart policy, the timer, the secrets file, the watchdog. I am not going to repeat those steps here. What follows is only where Debian is different, which is a short list, and the commands are the ones I ran in a fresh debian:13 container booted with systemd, with the output pasted in.

What was testedA fresh Debian 13.7 (trixie) container with systemd as PID 1, on 20 October 2026. Not a bare-metal install, so anything about boot firmware, disks or Wi-Fi is outside what I checked. Everything about packages, users, units and timers ran as shown.

Why I like Debian for this, and the catch

An always-on agent is the kind of software that should sit on a host that does not change under it. Debian 13 was released on 9 August 2025, gets full support until August 2028 and long-term support until June 2030, and a point release every couple of months carries only fixes. I checked the version string first, because the point release matters when you read a bug report:

Debian 13 container$ cat /etc/debian_version
13.7
$ . /etc/os-release; echo "$PRETTY_NAME"
Debian GNU/Linux 13 (trixie)

The catch is the same fact seen from the other side. Stable means the package versions were frozen before the release and only get security fixes afterwards. For an agent host that cuts both ways, and the next section is where it bites.

The package-age problem: Python is fine, Node is not

Before I installed anything I asked apt what it would give me, because the answer decides how the rest of the setup goes.

Terminal$ apt-cache policy python3 | head -3
python3:
  Installed: (none)
  Candidate: 3.13.5-1
$ apt-cache policy nodejs | head -3
nodejs:
  Installed: (none)
  Candidate: 20.19.2+dfsg-1+deb13u3

Python 3.13.5 sits inside the range Hermes Agent's project file accepts, 3.11 up to 3.14, and its installer brings a pinned Python of its own in any case, so for a Python agent Debian's age is no obstacle. Node 20 is the problem. OpenClaw's own install page asks for Node 24.16 or newer, and recommends 26, so the Node that Debian stable ships cannot run it. I checked whether backports had something newer, which is the first thing I try on Debian before reaching for anything outside the archive:

/etc/apt/sources.list.d/debian-backports.sourcesTypes: deb deb-src
URIs: http://deb.debian.org/debian
Suites: trixie-backports
Components: main
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Terminal$ apt-get update
$ apt-cache policy nodejs | grep -A1 trixie-backports
$

Nothing. On the day I ran this, trixie-backports carried no newer nodejs, so the backports route, which is the right answer for many packages on Debian, does not solve Node for OpenClaw. That leaves two honest options. Let the OpenClaw installer provision Node itself, which its install page says it does on Linux, with Node 24 LTS, kept under its own prefix. Or install Node from the upstream NodeSource repository, which is a third-party source you are choosing to trust. I would take the first option on a machine that runs only the agent, and I would not install Node from a snap, because Debian does not ship snapd and I see no reason to add it for a daemon that holds secrets.

If your agent is Python, none of this applies and Debian is the easy case. Here is the whole runtime step as I ran it, as the agent's own user:

Terminal$ apt-get install -y --no-install-recommends python3 python3-venv sudo
$ useradd --system --create-home --home-dir /srv/agent --shell /usr/sbin/nologin agent
$ sudo -u agent python3 -m venv /srv/agent/venv
$ sudo -u agent /srv/agent/venv/bin/python -c 'import sys; print("venv", sys.version.split()[0])'
venv 3.13.5

One thing to know: creating that virtual environment took several minutes in my container, because ensurepip unpacks and installs pip inside it. That is normal and it is a one-off; do not kill it.

The service: identical to the core page, so I only verified it

The unit file is the one from the Linux core page, unchanged, which is the point of having a core page. I pasted it in, asked systemd to check it, enabled it and read the journal.

/etc/systemd/system/agent.service[Unit]
Description=Always-on agent
After=network-online.target
Wants=network-online.target

[Service]
User=agent
WorkingDirectory=/srv/agent
EnvironmentFile=-/etc/agent.env
ExecStart=/srv/agent/venv/bin/python /srv/agent/agent.py
Restart=always
RestartSec=5
MemoryMax=512M

[Install]
WantedBy=multi-user.target
Terminal$ systemd-analyze verify /etc/systemd/system/agent.service && echo VERIFY_OK
VERIFY_OK
$ systemctl daemon-reload && systemctl enable --now agent.service
Created symlink '/etc/systemd/system/multi-user.target.wants/agent.service' → '/etc/systemd/system/agent.service'.
$ systemctl is-active agent.service
active
$ journalctl -u agent.service --no-pager -n 2
Oct 20 20:15:28 fb1b6fabdff1 systemd[1]: Started agent.service - Always-on agent.
Oct 20 20:15:31 fb1b6fabdff1 python[1223]: 2026-10-20T20:15:31.434627 heartbeat

That heartbeat line is the agent's entire job in this test: print the time every thirty seconds. On my real jobs the equivalent line is the thing I grep for first when something looks wrong, because a process that is running but not heartbeating is the failure that looks like success.

User services and lingering, the Debian way

The core page runs the agent as a system service, which I prefer on a box dedicated to it. Debian also makes the user-service route clean, and it is what OpenClaw's installer uses on Linux: a systemd user service under the agent's own account. The one step people miss is lingering. Without it, a user's services stop when the user logs out and never start at boot, because the user manager only exists while a session does.

Terminal$ loginctl enable-linger agent
$ ls /var/lib/systemd/linger/
agent

With that file in place the user manager for agent starts at boot and stays up with no login. User units then live in /srv/agent/.config/systemd/user/ and you manage them with systemctl --user as that user. I keep system services for anything that needs a port below 1024 or a system path, and user services for anything that only touches its own home.

Unattended upgrades: on by default once installed

An agent host that nobody logs into still needs security patches, and on Debian the package that does this quietly is unattended-upgrades. Installing it was enough to switch it on in my container; the periodic configuration appeared without any further step:

Terminal$ apt-get install -y unattended-upgrades
$ cat /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

The default origin pattern installs security updates and nothing else, which is what I want on an agent host. The one setting I check by hand is the reboot line, because a kernel update that waits for a reboot that never comes is a quiet hole:

Terminal$ grep -n 'Automatic-Reboot "' /etc/apt/apt.conf.d/50unattended-upgrades
116://Unattended-Upgrade::Automatic-Reboot "false";

It ships commented out, so there is no automatic reboot. On a dedicated agent box I would set it to true with a reboot time in the small hours, and I would make sure the agent's service is enabled so it comes back, which the enable step above already guarantees. Debian's wiki suggests editing a copy of the file rather than the original, so a package update does not overwrite your change.

A minimal install, by default

Two things I did not have to do on Debian, which I mention because the Ubuntu guide has to do both. There is no snap to avoid, and there is no ufw unless you install it. Debian 13 leaves you with nftables and nothing listening, which for an agent that should only ever talk outward is the right starting point. If the agent exposes a gateway, as OpenClaw does on port 18789, keep it on loopback or put it behind a private network, and read the permissions post before you open anything.

What I would do in order

This is the order I ran it in, and the order I would use on a real box.

  1. Check the point release and the Python and Node candidates. The three commands at the top of this post. They decide whether you need anything outside the archive.
  2. Decide where Node comes from, if you need Node. Backports first; on 20 October 2026 it had nothing newer. Then the agent vendor's installer or the upstream repository, as a conscious choice.
  3. Create the agent user and the virtual environment. System account, no shell, its own home under /srv. Expect the venv step to take a few minutes.
  4. Install the unit from the core page and verify it before enabling it. systemd-analyze verify, then enable --now, then read the journal for the heartbeat.
  5. Enable lingering if you chose a user service. loginctl enable-linger, then confirm the file under /var/lib/systemd/linger.
  6. Install unattended-upgrades and decide about reboots. It is on once installed. Set the reboot line deliberately, in a copy of the config.

Sources

  1. Debian, Debian 13 trixie release information (accessed October 20, 2026)
  2. Debian Backports, Instructions (accessed October 20, 2026)
  3. Debian Wiki, UnattendedUpgrades (accessed October 20, 2026)
  4. OpenClaw docs, Install (accessed October 20, 2026)
  5. Nous Research, Hermes Agent documentation: installation (accessed October 20, 2026)

Written by Lera Leonteva. Commands and outputs are from a fresh Debian 13.7 container with systemd, run on the access date.

Frequently asked questions

Can I run OpenClaw on Debian 13?

Yes, but not with Debian's own Node. Stable ships Node 20.19 and OpenClaw asks for 24.16 or newer. On the day I checked, backports had nothing newer, so let OpenClaw's installer provision Node under its own prefix, or add the upstream Node repository knowingly.

Is Debian or Ubuntu better for an always-on agent?

I would pick Debian for a box that runs only the agent and that I want to leave alone for years: longer support, no snap, nothing listening by default. Ubuntu is the easier choice if you want newer packages without leaving the archive. The core steps are identical on both.

Why does my agent stop when I log out of the Debian box?

Because it is a user service and lingering is off. Run loginctl enable-linger for the agent's user and the user manager starts at boot and survives logout. Or run it as a system service, which is what I do.

Does Debian install security updates automatically?

Once unattended-upgrades is installed, yes. In my container the periodic configuration was switched on by the install itself. Automatic reboots stay off unless you set them, and I would, with a time in the small hours.

Which Debian version did you test this on?

A fresh Debian 13.7 (trixie) container with systemd as PID 1 on 20 October 2026. It is not a bare-metal install, so I make no claims about disks, firmware or Wi-Fi.

Lera Leonteva
Lera Leonteva
CEO & Founder, Leo AI

Lera Leonteva is the founder and CEO of Leo AI, where she works on turning long-form footage into short-form video that earns attention on its own merits. She writes Video Scaling Strategies, taking one piece of content that worked and one that did not, and using what the market is doing to explain the gap.

The always-on agent I run for social video

Leo watches what your audience is responding to, picks a clip from footage you already have, edits it and books it on the calendar. Every hour, without being asked. It is the agent this whole series grew out of.

Keep going with the series

Every post in the Always-on agents series is on one page, newest first. If you would rather see the agent I run for social video, here it is.