February 27, 2026
ai - claude - openclaw - vps - hostinger - devops - linux
6 minutes

Running Claude AI on a VPS with OpenClaw

How I set up a personal AI assistant running 24/7 on a Hostinger VPS using OpenClaw, with security controls and access from any machine.

Running Claude AI on a VPS with OpenClaw

I've been using Claude as my coding assistant for a while now, but the thing that always bothered me was: every new session starts completely blank. It doesn't remember what I was working on yesterday, what my preferences are, or the context of my projects. I wanted something that actually knew me and stuck around.

That led me to OpenClaw — a CLI that wraps Claude and gives it a persistent workspace, memory, tools, and the ability to connect to messaging platforms like Telegram. The idea is that instead of a chat interface that forgets everything, you get an agent that lives on a server, reads files, runs commands, and accumulates context over time.

So I set up a Hostinger VPS to host it and keep it running 24/7. Here's how I did it, what I set up for security, and how I access everything remotely.


Why a VPS instead of running it locally?

Running it on my laptop would mean the agent goes offline whenever I close the lid. The whole point is to have something persistent — an assistant that can run background tasks, receive messages on Telegram, and be available whenever I need it, even from my phone.

A VPS solves that. It's always on, it has a stable IP, and I can SSH into it from anywhere. Hostinger's KVM VPS plans are cheap enough that it's not a big deal, and the performance is fine for this use case.


Setting up OpenClaw on the VPS

After provisioning the VPS on Hostinger (I went with Ubuntu 24.04), the setup is straightforward. OpenClaw installs as a global Node.js package:

npm install -g openclaw

Then you configure it with your Anthropic API key and set up the gateway — which is the background service that keeps everything running:

openclaw gateway start

The gateway runs as a daemon and handles incoming messages, heartbeats, cron jobs, and session routing. You can check its status at any time:

openclaw gateway status

The workspace lives at ~/.openclaw/workspace/ and that's where the agent keeps its memory files, project files, tools, and everything it needs to maintain context across sessions.


Connecting it to Telegram

One of the things I liked most is that OpenClaw supports Telegram out of the box. You create a bot via BotFather, add the token to your config, and from that point on you can just message the bot from your phone and get responses from Claude — with full context of what you've been working on.

It's been genuinely useful for quick questions while I'm away from my desk. The agent remembers my projects, my preferences, and what we talked about last time.


Security: only giving access to what I want

This was important to me. The agent runs on my server and has access to my workspace files and can run shell commands. I didn't want it to have unrestricted access to everything.

OpenClaw handles this through a few layers:

Tool policies — you can whitelist exactly which tools are available. I have it set up so it can read and write files in the workspace directory, run shell commands, search the web, and use the browser — but actions like sending emails or posting publicly require explicit confirmation.

Workspace isolation — the agent's working directory is ~/.openclaw/workspace/. It operates within that boundary and I keep my sensitive files outside of it.

API key security — the gateway uses an API key for authentication, so even if someone discovers the port, they can't interact with it without the key.

Firewall — I use UFW on the VPS to only expose the ports I actually need. SSH is restricted by IP when possible.

The agent also has instructions in its SOUL.md file about what it should and shouldn't do — things like always asking before external actions, never exfiltrating private data, and using trash instead of rm so deletions are recoverable.


Viewing the logs

One thing I wanted to understand early on was how to see what the agent is actually doing. OpenClaw has a built-in log command that tails the gateway logs:

openclaw logs

For live streaming (following new output as it comes in):

openclaw logs --follow

You can also limit how many lines to show:

openclaw logs --limit 100

Or get raw JSON output if you want to pipe it somewhere:

openclaw logs --json

This shows you everything: incoming messages, tool calls the agent made, API responses, errors, and timing. Really useful for debugging when something goes wrong or you just want to see what it's been up to.


Accessing the VPS and dashboard from any machine

Since everything runs on the VPS, I need a way to manage it remotely. Here's how I do it from any machine with a terminal:

SSH into the VPS:

ssh your-user@your-vps-ip

If you set up SSH keys (which you should), no password needed.

Check the gateway is running:

openclaw gateway status

Restart the gateway if needed:

openclaw gateway restart

Tail the logs:

openclaw logs --follow

Open an interactive session with the agent:

openclaw chat

For the OpenClaw web dashboard (if you have the gateway exposed on a port), you can tunnel it securely over SSH without opening it to the public internet:

ssh -L 3000:localhost:3000 your-user@your-vps-ip

Then open http://localhost:3000 in your browser on the local machine. The tunnel forwards the port securely over SSH, so the dashboard is never directly exposed.

I also added a few shell aliases to my local ~/.bashrc / ~/.zshrc to make this faster:

alias vps="ssh your-user@your-vps-ip"
alias vps-logs="ssh your-user@your-vps-ip 'openclaw logs --follow'"
alias vps-status="ssh your-user@your-vps-ip 'openclaw gateway status'"

Is it worth it?

Honestly, yes. Having an AI assistant that:

  • Remembers my projects and context across sessions
  • Is reachable on Telegram from anywhere
  • Can run background tasks and cron jobs
  • Has access to my codebase and can make changes
  • Costs the same as the Claude API usage (no markup)

...is a genuinely different experience from using the web chat. The VPS costs a few euros a month on Hostinger and pays for itself in the first hour of saved time.

If you're already using Claude heavily, setting this up takes maybe an afternoon and you'll wonder why you didn't do it sooner.