How to Run OpenClaw on a VPS Safely
In this article9 sections
A VPS keeps an OpenClaw Gateway running when your laptop is off, but the server needs careful access controls. The Gateway can connect messages to an AI agent and tools, so a public admin interface or a shared set of credentials can give strangers more access than intended. Start with a private Gateway, decide how you will connect to it remotely, and only then add channels and tools.
This guide covers the server and security decisions that matter before exposing an OpenClaw instance. If you would rather begin with a server prepared for the application, see Siteharbour OpenClaw VPS hosting and confirm which setup tasks are included before ordering.
Decide where the model will run
OpenClaw’s Gateway coordinates sessions, tools and connected channels. The language model may run through an external provider or on the same server. That choice changes your resource needs more than the name of the VPS plan does.
- External model API: the VPS runs the Gateway and supporting services while inference happens with the provider. Estimate server resources for the Gateway, enabled tools and number of sessions.
- Local model: the server also stores and runs model weights. Memory, CPU and possibly GPU needs rise quickly with model size. Plan local inference as a separate workload and do not assume a small automation VPS can handle it.
- Mixed use: the Gateway can use a hosted model while calling other services or a separate model server. Keep secrets and network access limited to what each workflow requires.
OpenClaw’s resource needs depend on the installation method, extensions, channels and model choice. Check its current VPS documentation before selecting a server, especially if building from source or running a local model.
Keep the Gateway private by default
A regular host installation binds the Gateway to the loopback interface by default. That means it listens for connections from the server itself, rather than accepting direct public traffic. Keep that default for initial setup. For administration from your computer, use an SSH tunnel or a private network such as Tailscale instead of opening the Gateway port to everyone.
The OpenClaw Gateway commonly uses port 18789. A service that needs to stay private should not have a public firewall rule for that port. If you intentionally configure remote access, follow the official remote access guide and exposure checklist for the selected topology.
Warning. Do not publish the Control UI or Gateway to the open internet without authentication and a deliberate access design. A secret URL is not an access-control plan.
Choose a VPS and operating system
Use a current supported Linux release and enough storage for the operating system, OpenClaw state, logs and any files your agent will handle. If you use a hosted model, start by checking the current OpenClaw installation guidance and observe memory during normal sessions. If you run local inference, size the model host for the model first; keeping it on a separate GPU-capable machine can make it easier to manage the Gateway independently.
Before provisioning, decide:
- Which person or trusted team will administer the Gateway.
- Whether anyone else can message the agent or use its tools.
- Whether it needs access to a browser, shell, files, APIs or private networks.
- Where model and channel credentials will be stored.
- How you will patch the server and restore the application state.
For general SSH, firewall and Linux preparation, use the Ubuntu VPS security checklist before installing application services.
Set up channels and device approval carefully
Pair only the devices and messaging accounts you intend to use. Keep direct-message access limited to known senders, and use allowlists or pairing instead of accepting requests from everyone. For a group channel, decide whether the agent should respond only when mentioned and which members are trusted to trigger actions.
One Gateway is a shared trust boundary: all users who can reach it may be able to interact with the same configured tools and credentials, depending on the setup. If users should not share data or capabilities, separate them across distinct instances or hosts rather than relying on a group chat to provide isolation.
Give the agent only the tools it needs
Start with the smallest tool profile that can do the intended job. If the agent only needs to answer messages, do not enable shell access. If it needs to read a folder, grant access to that folder instead of the whole server. Keep elevated or high-impact actions disabled or approval-gated while you are learning how the workflows behave.
Pay particular attention to content that comes from outside your team. Emails, web pages, attachments and chat messages may contain misleading instructions. An agent with broad tool access can act on data that a human would normally treat as untrusted, so keep permissions narrow and review consequential actions before allowing automation.
OpenClaw provides security checks for risky configuration. Run openclaw security audit after installation and after changing exposure, authentication, channels or tool permissions. Review and fix critical findings before letting real users interact with the Gateway. The official security guide explains the trust model and recommended defaults.
Protect credentials and state
- Use a separate API key for the agent and restrict it to the needed service and budget.
- Store Gateway tokens and channel credentials in the supported secret mechanism; do not paste them into a public web page or support post.
- Keep the configuration and workspace files private to the operating-system account that runs OpenClaw.
- Do not reuse a personal browser profile or password-manager session on a server shared with other people.
- Rotate a token if it is exposed, and review the audit logs for unusual access.
Provider API keys can create usage charges and may allow access to your account. Protect them like passwords. If a local model is used, check that logs and prompts do not retain information longer than you expect.
Plan updates, monitoring and backups
Keep OpenClaw and the operating system updated, but do not apply application changes blindly to a production Gateway. Read release notes, back up the configuration first and test that the Gateway starts, pairs devices and reaches the intended model after an update.
Back up the OpenClaw configuration, workspace data and any state required to reconnect channels. Keep an encrypted copy outside the VPS, limit who can restore it, and test a recovery on a spare instance. Monitor service health, disk space and logs; a process being active does not prove that messaging and model connections still work.
Before opening remote access
- Confirm the Gateway remains on loopback unless you have chosen an authenticated private access method.
- Check the firewall and verify that the Gateway port is not publicly reachable.
- Pair one trusted device and test the connection end to end.
- Run the security audit and review the tool profile, sender access and group behavior.
- Confirm configuration backups exist and that you can restore them.
- Write down how to revoke a device or rotate credentials if access needs to be removed quickly.
If you need an always-on server but do not want to handle the initial Linux and application setup alone, review the OpenClaw VPS option. Confirm the model arrangement, Gateway access method and included support before choosing a plan.
Frequently asked questions
Can OpenClaw run on a VPS?
Yes. OpenClaw documents Linux server and VPS deployments. The right plan depends on whether the server runs only the Gateway or also a local model and other tools.
Should I open port 18789 to the internet?
Usually not. Keep the Gateway private and connect over SSH or a private network. If you require direct remote access, use the official security guidance to configure authentication, network restrictions and the Control UI correctly.
Can several people share one OpenClaw Gateway?
Only if they share a trust boundary and should be able to use the same configured agent tools and credentials. Separate instances are safer when the users should not have access to one another’s sessions or capabilities.
Do I need a GPU?
Not if OpenClaw uses a hosted model API. A local model may benefit from a GPU, and its memory requirements depend on the model and workload. Check the model’s own hardware guidance before planning the server.