ClawKit Logo
ClawKitReliability Toolkit

Fix: EACCES permission denied โ€” openclaw.json

File Ownership Mismatch

The gateway cannot write its config file because the process user doesn't own ~/.openclaw/. Most common in Docker when a volume is mounted with root ownership.

OpenClaw writes config atomically via a .tmp file. If it can't create that temp file, you'll see EACCES: permission denied. The gateway exits without saving any state changes.

Next Step

Fix now, then reduce repeat incidents

If this issue keeps coming back, validate your setup in Doctor first, then harden your config.

The Error

Error: EACCES: permission denied, open '/home/node/.openclaw/openclaw.json.7.2ede223b-aa90-4aa5-8f0d-97049696b626.tmp'
Error: EACCES: permission denied, open '/root/.openclaw/openclaw.json.tmp'
gateway failed to save config: permission denied

The UUID in the filename (.7.2ede223b-...) is a random temp suffix. The important part is that OpenClaw is trying and failing to write to ~/.openclaw/.

Fix A: Fix Ownership on Host (Docker โ€” Most Common)

If you're running OpenClaw in Docker with a bind mount, the host directory is often owned by root. The container process runs as UID 1000 (the node user), which can't write to a root-owned directory.

On the host machine, run:

Fix ownership on host
sudo chown -R 1000:1000 ~/.openclaw

Or if your openclaw data directory is elsewhere:

Fix ownership โ€” custom path
sudo chown -R 1000:1000 /path/to/your/openclaw-data

UID 1000 is the default for the node user in the official OpenClaw Docker image. If you built a custom image with a different UID, replace 1000:1000 with your container's user and group IDs.

Fix B: Set User in Docker Compose

A cleaner long-term fix is to tell Docker Compose to run the container as the correct user. This way ownership doesn't matter as long as the UID matches:

docker-compose.yml โ€” set user
services:
  openclaw:
    image: openclaw/openclaw:latest
    user: "1000:1000"
    volumes:
      - ~/.openclaw:/home/node/.openclaw

Then recreate the container:

Recreate container
docker compose down && docker compose up -d

Fix C: Bare Linux (Without Docker)

If you're running OpenClaw directly on Linux (not in Docker), the issue is usually that the config directory was created by a different user โ€” often root during a sudo install.

Check current ownership
ls -la ~/.openclaw/

If it shows root root ownership, fix it:

Fix ownership for current user
sudo chown -R $USER:$USER ~/.openclaw

Verify the Fix

ls -la ~/.openclaw/ shows your user as owner

Not root, not node โ€” should match the user running openclaw

Gateway starts without permission errors

Check logs: openclaw logs --follow | grep -i "permission\|EACCES"

Config saves after changes

Make a small change in the Web UI or via CLI and confirm it persists after restart

Still Broken?

Check what user the gateway process is actually running as:

Find gateway process user
# Find the PID
ps aux | grep openclaw

# Check the UID of that process
ls -la /proc/<PID>/exe

Run the Doctor

npx clawkit-doctor@latest

Checks file permissions, directory ownership, and config write access automatically.

Did this guide solve your problem?