Knowledge Base
0%
Intermediate ~25 min sudo required

Install OpenClaw with Cloudflare Tunnel

OpenClaw agent gateway exposed publicly via Cloudflare Tunnel with Zero Trust access control.

0 / 14 done

Prerequisites

  • Ubuntu server
  • Cloudflare account with a zone
  • Node.js installed
1
Step 1 Snippet

Update Ubuntu system packages


                            
2
Step 2 Snippet

Install essential CLI tools


                            
3
Step 3 Snippet

Set server hostname


                            
4
Step 4 Snippet

Enable UFW firewall with SSH


                            
5
Step 5 Snippet

Install Node.js via NodeSource


                            
6
Step 6 Snippet

Enable pnpm via Corepack


                            
7
Step 7 Command

Install and verify OpenClaw

pnpm add -g openclaw
openclaw --version
openclaw gateway start
openclaw gateway status
8
Step 8 Snippet

Install cloudflared


                            
9
Step 9 Snippet

Authenticate cloudflared with your account


                            
10
Step 10 Snippet

Create a named Cloudflare tunnel


                            
11
Step 11 Snippet

Route subdomain to tunnel (DNS)


                            
12
Step 12 Snippet

Generate cloudflared config.yml


                            
13
Step 13 Command

Configure Cloudflare Zero Trust Access

14
Step 14 Command

Pair the gateway token