# How to Restart n8n After Configuration Changes

- Tool: n8n
- Difficulty: Beginner
- Time required: 5 minutes
- Compatibility: n8n 1.0+ (self-hosted)
- Last updated: March 2026

## TL;DR

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.

## Before you start

- 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

### 1. 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.

```
# Check Docker
docker ps | grep n8n

# Check systemd
systemctl status n8n

# Check PM2
pm2 list | grep n8n
```

**Expected result:** You have identified whether n8n is running via Docker, systemd, or PM2.

### 2. 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.

```
# Docker (single container)
docker restart n8n

# Docker Compose (after changing docker-compose.yml)
docker compose down && docker compose up -d

# Systemd
sudo systemctl restart n8n

# PM2
pm2 restart n8n
```

**Expected result:** n8n stops and starts again within a few seconds. The process is running with the updated configuration.

### 3. 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.

```
# Docker logs
docker logs n8n --tail 50

# Systemd logs
journalctl -u n8n --since '5 minutes ago'

# PM2 logs
pm2 logs n8n --lines 50
```

**Expected result:** The logs show n8n starting up successfully with your new configuration values.

### 4. 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 code example

File: `n8n-restart-helper.sh`

```bash
#!/bin/bash
# n8n Restart Helper
# Detects deployment method and restarts n8n safely

set -e

echo "=== n8n Restart Helper ==="

# Detect deployment method
if docker ps --format '{{.Names}}' 2>/dev/null | grep -q '^n8n$'; then
  echo "Detected: Docker container"
  echo "Restarting..."
  docker restart n8n
  sleep 3
  echo "Checking logs..."
  docker logs n8n --tail 20

elif docker compose ps 2>/dev/null | grep -q 'n8n'; then
  echo "Detected: Docker Compose"
  echo "Restarting with updated config..."
  docker compose down && docker compose up -d
  sleep 5
  echo "Checking logs..."
  docker compose logs n8n --tail 20

elif systemctl is-active --quiet n8n 2>/dev/null; then
  echo "Detected: systemd service"
  echo "Restarting..."
  sudo systemctl restart n8n
  sleep 3
  echo "Checking status..."
  systemctl status n8n --no-pager

elif pm2 list 2>/dev/null | grep -q 'n8n'; then
  echo "Detected: PM2 process"
  echo "Restarting..."
  pm2 restart n8n
  sleep 3
  echo "Checking logs..."
  pm2 logs n8n --lines 20 --nostream

else
  echo "No running n8n instance detected."
  echo "Start n8n with one of:"
  echo "  docker compose up -d"
  echo "  sudo systemctl start n8n"
  echo "  pm2 start n8n"
  echo "  n8n start"
  exit 1
fi

echo ""
echo "Restart complete. Open n8n in your browser to verify."
```

## Common mistakes

- **Using docker restart after changing environment variables in docker-compose.yml** — undefined Fix: Use docker compose down && docker compose up -d to recreate the container with updated environment variables.
- **Restarting n8n for changes that do not require it, like workflow edits** — undefined Fix: Workflow changes, credential updates, and UI settings take effect immediately. Only restart for environment variables and system-level changes.
- **Not checking logs after restart, missing startup errors** — undefined Fix: Always run docker logs, journalctl, or pm2 logs after restarting to confirm n8n started successfully.
- **Restarting during an active workflow execution, causing data loss** — undefined Fix: 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

## 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.

---

Source: https://www.rapidevelopers.com/n8n-tutorial/how-to-restart-n8n-after-configuration-changes
© RapidDev — https://www.rapidevelopers.com/n8n-tutorial/how-to-restart-n8n-after-configuration-changes
