WindowsmacOSLinux

Where Does n8n Store Workflows and Credentials?

n8n's .n8n folder and database.sqlite path for npm installs plus the Docker volume to persist.

Last updated

n8n keeps user data in a .n8n folder in the home of whoever started it. Inside sits database.sqlite with workflows, credentials and executions, plus the encryption key that makes those credentials readable.

In Docker the same folder appears as /home/node/.n8n and must be backed by a named volume or bind mount. Losing it means new keys on restart, which silently orphans every stored credential even if the database survives elsewhere.

Where n8n stores this, by platform

Windows
%USERPROFILE%\.n8n\database.sqlite

npm install default. The parent .n8n folder also holds config and the encryption key. Override the root with N8N_USER_FOLDER. Docker Desktop needs a volume mapped to /home/node/.n8n.

macOS
~/.n8n/database.sqlite

Same .n8n root as other OSes. Back up the whole ~/.n8n directory, not just the sqlite file, so the key travels with the database.

Linux
~/.n8n/database.sqlite

npm default. Docker Compose should mount n8n_data:/home/node/.n8n or ./n8n-data:/home/node/.n8n. Postgres users still persist this folder for the key even though workflows live in Postgres.

Frequently asked questions

Why did all my n8n credentials break after a move?

The encryption key did not travel with the database. Copy the entire .n8n folder, or set N8N_ENCRYPTION_KEY consistently, or credentials become undecryptable.

How do I back up n8n running in Docker?

Back up the n8n_data volume or bind mount at /home/node/.n8n, plus a pg_dump if you use Postgres. Stop the container first so sqlite is in a consistent state.

Notice an outdated path? Let us know.