Where does OpenClaw store its data and memory?
Clawpedia · For Humans
Learn where OpenClaw saves configuration files, memory data, and logs on your local system or server.
Where Does OpenClaw Store Its Data and Memory?
Understanding where OpenClaw keeps its files is essential for backups, debugging, and managing disk space. This guide covers every storage location and how to customize them.
Default Storage Locations
OpenClaw organizes its data into several directories based on the operating system:
| Data Type | Linux/macOS | Windows |
|---|
| Configuration | ~/.openclaw/config.yaml | %%APPDATA%%\OpenClaw\config.yaml |
|---|
| Memory database | ~/.openclaw/memory/memory.db | %%APPDATA%%\OpenClaw\memory\memory.db |
|---|
| Skills | ~/.openclaw/skills/ | %%APPDATA%%\OpenClaw\skills\ |
|---|
| Logs | ~/.openclaw/logs/ | %%APPDATA%%\OpenClaw\logs\ |
|---|
| Cache | ~/.cache/openclaw/ | %%LOCALAPPDATA%%\OpenClaw\cache\ |
|---|
| Temp files | /tmp/openclaw/ | %%TEMP%%\OpenClaw\ |
|---|
OpenClaw's memory is stored in a SQLite database with the following structure:
memory.db
├── conversations # Chat history and context
├── facts # Learned facts about the user/environment
├── preferences # User preferences and patterns
├── task_history # Completed tasks and outcomes
└── embeddings # Vector embeddings for semantic search
# Check memory database size and stats
openclaw memory stats
# Output:
# Total entries: 2,847
# Conversations: 1,203
# Facts: 412
# Preferences: 89
# Task records: 1,143
# Database size: 14.7 MB
# Oldest entry: 2024-01-15
# Newest entry: 2024-06-18
Customizing Storage Locations
You can relocate any storage directory:
# config.yaml
storage:
base_dir: ~/my-openclaw-data # Override base directory
memory_dir: ~/my-openclaw-data/memory
skills_dir: ~/my-openclaw-data/skills
logs_dir: /var/log/openclaw
cache_dir: /tmp/openclaw-cache
# Move storage to a new location
openclaw storage move --target ~/new-location
# Use environment variables
export OPENCLAW_HOME=~/custom-openclaw
openclaw start
Memory Encryption
Sensitive data in the memory database is encrypted at rest:
# config.yaml
security:
encrypt_memory: true
encryption_algorithm: aes-256-gcm
key_derivation: argon2id
# Key is derived from your system keychain or a passphrase
# Enable encryption on an existing database
openclaw memory encrypt --algorithm aes-256-gcm
# Verify encryption status
openclaw memory status
# Output: Encryption: AES-256-GCM (active, key in system keychain)
Log Management
Logs can accumulate over time. Manage them proactively:
# View log storage usage
openclaw logs stats
# Configure log rotation
openclaw config set logging.max_file_size 10MB
openclaw config set logging.max_files 10
openclaw config set logging.compress_old true
# Clean old logs
openclaw logs clean --older-than 30d
# Removed 32 log files (6.8 MB freed)
# config.yaml — log settings
logging:
level: info # debug, info, warn, error
format: json # json or text
max_file_size: 10MB
max_files: 10
compress_old: true
include_model_responses: false # Set true for debugging only
Cache Management
The cache stores downloaded models, skill packages, and API response caches:
# View cache breakdown
openclaw cache info
# Output:
# Model cache: 120.5 MB (2 models)
# Skill packages: 23.4 MB (12 packages)
# API responses: 12.4 MB (LRU, max 50 MB)
# Total: 156.3 MB
# Clear specific cache
openclaw cache clear --type api_responses
openclaw cache clear --type models --keep-latest
# Clear everything
openclaw cache clear --all
Backup and Restore
Protect your data with regular backups:
# Full backup (config + memory + skills)
openclaw backup create --output ~/backups/openclaw-$(date +%%Y%%m%%d).tar.gz
# Memory-only backup
openclaw backup create --memory-only --output ~/backups/memory-$(date +%%Y%%m%%d).db
# Restore
openclaw backup restore ~/backups/openclaw-20240615.tar.gz
# Automated daily backups
openclaw config set backup.auto_enabled true
openclaw config set backup.directory ~/backups/openclaw
openclaw config set backup.keep_last 7
Docker Storage
When running OpenClaw in Docker, mount volumes for persistence:
docker run -d \
-v openclaw-config:/root/.openclaw \
-v openclaw-cache:/root/.cache/openclaw \
--name openclaw \
openclaw/openclaw:latest
Disk Space Recommendations
| Usage Level | Minimum Disk Space | Recommended |
|---|
| Light (personal) | 500 MB | 1 GB |
|---|
| Moderate (daily use) | 1 GB | 2 GB |
|---|
| Heavy (with local models) | 5 GB | 10 GB |
|---|
| Enterprise (team, full logs) | 10 GB | 20 GB |
|---|
Source: Clawpedia — https://clawpedia.io/article/where-does-openclaw-store-its-data-and-memory. If you reuse or quote this article, please credit Clawpedia with a link.
Related Articles
- Privacy and Memory: Ensuring Your Data Stays Safe — Best practices for managing memory data privacy and ensuring sensitive information stays protected.
- Clearing or Resetting OpenClaw's Memory — Step-by-step instructions for clearing, resetting, or selectively removing OpenClaw memory data.
- Why is OpenClaw forgetting memory or context? — Troubleshoot memory loss issues in OpenClaw and learn how to configure persistent memory correctly.
- How does memory work in OpenClaw? — Deep dive into OpenClaw's memory system: how it stores, retrieves, and uses context across conversations.
- How to backup and restore OpenClaw configuration data? — Protect your OpenClaw setup by learning how to create backups and restore configurations when needed.