OpenClaw Service Unavailable

According to OpenClaw App, “The application is not running properly”. According to Tips, Generate a secure gateway token using: openssl rand -hex 32. Set OPENCLAW_GATEWAY_TOKEN in your environment before starting”. Any idea for setting the configuration items?


AMD Ryzen 9 9950X

Kingston Fury 64GB DDR5

EVGA 3090Ti FTW3 Hybrid

4*1TB RAID 5 SATA SSD

This error is almost always because OpenClaw never actually started, not a UI bug.

OpenClaw requires a mandatory env var. If it’s missing, the container exits and you see “Service Unavailable”.

What they mean by that tip is:

You must generate a token and pass it into the container as an environment variable before startup.

Example (Docker CLI):

openssl rand -hex 32

Copy the output, then run OpenClaw like this:

docker run -d \
  --name openclaw \
  -p 3000:3000 \
  -e OPENCLAW_GATEWAY_TOKEN=PASTE_TOKEN_HERE \
  -v /DATA/AppData/openclaw:/app/data \
  openclaw/openclaw:latest

Key things to check (in order):

  1. Container is actually running
docker ps | grep openclaw
  1. If it exited, check why
docker logs openclaw
  1. Data directory must be writable
    On ZimaOS it must live under /DATA/AppData/...

If they installed via CasaOS UI:

  • Open the app
  • Go to Settings → Environment Variables
  • Add
    OPENCLAW_GATEWAY_TOKEN = <generated token>
  • Save and restart the app

If logs still show exit on startup, post docker logs openclaw, without logs, it can’t be diagnosed further.

1 Like

Thanks for your help!

However, when I tried to open the settings page of the OpenClaw app on CasaOS, I couldn’t find a button to generate a token. Is there another way to generate the token?

I would greatly appreciate it!

CasaOS does not generate the token. You must generate it manually on the ZimaOS host.

Run:

openssl rand -hex 32

If openssl is missing:

head -c 32 /dev/urandom | xxd -p -c 32

Copy the full output string.

Then in CasaOS:

OpenClaw → Settings → Environment Variables
Set:

OPENCLAW_GATEWAY_TOKEN = <your_generated_token>

Save → Restart the container.

Then verify it is running:

docker ps | grep openclaw
docker logs big-bear-openclaw --tail 50

If it still does not start, the logs will show the exact reason.

1 Like

Thank you for your help!

I have generated the token and pasted it into the appropriate field. However, the error still persists. The error message shows “Permission Denied.”

I believe this should be the final step, and I feel like I’m almost there. Could you please advise how to resolve this issue? I would greatly appreciate it!

Good, this is not an OpenClaw issue.

Your screenshot shows:

permission denied while trying to connect to the Docker daemon socket
/var/run/docker.sock: connect: permission denied

That means you are running Docker as admin, but that user does not have permission to access Docker.

On ZimaOS you must elevate first.

Run:

sudo -i

Enter your password.

Then verify Docker works:

docker ps

If that works, now check OpenClaw:

docker logs big-bear-openclaw --tail 50

If sudo -i fails, then check whether your user is in the docker group:

groups

But normally on ZimaOS, sudo -i is the correct method.

The “Permission Denied” you’re seeing is host-level Docker access, not the container itself.

Once you can run docker ps without error, we can inspect whether OpenClaw is actually starting or exiting.

1 Like

Thank you for your explanation!

I have entered all the steps as code, and the current message shows:
“Run openclaw setup or set gateway.mode=local (or pass --allow-unconfigured)”, and there are about 50 lines in total.

I believe the light at the end of the tunnel is just ahead.

Perfect. Now we have the real issue.

Your logs show:

Missing config. Run `openclaw setup` or set gateway.mode=local

So the container is restarting because it has no configuration yet.

Since you are running this inside CasaOS (not interactively), you cannot run openclaw setup easily.

The correct fix in this case is to switch it to local mode.

Go to:

CasaOS → OpenClaw → Settings → Environment Variables

Add:

GATEWAY_MODE = local

Save → Restart the container.

That satisfies this requirement:

set gateway.mode=local

Alternative (not recommended unless testing):

ALLOW_UNCONFIGURED = true

But GATEWAY_MODE=local is the proper solution for a standalone install.

After restart, verify:

docker ps
docker logs big-bear-openclaw --tail 20

It should stop looping and move to “Up” instead of “Restarting”.

You are indeed at the final step.

1 Like

Thank you for your patient responses.

I’ve tried every possible method, even reinstalling the OpenClaw app via CasaOS. At the moment, it still appears to be looping and continues to show that it needs to “set gateway.mode=mode.”

Is there something else that might still be configured incorrectly? Thanks!

The container log is explicit:

Run `openclaw setup` or set gateway.mode=local

That means it expects a runtime flag, not an environment variable.

So ignore GATEWAY_MODE.

Do this only:

CasaOS > OpenClaw > Container command

Add:

--gateway.mode=local

Save > Restart.

Then verify:

docker ps
docker logs big-bear-openclaw --tail 20

That’s the correct configuration path for this image.

1 Like

I’m doing my best to follow everything correctly.

I’ve added “–gateway.mode=local” to the container command as instructed, but it still returns an error. This time, the error message says: “unknown option ‘–gateway.mode’.”

Thank you for helping clarify this—hopefully this is truly the final step. Thanks again!

Good. Now we see exactly what happened.

The error:

unknown option '--gateway.mode'

means the flag is being passed to the wrong binary.

Your container command shows this structure:

gateway
--bind
lan
--port
18789
--gateway.mode
local

That tells us the entrypoint is already calling something internally, and CasaOS is appending your flags to the wrong layer.

The log earlier said:

Missing config. Run `openclaw setup`

That message is not solved by CLI flags in this Big-Bear packaged image.

This particular image expects the config file to exist in:

/home/node/.openclaw

And you are mounting:

/DATA/AppData/big-bear-openclaw → /home/node/.openclaw

So the real issue is:

There is no initialized config directory yet.


The correct fix for this image

Run the setup once inside the container.

From root:

docker exec -it big-bear-openclaw sh

If it immediately exits because it’s restarting, stop it first:

docker stop big-bear-openclaw
docker start big-bear-openclaw
docker exec -it big-bear-openclaw sh

Inside the container, run:

openclaw setup

That will generate the config under /home/node/.openclaw.

Exit the container.

Then restart:

docker restart big-bear-openclaw

Why this works:

The image is telling you clearly:
Run openclaw setup.

It is not asking for flags.
It is asking for initial configuration generation.

Once the config exists in the mounted directory, the restart loop will stop.

Remove the --gateway.mode flags you added. They are not needed.

This is the actual final step.