How I Run a 24/7 AI Assistant on a Small VPS (and the Mistakes That Broke It)

·

How I Run a 24/7 AI Assistant on a Small VPS

I have a personal AI assistant called Socrates. It runs all day on a small rented server, remembers what I tell it, and answers me on Telegram and WhatsApp. It cost me an evening to set up and a few nights to fix. This is the honest version of how it works, including every mistake that broke it.

Key takeaways

  • An open-source agent in Docker on a small VPS can be your 24/7 assistant.
  • Telegram is the easiest channel; WhatsApp works best with a dedicated number.
  • Most problems come from running two copies, port conflicts and wrong settings.
  • Keep the data volume safe: it holds the assistant’s memory and sessions.

Why run your own assistant at all?

Hosted AI apps are great, but they live in a browser tab and forget the rest of your life. A self-hosted assistant sits where you already talk all day, in your messaging apps, and it can be connected to your own tools: your server, your calendar, your notes. You also choose the model and control the cost, which matters when you use it every day.

The trade-off is responsibility. You are the IT department. If that sounds fun rather than scary, keep reading.

What the setup looks like

  • The server: a small Linux VPS. Mine is on Hostinger. Any provider with Docker works.
  • The assistant: Hermes Agent, an open-source agent from Nous Research. It has memory, skills and a messaging gateway.
  • The brain: AI models through OpenRouter, one API key for many models, including free ones.
  • The doors: a Telegram bot and a linked WhatsApp account, so I can reach it from my phone anywhere.

The same server also runs other projects in their own containers: a CMS and its database, an automation tool and a couple of web apps. Containers keep them from interfering with each other, which turned out to matter a lot.

Step 1: Run the agent in Docker

Running the assistant inside a Docker container keeps it separate from everything else on the server. Some hosts, including Hostinger, offer a ready-made template that installs it for you.

The important part: the container must store its data in a persistent volume. That volume holds the assistant’s memory, settings and messaging sessions. If you delete it, your assistant forgets everything. When you clean up your server, never prune Docker volumes unless you know exactly what is inside them.

Step 2: Connect Telegram

Create a bot with BotFather, paste the token into the agent’s settings and restart. Telegram is the easiest channel to start with: no phone number, no ban risk, and it works on every device. One rule: a bot token can only be used by one running instance at a time.

Step 3: Add WhatsApp

Hermes connects to WhatsApp by acting as a linked device, the same way WhatsApp Web does. You run the pairing command, scan a QR code from WhatsApp, Settings, Linked Devices, and the assistant appears in your device list.

You choose between two modes. Self-chat means you message yourself on your own number. Bot mode means the assistant has its own number and you message it like a contact. Bot mode is cleaner and safer, because unofficial WhatsApp bots carry a small risk of account restrictions, and you do not want that risk on your main number.

Two practical tips: if the QR code will not scan, switch your terminal to a light theme, because some scanners struggle with light-on-dark codes; and you cannot scan a code shown on the same phone, so display it on another screen.

The mistakes that broke it

1. Two copies of the same assistant

I installed a second copy of the agent directly on the server while the real one was running in Docker. Telegram immediately complained that two instances were polling the same bot. Worse, the new copy had an empty memory, so on WhatsApp my assistant suddenly forgot all my appointments.

Fix: run docker ps first, find the container that is your real assistant, and run every command inside it with docker exec. Remove any stray copy. Removing mine also freed several gigabytes of disk space.

2. A port already in use

The WhatsApp bridge wanted port 3000, but another app on the same server already used it. The bridge kept dying with a vague error. Inside a Docker container this problem disappears, because each container has its own network.

3. The wrong mode and the wrong number

The setup wizard asked for a mode and I typed a phone number instead, so it silently chose self-chat. Then the allowed-users list had a number with a plus sign the agent did not expect. Result: the assistant ignored me. Always check the final settings file after a wizard finishes, and restart after every change.

4. Paid models sneaking in

I used a free model for chat, but the logs showed a paid model being used for small background tasks. Check your logs for warnings about paid fallbacks and restrict background tasks to free models if cost matters.

What it is actually useful for

  • Capturing tasks and appointments by voice or text while I am busy.
  • Drafting replies, posts and quick research from my phone.
  • Checking on my server and websites without opening a laptop.
  • Turning a messy voice note into a clean to-do list.

One tip: an assistant only remembers what it saves to memory. Your chat history on Telegram does not automatically appear on WhatsApp. If something matters, tell it explicitly to remember it.

A simple maintenance routine

  1. Once a week, check docker ps and the assistant’s logs for errors.
  2. Once a month, update packages and clean unused Docker images, never volumes.
  3. Keep a backup of the data volume before any big change.

Frequently asked questions

Do I need to know how to code?

No, but you need to be comfortable copying commands into a terminal and reading error messages.

Is it safe to connect my main WhatsApp?

It works, but WhatsApp does not officially support third-party bots outside its Business API. Use a dedicated number if you can, and never use the assistant for bulk messaging.

Can I use free AI models?

Yes. OpenRouter lists several free models. They are slower or less capable than top paid models, but fine for notes, reminders and drafts.

Is it worth it?

If you are comfortable with a terminal, yes. A self-hosted assistant gives you control over your data, your costs and your tools. If you are not, start with a hosted assistant app and come back to this when you outgrow it.

Get one useful email a week

Tools worth trying, tactics that made money, mistakes to avoid. Free and short.