PM2 — OpenClaw Glossary
A process manager for Node.js applications. It runs programs in the background, automatically restarts them if they crash, and ensures they start up again after a server reboot.
On this page
PM2 ek background manager hai. Jab aap SSH se VPS par log in karke OpenClaw start karte ho, toh SSH band karte hi woh band ho jata hai. PM2 usko background mein 24/7 chalata rehta hai. Agar bot crash ho jaye ya server reboot ho jaye, toh PM2 usko automatically wapas start kar deta hai.
What is PM2?
PM2 is an advanced process manager for Node.js applications (like OpenClaw). It allows you to keep applications alive forever, reload them without downtime, and easily manage logging.
Without a process manager, any program you start in an SSH terminal will be killed the moment you disconnect from the server. PM2 detaches the program from your SSH session and runs it as a background “daemon.”
Why it matters for OpenClaw
For your Telegram or WhatsApp bot to reply at any time of day, the OpenClaw Gateway must be running 24/7. PM2 provides this continuous uptime. It also offers two critical features:
- Auto-restart on crash: If OpenClaw encounters a fatal error and stops, PM2 will instantly restart it.
- Startup persistence: You can configure PM2 to automatically start OpenClaw whenever your VPS boots up (like after a hosting provider maintenance window).
Common mistake
Running PM2 as root.
Many beginners install PM2 globally using sudo npm install -g pm2, which is fine. However, they then run pm2 start openclaw while logged in as the root user. This means the OpenClaw Gateway process runs as root.
If the Gateway runs as root, any shell execution tools enabled for the agent will also run as root. The agent (or anyone who exploits it) could wipe your server, change passwords, or install malware.
Fix: Always log in as a standard user (e.g., clawuser) before running pm2 start.
Related guides
ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.