Setting Up OpenClaw on DigitalOcean



Quick summary: I set up OpenClaw on a DigitalOcean droplet ($18/month). The basic install went smoothly, but connecting WhatsApp broke everything and I had to rebuild from scratch. The culprit? Mismatched gateway tokens between the root and openclaw user configs. Once aligned, WhatsApp connected first try. Total time: ~10 hours across multiple sessions. Worth it if you want to explore this intriguing new technology and you’re comfortable with Linux troubleshooting.



I wanted to experiment with OpenClaw as I’d heard all the hype and it sounded interesting, like it could be something I could use in my job as a web developer.

For those unfamiliar, OpenClaw is an open-source AI agent that runs on your own hardware, giving you a personal assistant with access to your files, terminal, and various communication channels.

After watching a few YouTube videos on the subject I settled on trying to set it up on DigitalOcean using their “Droplet” technology.

installing openclaw on a digitalocean droplet

I decided to do it on the cloud as I was away from home for a month and I was keen to get started, and I chose DigitalOcean as I’d used them before and knew them to be a genuine company unlike some of the other one-click solutions who I’d never heard of.

Also DigitalOcean seemed to have put into place some extra security features, security having been mentioned as an issue by a lot of the reviewers and sceptics of OpenClaw.

And DigitalOcean has a pay as you go billing whereas some of the one-click installs promoted on YouTube videos tie you in for two years!

The Process

First Mistake

The first thing I learned was that I would need an API key to connect OpenClaw to whichever LLM(s) I wanted to use. So I upgraded my free Anthropic Claude plan to the Pro Plan, after paying for a year in advance I learned that you don’t get an API key with a Pro Plan! Doh!

To get an Anthropic API key you need to get a Claude Console account at https://platform.claude.com/. This isn’t a subscription, you buy credits and then the credits are used up as you make calls to the API.

But then, after watching a few more YouTube videos on the subject it seemed that Anthropic weren’t fans of their LLM being used for OpenClaw and there were instances of accounts being banned!

As of this writing though I’m still using their API and it is still working. But I will be looking into using other Frontier Labs API’s in the near future, and that’ll probably be OpenAI as they have just hired the creator of OpenClaw Peter Steinberger

Setting Up The Environment

DigitalOcean has a straightforward process for setting up a droplet, and it has a specific OpenClaw droplet that you can install.

First you choose what resources you want to use. I chose 2GB, 2 CPUs, 60GB SSD Disk and 3 TB transfer for $18/month.

I chose my server to be in London as I’m based in UK.

Under Marketplace I chose the “OpenClaw 2.12 on Ubuntu” image.

The description of this image told me: “With DigitalOcean’s hardened 1-Click deployment, developers can run OpenClaw with secure defaults in their Droplet as an always-on AI assistant with strong security controls, usage-based inference, and predictable operations”

You then follow the set up instructions: https://marketplace.digitalocean.com/apps/openclaw#getting-started

The instructions are very good, and have a very useful troubleshooting guide. But with operations like this there is always the opportunity to not quite follow the instructions properly…

Slight confusion

There is a stage where during a “pairing process” you are pairing the OpenClaw gateway from the command line with the web user interface, you’ll do this on the command line:

Do you want to run pairing automation now? (yes/no): y
Proceeding with pairing automation…

You’ll then be directed to “open UI dashboard in your browser to trigger pairing process.” And you will be given your dashboard URL, and the following instructions:

When the dashboard prompts for authentication:
1. Open the Overview panel in the sidebar
2. Paste your gateway token: [a-token-string-you-were-given-earlier]
3. Click ‘Connect’ button

In the web UI interface I saw this: “disconnected (1008): pairing required”

I thought something had gone wrong, but it hadn’t. That was what you are supposed to see though that wasn’t clear. It simply said; “You will see a pairing request dialog - this is expected.”. I was expecting a dialog box, not just some text.

There isn’t a problem just click continue in the command line, and you are good to go.

You can start chatting with the chatbot.

Second Mistake

One of the touted features of OpenClaw is that you can communicate with it via popular communication apps like WhatsApp, Telegram and Slack etc. These aren’t features I thought I’d use much, at least not to start with, but was intrigued to see how easy it would be to set up and what it would be like chatting via one of them. I decided to have a go at setting up WhatsApp. This is where things went seriously astray!

To summarise:

The WhatsApp connection didn’t work. I worked with the chat agent, who I named Fred to try and resolve the issue. We sussed out between us that the problem was something to do with the “gateway” or gateway tokens. Fred made suggestions of things to try, nothing worked, and then he suggested killing one of the processes, that broke the whole system! I could no longer talk to Fred!

I had to start the whole install process again!!! I’ve worked in IT for a while, I know that this happens and is inevitably part of the process.

With DigitalOcean droplets you can rebuild your droplet (it keeps the same ip address but wipes everything else). Click destroy first but then you get the option to rebuild. That process wasn’t as straight forward as I was hoping as had to reset the password, it gets sent by email, but then that doesn’t work! So have to “Boot from a recovery ISO”…. There is documentation but you need to be comfortable messing around with this sort of stuff.

So long story short got back to a working OpenClaw again and reinstated Fred, but unfortunately Fred had lost his memory, which I found sad (that’s going to be a whole other post on how we are going to relate to our AI agents when we have gone through a traumatic experience like setting up OpenClaw together!). I instructed Fred to take more care remembering stuff from now on, which he promised to do.

So then we can attack the gateway problem again, hopefully without breaking the system this time.

The Fix

The solution was something like this:

1. Install systemd service

openclaw gateway install

This auto-generated a gateway auth token and created the systemd service.

2. Enable auto-start on boot

systemctl --user enable openclaw-gateway.service
sudo loginctl enable-linger root

3. Align tokens between users

The gateway runs as user openclaw, reading from /home/openclaw/.openclaw/openclaw.json

Root’s config is at /root/.openclaw/openclaw.json

Get the token from one:

openclaw config get gateway.auth.token

Set matching tokens for the openclaw user:

sudo -u openclaw openclaw config set gateway.auth.token <token>
sudo -u openclaw openclaw config set gateway.remote.token <token>

4. Restart gateway

sudo -u openclaw openclaw gateway restart

5. Take a DigitalOcean snapshot (safety net)

The DigitalOcean snapshot was taken in case we broke the system again trying to connect WhatsApp. But we didn’t this time, we followed the standard instructions, and it worked, hallelujah!

Conclusion

Setting up OpenClaw on a DigitalOcean droplet could be straight forward if everything goes as it should do but be prepared for things to go wrong and having to do problem solving. But thanks to AI problem solving, particularly for technical issues like this, has got easier with agents able to guide you through things to try, they’ve read all the manuals and FAQs and are a font of knowledge, not always accurate but for the most part very helpful.

Times taken
General web browsing research 2 evenings
Research and registering domain name 10 minutes
First install + initial poking around and playing 4 hours 40 minutes
Rebuilding after breaking the system trying to connect to WhatsApp 3 hours

Comments

Please let us know what you think.