A hand-held setup guide for running OpenClaw on an Ubuntu server and connecting it to Telegram.
This is for people who want a private, always-on AI assistant but feel a bit daunted by servers, SSH, API keys, and command-line setup.
In many setups, the VPS costs more than the model usage. A cheap model can cost pennies or a few dollars a month for light personal use.
If you are using Hostinger, you can use this referral link for a 20% discount:
Referral note: you get a discount, and I may receive a discount or account credit too. Let's save money together.
Open Terminal on Mac/Linux, or PowerShell on Windows. Replace YOUR_SERVER_IP with your VPS IP address.
ssh root@YOUR_SERVER_IP
What success looks like: you should see a server prompt, usually something like:
root@your-server:~#
If you see Permission denied, check that you used the right IP address, username, password, or SSH key.
This refreshes Ubuntu's package list, installs security updates, allows SSH, and turns on the firewall.
apt update apt -y upgrade ufw allow OpenSSH ufw --force enable
What success looks like: the update finishes without errors and ufw says the firewall is active.
OpenClaw runs on Node.js. This installs Node.js 22 and then installs OpenClaw globally.
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get install -y nodejs npm i -g openclaw
What success looks like: this command should print a version number:
openclaw --version
The wizard asks for your model provider, API key, and basic assistant settings.
openclaw onboard
If you are unsure, start with the provider and model you already have credits for. OpenAI is the most familiar option. DeepSeek and other OpenAI-compatible providers can be much cheaper for testing.
openclaw gateway start
Check whether it is running:
openclaw gateway status
What success looks like: the status command should show the gateway is running.
Create a Telegram bot with @BotFather. Copy the token, then run these commands on the VPS.
openclaw config set channels.telegram.botToken "YOUR_BOT_TOKEN" openclaw config set channels.telegram.enabled true openclaw gateway restart
What success looks like: message your Telegram bot. It should reply through OpenClaw.
If you restart the VPS, check whether OpenClaw comes back automatically.
reboot
Wait a minute, reconnect with SSH, then run:
openclaw gateway status
If it is not running, start it again:
openclaw gateway start
Check the IP address, username, password, or SSH key. Many VPS providers also have a browser console you can use as a fallback.
The install did not finish, or npm's global bin folder is not on your path. Try reconnecting to SSH first, then run openclaw --version again.
Check that the token is correct, Telegram is enabled, and the gateway was restarted after setting the token.
Common causes are no API credits, a revoked API key, the wrong model name, or a provider endpoint that does not match your key.
That usually means Ubuntu installed updates that need a reboot. Reboot when convenient, then check OpenClaw status again.
If you are experimenting, it helps to know how to undo things. Before deleting anything, back up any config you want to keep.
openclaw gateway stop npm rm -g openclaw
If you created extra services, bot files, or custom systemd units, remove those separately. Do not delete files unless you know what they are.
Your assistant should now be running on your VPS.
Next useful steps: test Telegram, check costs after a day or two, and keep your API keys private.