To restart n8n after configuration changes, use docker restart n8n for Docker deployments, systemctl restart n8n for systemd, or pm2 restart n8n for PM2. Environment variable changes, new community nodes, and database configuration updates all require a full restart to take effect. Simply refreshing the browser does not reload server-side settings.
Restarting n8n to Apply Configuration and Environment Changes
Many n8n settings are read only at startup: environment variables, database connection parameters, encryption keys, and community node installations. Changing these values in your configuration files has no effect until you restart the n8n process. This tutorial covers the restart command for each deployment method and explains which changes require a restart versus which take effect immediately.
Prerequisites
- A running self-hosted n8n instance
- Terminal or SSH access to the server
- Knowledge of which deployment method you are using (Docker, systemd, or PM2)
Step-by-step guide
Identify your deployment method
Identify your deployment method
Before restarting, determine how n8n is running on your server. If you used Docker or Docker Compose, the process runs inside a container. If you installed n8n with npm and set up a systemd service, it runs as a system service. If you used PM2, it runs as a managed Node.js process. You can check by running the commands below. Only one of these will show n8n as active.
1# Check Docker2docker ps | grep n8n34# Check systemd5systemctl status n8n67# Check PM28pm2 list | grep n8nExpected result: You have identified whether n8n is running via Docker, systemd, or PM2.
Restart n8n using the appropriate command
Restart n8n using the appropriate command
Run the restart command that matches your deployment method. For Docker, docker restart sends a stop signal, waits for the container to shut down, and starts it again with the same configuration. For systemd, systemctl restart stops and starts the service unit. For PM2, pm2 restart reloads the process. If you use Docker Compose and changed the docker-compose.yml file, use docker compose up -d instead, which recreates the container with the new settings.
1# Docker (single container)2docker restart n8n34# Docker Compose (after changing docker-compose.yml)5docker compose down && docker compose up -d67# Systemd8sudo systemctl restart n8n910# PM211pm2 restart n8nExpected result: n8n stops and starts again within a few seconds. The process is running with the updated configuration.
Verify the restart applied your changes
Verify the restart applied your changes
After restarting, confirm that your configuration changes took effect. Check the n8n logs to see the startup messages, which show the loaded configuration values. For Docker, use docker logs n8n --tail 50. For systemd, use journalctl -u n8n --since '5 minutes ago'. For PM2, use pm2 logs n8n --lines 50. Look for any error messages that indicate a configuration problem, such as database connection failures or invalid environment variable values.
1# Docker logs2docker logs n8n --tail 5034# Systemd logs5journalctl -u n8n --since '5 minutes ago'67# PM2 logs8pm2 logs n8n --lines 50Expected result: The logs show n8n starting up successfully with your new configuration values.
Understand which changes require a restart
Understand which changes require a restart
Not all changes need a restart. Environment variables like DB_TYPE, N8N_ENCRYPTION_KEY, WEBHOOK_URL, EXECUTIONS_MODE, and N8N_PORT are read at startup and require a restart. Community node installations also require a restart. However, workflow changes, credential updates, and workflow settings (like Save Execution Progress) take effect immediately through the UI without any restart. Knowing this distinction saves you from unnecessary downtime.
Expected result: You understand which changes take effect immediately and which require restarting n8n.
Complete working example
1#!/bin/bash2# n8n Restart Helper3# Detects deployment method and restarts n8n safely45set -e67echo "=== n8n Restart Helper ==="89# Detect deployment method10if docker ps --format '{{.Names}}' 2>/dev/null | grep -q '^n8n$'; then11 echo "Detected: Docker container"12 echo "Restarting..."13 docker restart n8n14 sleep 315 echo "Checking logs..."16 docker logs n8n --tail 201718elif docker compose ps 2>/dev/null | grep -q 'n8n'; then19 echo "Detected: Docker Compose"20 echo "Restarting with updated config..."21 docker compose down && docker compose up -d22 sleep 523 echo "Checking logs..."24 docker compose logs n8n --tail 202526elif systemctl is-active --quiet n8n 2>/dev/null; then27 echo "Detected: systemd service"28 echo "Restarting..."29 sudo systemctl restart n8n30 sleep 331 echo "Checking status..."32 systemctl status n8n --no-pager3334elif pm2 list 2>/dev/null | grep -q 'n8n'; then35 echo "Detected: PM2 process"36 echo "Restarting..."37 pm2 restart n8n38 sleep 339 echo "Checking logs..."40 pm2 logs n8n --lines 20 --nostream4142else43 echo "No running n8n instance detected."44 echo "Start n8n with one of:"45 echo " docker compose up -d"46 echo " sudo systemctl start n8n"47 echo " pm2 start n8n"48 echo " n8n start"49 exit 150fi5152echo ""53echo "Restart complete. Open n8n in your browser to verify."Common mistakes when restarting n8n After Configuration Changes
Why it's a problem: Using docker restart after changing environment variables in docker-compose.yml
How to avoid: Use docker compose down && docker compose up -d to recreate the container with updated environment variables.
Why it's a problem: Restarting n8n for changes that do not require it, like workflow edits
How to avoid: Workflow changes, credential updates, and UI settings take effect immediately. Only restart for environment variables and system-level changes.
Why it's a problem: Not checking logs after restart, missing startup errors
How to avoid: Always run docker logs, journalctl, or pm2 logs after restarting to confirm n8n started successfully.
Why it's a problem: Restarting during an active workflow execution, causing data loss
How to avoid: Check the Executions tab for running executions before restarting. Wait for them to complete or accept that they will be interrupted.
Best practices
- Always check the logs after a restart to confirm n8n started without errors
- Use docker compose down && docker compose up -d instead of docker restart when you changed docker-compose.yml
- Back up your database before restarting if you changed database-related environment variables
- Schedule restarts during low-traffic periods to minimize disruption to active workflow executions
- Document your restart procedure in a runbook so any team member can perform it
- Use Docker's restart: always policy or systemd's Restart=always so n8n recovers from crashes automatically
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I changed the WEBHOOK_URL environment variable in my n8n Docker Compose file but the old URL is still being used. How do I properly restart n8n to pick up the new configuration?
Restart my n8n Docker Compose deployment to apply new environment variables, then show me the logs to verify the changes took effect.
Frequently asked questions
Do I need to restart n8n after adding a new credential?
No. Credentials are saved to the database through the UI and are available immediately. A restart is not required.
What happens to running workflow executions when I restart n8n?
Active executions are interrupted and marked as failed or unknown. If you have Save Execution Progress enabled, completed steps are preserved. The workflows themselves are not affected and can be re-executed after the restart.
How do I restart n8n without downtime?
For zero-downtime restarts, run n8n in queue mode with multiple workers behind a load balancer. Restart workers one at a time. For single-instance deployments, there will always be a few seconds of downtime during restart.
Why does docker restart not pick up my new environment variables?
docker restart reuses the existing container with its original environment. Use docker compose down && docker compose up -d to recreate the container with updated environment variables from docker-compose.yml.
Do I need to restart n8n after installing a community node?
Yes. Community nodes installed from Settings > Community Nodes require a restart. n8n will typically prompt you to restart after installation.
Can RapidDev help me set up a zero-downtime n8n deployment?
Yes, RapidDev can architect an n8n deployment with queue mode, multiple workers, and a load balancer that allows rolling restarts without interrupting active workflow executions.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation