KEEP LEARNING
Build the bigger picture.
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
Tips > Ops & Security
Docker's default `json-file` logging driver stores container logs with no size limit.
Docker's default json-file logging driver stores container logs with no size limit, so a busy n8n instance can fill the disk within weeks. Setting max-size and max-file at the container level caps log storage and rotates logs automatically. This prevents a silent failure where the disk fills and the host becomes unreachable.
Docker's default json-file logging driver stores container logs with no size limit. On a busy n8n instance with verbose execution logging, container logs can consume tens of gigabytes within weeks, silently filling the disk until the host becomes unresponsive. Setting max-size and max-file at the container level caps log storage with automatic rotation.
Real-world example: You limit each container to 3 log files of 50 MB each, capping total log storage at 150 MB per container.
services:
n8n:
image: n8nio/n8n:1.94.1
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
tag: "n8n"
postgres:
image: postgres:16-alpine
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "20m"
max-file: "3"
tag: "postgres"Alternatively, set the default for all containers in the Docker daemon configuration file /etc/docker/daemon.json:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "3"
}
}Then apply the daemon configuration change by restarting Docker:
# Apply the daemon configuration change
sudo systemctl restart dockerWarning: Existing Containers. Changing daemon.json only affects newly created containers. Existing containers keep their original logging configuration. You must recreate them with docker compose up -d --force-recreate to pick up the new defaults.
This prevents a common silent failure where the disk fills up, causing PostgreSQL to crash, n8n to lose data, and the host to become unreachable via SSH.
Related: Set a Unique Encryption Key and Back It Up · Configure Payload Size and Binary Data Mode for Large Files
KEEP LEARNING
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
APPLY IT TO YOUR SYSTEM
Bring the process, the tools involved and an example of where the current workflow gets stuck.