SQLite WAL grows excessively and VACUUM does not shrink database

When running VACUUM on a n8n SQLite database in WAL mode, the .wal file grows to several GB, and the main database does not shrink as expected.
(ive manually executed the VACUUM command and it doesnt seem to ouput any errors which means it executed successfully)

here are the env of the docker compose (self hosted):

  • N8N_HOST=${N8N_HOST}
  • N8N_PORT=${N8N_PORT}
  • N8N_PROTOCOL=https
  • NODE_ENV=production
  • WEBHOOK_URL=https://${N8N_HOST}/
  • GENERIC_TIMEZONE=Europe/Berlin
  • N8N_SECURE_COOKIE=true
  • N8N_RUNNERS_ENABLED=true
  • N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false
  • NODE_FUNCTION_ALLOW_EXTERNAL=node-fetch
  • DB_SQLITE_POOL_SIZE=4
  • DB_SQLITE_VACUUM_ON_STARTUP=true
  • EXECUTIONS_DATA_PRUNE=true
  • EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
  • EXECUTIONS_DATA_MAX_AGE=48
  • EXECUTIONS_DATA_PRUNE_MAX_COUNT=1500

Screenshot 2025-10-16 at 19-01-03 Compose n8n - n8n Dokploy

notice here the large size of the .sqlite-wal file

im using a vps: 4 CPU / 8 GB RAM / 100 GB SSD

1 Like

same issue.

Yup, confirmed, I have that too….