Where does OpenClaw store its config, memory, and workspace?
OpenClaw keeps its config, sessions, and your agent's memory under one home directory. Where it lives, what's inside, and what to back up.
Everything OpenClaw knows lives in one place: a hidden folder called .openclaw in the home directory of whichever user runs the Gateway — ~/.openclaw on Mac and Linux, the same under your user profile on Windows. Config, sessions, and your agent’s workspace are all in there. Protect that folder and you’ve protected your agent; lose it and your agent starts over as a stranger.
What’s inside the state directory
Three kinds of things live under ~/.openclaw:
- Config —
openclaw.json, the settings file the Gateway and the CLI both read: which model provider you use, which channels are connected, how access control behaves. - Sessions — the running history of your conversations, kept by the Gateway so a chat can pick up where it left off.
- The workspace — your agent’s own working folder: the files it creates, plus the plain-text notes that make it your agent — its identity, what it knows about you, the memory it accumulates. OpenClaw deliberately keeps this as ordinary files you can open and read, not a database you need tools for.
Your agent’s “memory” is just files
This is the most reassuring thing about OpenClaw’s design, and worth pausing on. The personality and accumulated knowledge of your agent aren’t locked inside a vendor’s cloud — they’re readable text on a disk you control. You can look at what your agent has written down about you. You can edit it. And because it’s just a directory, your agent is portable: the state directory on a machine running the same OpenClaw version is the agent.
The flip side: those files include sensitive things — your conversations, your agent’s notes, and configuration that can contain credentials. Anything that copies the directory (including backups) copies the secrets too, so backups deserve the same care as the machine itself, and deleting an agent properly means deleting its backups as well.
Running in Docker? One rule matters
In a container setup, the state directory must be mounted as a volume — a folder that lives on the host machine and is handed into the container. Get this right and OpenClaw survives container restarts, recreations, and version upgrades with its memory intact; we’ve verified on our own pods that an agent’s identity, channels, and memory come back byte-for-byte after a full server reboot. Get it wrong — state written inside the container’s own filesystem — and everything your agent learned disappears the first time the container is recreated. If you take one line from this guide: make sure .openclaw lives on the host, not in the container.
What to back up
Back up ~/.openclaw and you’ve backed up the agent: config, sessions, workspace, memory. On a laptop that can be as simple as including it in your normal machine backup. On a server, use your host’s snapshot or backup feature — and test a restore once before you rely on it, because an untested backup is a hope, not a plan. (On Everpod pods, automatic backups and tested restores are part of what’s managed for you.)