Short answer. nanobot answers Telegram and Discord and runs its scheduled jobs only while its gateway process runs, so a 24/7 agent needs a machine that never sleeps. On your own Linux server: install the stable release from PyPI as a normal user, connect your bot, check that it answers, then install the gateway as a systemd user service and run loginctl enable-linger $USER so it keeps running after you log out; you update it and keep it safe. Or rent a server that runs nanobot for you, where the panel does the install, updates and restarts and you only paste a key and a bot token. Either way it is light: in our test it held about 154 MiB of memory at rest.
Checked on 10 November 2026, accurate for nanobot 0.4.1.
This guide uses nanobot's own documentation (its README and docs folder on GitHub, release 0.4.1) and what we measured running nanobot 0.4.1 on our own servers. To go straight to the hosted route, see Option 3.
Why a laptop is not enough
nanobot's gateway is one long-running process. It keeps the chat apps connected and runs the jobs nanobot does on its own: its heartbeat, its Dream memory job and the scheduled tasks you give it. When the laptop sleeps, reboots or loses its network, the agent stops answering and those jobs do not run. nanobot's deployment docs describe a service that starts automatically and restarts on failure for exactly this.
What you need
nanobot's docs
What we measured (0.4.1, one CPU core)
Memory
Not stated
About 154 MiB at rest for the whole server (the nanobot process: resident size 192 MB), with Telegram set up with a test token (refused by Telegram, so not connected). It installed and ran within a 256 MB limit, 512 MB and 2 GB too
Disk
Not stated
About 470 MB for the program and its libraries, plus 136 MB of pip download cache unless you turn the cache off
Install time
34 to 49 seconds from PyPI
Python
3.11 or newer
We used 3.12
AI model
A supported model provider or a local model server; nanobot does not supply a model account
You also need a chat app to talk to it: a Telegram bot token from @BotFather, or a Discord bot token from the Discord Developer Portal with Message Content Intent turned on (nanobot's docs list it as required for Discord).
We have not yet measured long conversations with a real AI model, so treat the memory figure as a floor. It is still small next to the other agents we host: Hermes Agent used 223 to 259 MiB at rest in our tests and OpenClaw about 1.1 to 1.5 GB.
Option 1: your own Linux server with a service
Create the server and connect over SSH as a normal user, not root. The agent's tools, its shell included, run as the user that runs nanobot, so keep that account for the agent.
Install the stable release. nanobot's README recommends its installer, which installs or upgrades the stable PyPI release in its own environment and, over SSH, continues with setup in the terminal:
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
If you manage Python yourself, install the same package into a virtual environment instead, then run the terminal setup:
The README says to install from PyPI for "the most stable day-to-day experience"; the source checkout is for the newest features.
Check it answers before you make it permanent. nanobot's deployment docs give two checks: nanobot status shows the config and workspace it will use, and nanobot agent -m "Hello!" proves the install, the provider, the model and the workspace in one go.
Connect Telegram. For a server without the WebUI, install Telegram support with nanobot plugins enable telegram, then add the bot to ~/.nanobot/config.json:
With allowFrom set, only those user IDs can use the agent. If you leave it out, nanobot uses pairing: the first direct message from a new user gets a pairing code, which you approve with /pairing approve <code> from an account that is already paired, or from the terminal with nanobot agent -m "/pairing approve <code>". Never set allowFrom to ["*"]: that lets anyone who finds the bot use your agent and your AI key. Discord works the same way under channels.discord.
Run it as a service. Stop any gateway you started by hand, then let nanobot write and start a systemd user service, and let it run after you log out:
nanobot's docs say the unit starts the gateway automatically and restarts it on failure. Restart it after every change to config.json (systemctl --user restart nanobot-gateway): the gateway reads its settings only when it starts.
Update with the method you installed with: for a virtual environment, that environment's python -m pip install --upgrade nanobot-ai, then restart the service. nanobot's update docs ask you to stop the agent and back up the configuration and workspace first, and they say the importers for older data formats are scheduled for removal in 0.5.0, so upgrade an older install to 0.4 before 0.5 arrives. Releases are frequent: 0.4.0 on 28 October and 0.4.1 on 6 November 2026.
Option 2: Docker Compose
nanobot's only official Docker route is building from its own repository: its docs warn that images under other Docker Hub names are not maintained or checked by the project, and not to give them your keys unless you trust the publisher. On a Linux host with Git and Docker:
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
docker compose up -d
docker compose logs
On first boot Compose writes ~/.nanobot/config.json with container addresses and a random WebUI password, printed in the logs. You then open the WebUI on port 8765, set your provider and model, and connect Telegram or Discord there. Everything persists in ~/.nanobot, which is also what you back up. You update by rebuilding or pulling the image and recreating the service; nanobot's docs say not to pip-install into a running container.
Keep a self-hosted agent safe
Allow only yourself. Put your own user ID in allowFrom, or use pairing and approve only your own code. ["*"] lets everyone in.
Keep secrets out of the file. Any value in config.json can be a reference such as "${TELEGRAM_BOT_TOKEN}", filled from the environment when nanobot starts, so the key never has to sit in the file.
Fence the tools in. For production, nanobot's docs recommend tools.restrictToWorkspace set to true together with tools.exec.sandbox set to "bwrap" on Linux, which needs bubblewrap installed first (sudo apt install bubblewrap). The first keeps file tools inside the workspace; the second isolates the shell commands it runs.
Keep its ports private. The gateway's health address (port 18790) has no sign-in and listens only on 127.0.0.1 by default; the WebUI and WebSocket channel use port 8765 and need a token or password once they listen beyond the machine. Keep both behind a firewall or an SSH tunnel.
Back up ~/.nanobot: it holds the settings, sessions, memory and workspace.
Background jobs and your AI bill
Two jobs run without you asking, both on by default in nanobot 0.4.1:
Heartbeat, every 30 minutes (gateway.heartbeat.intervalS, 1800). It reads HEARTBEAT.md in the workspace and runs the agent, and so your model, only when the file lists tasks under ## Active Tasks. The template nanobot ships has none.
Dream, every 2 hours (agents.defaults.dream.intervalH, 2). It reads the conversation summaries written since its last run and updates the agent's long-term memory with your model. With nothing new, it logs "Dream: nothing to process" and stops.
So an agent nobody talks to does not call your model for these two jobs. After a conversation, a Dream run follows within two hours. To turn them off, set "enabled": false under gateway.heartbeat or agents.defaults.dream and restart the agent.
Idle-chat summaries also use your model after a conversation: about 15 minutes after a chat goes quiet, nanobot summarizes it so later requests stay short (agents.defaults.idleCompactAfterMinutes, 15 by default; 0 turns them off). Those summaries are what Dream reads.
Option 3: a server that runs it for you
A PlayNHost nanobot server does the steps above for you. nanobot runs on our AI agent plans (2, 4 or 8 GB), chosen under Which agent when you order.
Under AI provider, press Set on one key (OpenAI, Anthropic, Google Gemini, xAI or OpenRouter), paste it and press Save. One key is enough.
Under Chat apps, set the Telegram bot token (from @BotFather: /newbot, then copy the token), the Discord bot token (Discord Developer Portal, Bot, Reset Token, with Message Content Intent on), or both. Each row then shows only the last four characters; keys and tokens are stored encrypted and never shown again.
Under Who can message it, enter your Telegram user IDs or Discord user IDs and press Save. For Discord, turn on Developer Mode in your Discord settings, right-click your name and choose Copy User ID.
Press Start. The first start installs nanobot, which took 34 to 49 seconds in our tests. When it is up, the console says:
[PlayNHost] Starting nanobot 0.4.1
[PlayNHost] Your agent is running
[PlayNHost] Telegram: only user 123456789 can message your agent.
Send your bot a message. Your agent answers you, and only you.
Not sure of your Telegram ID? Leave the field empty, start the agent and send your bot a direct message. nanobot replies with a pairing code: ignore it, pairing does nothing here. The console then shows your ID:
[PlayNHost] Telegram user 123456789 messaged your agent and was ignored. If that is you, add 123456789 to the Telegram user IDs on the Agent page, then restart.
Put the number on the Agent page and press Restart now. The same line appears for anyone else who messages your bot, with their ID: do not add IDs you do not know.
Model: with no model chosen, your agent uses a current model of the provider whose key you set. To choose one, enter its name in AI model under Code, Settings.
Updates: every start updates nanobot to the newest release in the line PlayNHost has checked (0.4 today), which takes a few seconds when there is nothing new; a new line such as 0.5 waits until we have reviewed it. If an update fails, the version you have starts. You can turn this off with Update nanobot on every start under Code, Settings.
Restarts: an in-chat /restart starts the agent again on its own, and if it stops by itself the panel starts it again within about a minute. Under Restarts you can also schedule a daily restart.
Safety: only the user IDs on the Agent page can use the agent; nothing on the server listens on the internet; WhatsApp and every chat app other than Telegram and Discord are switched off; nanobot's settings file holds only references to your keys, and the console hides keys and tokens. If a setting opens the agent to other people, approves someone by pairing, starts another chat app or opens a port while it runs, the server stops the agent, and the next start puts your settings back.
Background jobs: heartbeat, Dream and idle-chat summaries run as described above, on your own model key. You can turn them off in .nanobot/config.json in Files.
What you give up compared with your own server: no WebUI, no nanobot command line, only Telegram and Discord, and one agent per server. You can still edit the agent's files in Files or over SFTP, and backups keep its settings, memory and sessions.
Own server or hosted: which to pick
Your own server
PlayNHost
Setup
Install, wizard or config file, systemd user service with lingering
Paste a key, a token and your ID, press Start
Updates
You run them with your install method
Newest release in the line we have checked (0.4) at every start; can be turned off
Chat apps
All that nanobot supports
Telegram and Discord
WebUI and command line
Yes
No
Access and ports
Yours to set and keep
Your IDs only and no open ports, checked at every start and while it runs
Memory
Your choice; about 154 MiB at rest in our test
2, 4 or 8 GB plans
Our judgment: run it yourself if you want the WebUI, other chat apps or nanobot's command line, or you already keep a Linux server; pick hosted if you want a Telegram or Discord agent without the upkeep. nanobot itself is free and MIT-licensed either way: a host charges for the server, and your AI provider for the model. Next: create a nanobot server.
PlayNHost is not affiliated with the nanobot project or HKUDS. nanobot is open-source software under the MIT licence.
We use cookies to keep the site working, to understand how it is used, and to measure our marketing. You can accept all, accept essential cookies only, or choose per category.We use cookies to keep the site working, to understand how it is used, and to measure our marketing. They are on by default here. You can switch off anything you do not want.Read our privacy policy