Service Issues
Service won't start or keeps stopping
Service won't start or keeps stopping
The most common causes are:If the service still won’t start, check the logs:
- Missing environment variables - The service needs
PATHandTMPDIRset explicitly - Termux wake lock not enabled - Android kills background processes without it
- Service daemon not running - The runit supervisor needs to be active
Service stops when Termux is closed
Service stops when Termux is closed
This is caused by Android’s aggressive battery optimization killing background processes.Solution:
-
Enable wake lock (required for background operation):
-
Disable battery optimization for Termux:
- Go to Android Settings > Apps > Termux
- Battery > Unrestricted (or “Don’t optimize”)
-
Keep a persistent session (optional but recommended):
Wake lock must be re-enabled after device restart. Consider adding
termux-wake-lock to your ~/.bashrc.Web UI not accessible at localhost:18789
Web UI not accessible at localhost:18789
Possible causes:If the service is running but UI still won’t load:
- Service isn’t actually running
- Wrong port or binding address
- Onboarding not completed
Installation Errors
Permission denied errors during installation
Permission denied errors during installation
Error message:orCause: Hardcoded
/tmp paths that don’t exist or aren’t writable in Termux.Solution:The setup script automatically patches this, but if you installed manually:Node-GYP compilation failures
Node-GYP compilation failures
Error message:orCause: Node-GYP expects Android NDK environment that doesn’t exist in standard Termux.Solution:
Cannot find module errors after installation
Cannot find module errors after installation
Error message:Cause: PATH not set correctly, or npm global installation failed.Solution:
Update broke the installation
Update broke the installation
Symptom: Everything worked before Or manually re-apply the patch:
npm install -g openclaw@latest, now service won’t start.Cause: Updates overwrite the critical /tmp/openclaw path patch in entry.js.Solution:Use the safe update script instead of direct npm install:Service Management
How to check service status and logs
How to check service status and logs
Check if service is running:Output meanings:View all logs:Basic service commands:
run: openclaw: (pid 12345) 123s- Running normallydown: openclaw: 5s- Stoppedrun: openclaw: (pid 12345) 1s; run: log: (pid 12346) 1s- Just started
Service daemon commands not found
Service daemon commands not found
Error message:Cause:
termux-services package not installed, or SVDIR not set.Solution:Getting Help
If you encounter an issue not covered here:- Check the logs - Most errors are logged to
$PREFIX/var/log/openclaw/current - Review environment variables - Run
env | grep -E 'TMPDIR|PATH|SVDIR' - Verify installation - Run
npm list -g openclaw - Check service setup - Run
ls -la $PREFIX/var/service/openclaw/