What you are setting up
OpenClaw is a self-hosted assistant that connects a language model to tools and messaging channels. A gateway process runs on your server, listens locally for its control interface and talks to the chat apps and model providers you configure. Because the assistant can act through its integrations, treat it like a user account with real permissions, not like a website.
The model usually runs at a provider, so the server needs memory for the gateway and its tools, not for the model. Our application page suggests planning for about 8 GB if you use browser or command tools, and a small test can run on less. Check the project's current requirements before you choose a plan.
free -h
nproc
df -h /Create a dedicated user
Run the assistant as its own account, not as root and not as your main administrator. If the assistant is ever tricked into running something, it can then damage only what that account owns. Give the account no sudo rights.
sudo adduser --disabled-password --gecos "" openclaw
sudo loginctl enable-linger openclaw
sudo -iu openclawsudo useradd -m openclaw
sudo loginctl enable-linger openclaw
sudo -iu openclawInstall it
The project's installer detects your system, installs a supported Node.js release if one is missing, installs OpenClaw and starts onboarding. Download the script and read it before running it, rather than piping it straight into a shell. Run it as the openclaw user.
The current documentation asks for Node 26 (recommended) or a recent Node 24 release. The installer handles this for you.
curl -fsSL https://openclaw.ai/install.sh -o openclaw-install.sh
less openclaw-install.sh
bash openclaw-install.shComplete onboarding
Onboarding asks which model provider to use and stores the credentials, then helps you connect a channel. Use a provider key created just for this assistant, with a spending limit if your provider offers one, so you can revoke it without affecting anything else. If the guided screen is awkward over SSH, the classic step-by-step flow is available.
openclaw onboardRun the gateway as a service
Install the gateway as a background service so it starts at boot and restarts after a failure. It is installed as a systemd user service, which is why linger was enabled earlier. Check the status, then confirm that it listens only on the loopback address.
openclaw gateway install
openclaw gateway status
openclaw doctorss -lntp | grep 18789Keep the control interface private
The control interface is served on 127.0.0.1 port 18789 by default, which keeps it off the internet. Leave it that way. The gateway also requires authentication by default, using a token or password that you set in its configuration or environment. From your own computer, reach it through an SSH tunnel, then open the address in your browser. A tunnel does not replace the gateway's own login.
ssh -N -L 18789:127.0.0.1:18789 deploy@YOUR_SERVER
# then open http://127.0.0.1:18789/ in your browsersudo ss -lntp | grep -v 127.0.0.1Limit who can talk to it and what it can do
The configuration file is ~/.openclaw/openclaw.json. For each messaging channel, list the exact accounts allowed to message the assistant, and require a mention in group chats so it does not react to everything. Start with one narrow job and add tools one at a time, checking each integration before you give it credentials. Keep model-provider keys separate from keys that change your own systems, and write down how to revoke each.
{
channels: {
whatsapp: {
allowFrom: ["+15555550123"],
groups: { "*": { requireMention: true } },
},
},
}Operate it
Use the status and log commands to watch it, and restart after configuration changes. Review the logs from time to time for unexpected activity, and check your provider's usage page for spending you did not expect. Keep OpenClaw updated, because assistants that talk to the internet receive security fixes often, and read the release notes before you update.
openclaw gateway status
openclaw logs --follow
openclaw gateway restartopenclaw --version
curl -fsSL https://openclaw.ai/install.sh -o openclaw-install.sh && less openclaw-install.shOfficial documentation
These upstream references provide more detail on the commands and workflows in this guide.