DISCLAIMER!!: DO NOT INSTALL OPENCLAW ON YOUR PERSONAL MACHINE. IT IS STRONGLY RECOMMENDED THAT YOU USE A VIRTUAL MACHINE OR A VIRTUAL PRIVATE SERVER INSTEAD.
Prerequisites
Before you begin, ensure you have the following:
- A Virtual Private Server (VPS) or Virtual Machine with:
- Node.js version 22.16 or later installed
- Git installed
- A Telegram account (or another supported messaging platform)
- An API key for the AI model of your choice
Introduction
What is OpenClaw?
OpenClaw is a self-hosted gateway that connects your favorite messaging applications such as WhatsApp, Telegram and Discord, to your AI coding agents like Chat GPT.
OpenClaw allows you to chat directly with your AI model using your messaging app and have it do tasks for you.
How does it do tasks for you?
With OpenClaw, you can create Agents(action models) that use your AI model to perform task for you.
Step 1: Set up a VPS(Virtual Private Server)
Using a cloud platform of you choice, set up a server/ virtual machine.
In my case, I have setup my server on the Microsoft Azure platform.
Step 2: Access your VPS via SSH(Secure Shell) using terminal
From your machine, launch a terminal such as Git-bash, Powershell or in my case Mobaxterm.
Use the command username@ip-address to connect to your server. You will be prompted for a password, provide it and then you will successfully have accessed your cloud server.
Step 3: Security
The reason it is advised that you run OpenClaw on a VPS or a machine that does not have any of your personal information is because: 1) The software is opensource meaning that it has anyone contributing to it's development including anyone with malicious intent. 2) OpenClaw requires elevated privileges on your machine as it interacts deeply with system memory or processes.
Click on the link to connect tailscale to the virtual machine
Install Tailscale
Run the command above to start tailscale. You will be given a link to signup to tailscale
Login or create an account if you do not have one
Choose the identity provider of your choice.
Look for the tailscale icon on your apps tray and click on it. It will redirect you to a login screen. Login using your credentials and then click the connect button.

You will get success and now you are now connected to a virtual private network.
Navigate to the following file sudo nano /etc/ssh/sshd_config
Copy the tailscale IP given to your server by tailscale

Make the above changes to the file
Create a new user
Add user to root
restart ssh service using the above command then logout the server using the logout command.
Access the server using the new username and the new tailscale IP address
With this, we have secured the server such that no other traffic can reach it other than devices on the this tailscale VPN network. Our server is secure.
Step 4: Install OpenClaw
Run the above command to install OpenClaw
Choose what you want to setup as local gateway.
Then select the workspace directory as the default provided one.
Select a model provider that you want OpenClaw to use. Remember that to use the model, you will need an API key from which in many instances you are required to have a paid subscription.
In my case, I am using OpenRouter, a website that allows you to connect to free available AI models out there.
After choosing the model, you will be prompted to provide an API key. Paste the API key that you generated from OpenRouter.
Then you will need to choose a default model under OpenRouter. There is a long list, scroll until you find your chosen model.
From OpenRouter, I am using a model known as StepFun 3.5 Flash. I chose it because I found it to have the best starts compared to the other available opensource models.
For gateway port and gateway bind, leave them as default. For the gateway auth, choose token.
For tailscale exposure leave as off, then on how to provide gateway token choose the generate/store plaintext token option then leave the gateway token blank.
Channel status; this is the social media application that you want to use to communicate with your model. Select yes to configure a channel.
Select a channel. For me, I will be using Telegram. OpenClaw then gives a small guide on how to obtain a Telegram bot token that you can use.
Open your Telegram application and search for BotFather. Select the account "BotFather" with a tick mark (It's the Legitimate one).
In the chat with BotFather, type /newbot to create a new bot. The username has to end with the word 'bot'. After choose a unique username, you will get the link to start a chart with the new bot you have created and also an API key (which you can enter in OpenClaw).
Enter the API key and when prompted to select a channel, scroll down and choose finished (the last option in the list).
When prompted for DM access policies select yes and pair with telegram.
For web search, choose a browser that you would like the agent to access and use for browsing (I recommend using a new browser that you don't use for any of your personal activities/browsing). Then on your browser of choice get an API key and add it to OpenClaw.
For configuring skills, select 'No'. You can configure skill later after the setup is complete.
What are skills in OpenClaw?
OpenClaw skills are plug-ins/additions for an OpenClaw AI agent: each skill teaches the agent how to do a specific task, such as searching the web, sending emails, controlling software, or running a workflow. Instead of the AI only chatting, skills give it extra abilities and step-by-step instructions so it can actually perform useful actions.
For hooks, choose, skip for now and for systemd lingering, choose enable.
For install gateway service, select yes and service runtime select the recommended 'Node' option. OpenClaw will install the gateway now.
After the gateway is installed, the agent will now be alive.
It will start asking questions such as the name to call it and what you want it to be. Provide the answers. This information is stored in a file BOTSTRAP.md this file defines what the agent is. Every time it starts, it reads this file to know/remember who it is.
It will then ask questions about you. This information is stored in USER.md, this tells the agent who you, the user is. Eg. It tells the agent to address you as (the name you want it to call you) and any other information you want it to know about you.
It then proceeds to ask about what behaviour you want it to have. This information is stored in a file SOUL.md, it gives the agent a character. I chose to stop there as this information can be added directly to the files directly i.e USER.md, SOUL.md, skills.md ... Type /exit to leave the interactive cli.
To access bot via telegram, press the link provided by BotFather as shown here and it will take to the inbox chart of your bot.
After getting to the inbox chart of your bot, type /start to start the bot. It will give you a pairing code to use to connect the bot to OpenClaw.
Run the command openclaw pairing approve telegram <your pairing code> to connect your telegram bot to OpenClaw. If you get an error "command not found" as I did.
Locate the file openclaw on your host and navigate to that location. As shown, this is the location my file was at.
From the location of you file, execute the command and the connection to telegram will be approved.
And now we can chat with the bot from your telegram
If you want to access openclaw via web, run the command ssh -N -L 18789:127.0.0.1:18789 user@serverIP. This command maps the exposed port on our VPS to our local machine.
Note: The server and your local machine have to be in the same network. And how is this possible, using the tailscale configuration that we deed. By activating tailscale on both the VPS server and your local machine, tailscale creates secure network and adds both your machines into that network. This implements security as well as enables your machine to access the VPS server seamlessly.
Now you are able to access openclaw on your machine, but this gives you an error.
To solve it, navigate to the file openclaw on your host, run the following command ./openclaw dashboard --no-open. OpenClaw will give you a URL with a valid token. Paste the URL on your web browser. You will redirected to a tailscale website and prompted to login. Login, this authenticates you connection to OpenClaw using tailscale ( a security measure).
Now you are able to access the openclaw UI from your web browser. Here you can have a UI interface to configure your agent instead of using the cli/terminal interface.
Conclusion
This guide demonstrated how to install OpenClaw on a Virtual Private Server, secure the instance with Tailscale, obtain an API key for an open-source AI model through the OpenRouter platform, and connect everything to a Telegram bot as the communication channel for the AI agent. With this foundation in place, the next step is to equip your OpenClaw agent with the skills it needs, enabling it to perform specific tasks and automate real workflows.
This article served as an introduction to help you get started with OpenClaw and prepare you to build a more capable, customized AI agent. Happy building with OpenClaw, and enjoy creating an AI agent tailored to your own needs and ideas.





Top comments (0)