How to restart or update the n8n service? IntroductionRunning a self-hosted n8n instance on your Virtual Private Server (VPS) requires occasional maintenance. You may need to restart the service to apply configuration changes or update it to access new features and security improvements.This guide explains how to safely restart and update n8n using Node.js, PM2, or Docker—ensuring your automation workflows remain secure, stable, and fully functional. For best reliability and performance, running n8n on a dependable VPS such as one from BigCloudy is highly recommended.Why Restart or Update n8n?Keeping n8n up to date and properly restarted ensures optimal performance and security.1. Apply Configuration ChangesUpdates to environment variables, authentication settings, or workflow configurations require a restart to take effect.2. Maintain Securityn8n releases updates that fix bugs and patch vulnerabilities. Regular updates help protect your automation data.3. Access New Features and ImprovementsNew versions include additional integrations, workflow enhancements, and performance optimizations.Step 1: Identify How n8n Is RunningBefore restarting or updating, identify how n8n is installed on your VPS:Node.js Direct Installation – Installed globally via npmPM2 Process Manager – Running as a managed background serviceDocker or Docker Compose – Running inside a containerEach setup uses different commands.Step 2: Restart n8nOption 1: Node.js Direct InstallationIf running n8n manually:n8n stopn8n startIf the process is stuck or running in the background:pkill -f n8nn8n startOption 2: Restart n8n Using PM2Restart the PM2-managed service:pm2 restart n8nCheck the status:pm2 listOption 3: Restart n8n Using DockerRestart using the container name or ID:docker psdocker restart <container_name_or_id>For Docker Compose:docker-compose restartYour n8n instance should now be back online.Step 3: Update n8nOption 1: Update n8n (Node.js Installation)Update using npm:sudo npm install n8n -gRestart n8n after updating.Option 2: Update n8n Using PM2Update globally:sudo npm install n8n -gRestart PM2 service:pm2 restart n8nOption 3: Update n8n Using DockerPull the latest n8n image:docker pull n8nio/n8ndocker-compose downdocker-compose up -dThis replaces the old container with the latest version.Step 4: Verify the UpdateAfter restarting or updating:Open your n8n dashboardCheck the version (Profile → About)Test workflows to confirm everything works correctlyStep 5: Optional — Backup Before UpdatingCreating a backup ensures you can restore your workflows if something goes wrong.Node.js or PM2 BackupBackup the default n8n directory:tar -czvf n8n_backup.tar.gz ~/.n8nDocker BackupIf using Docker volumes:docker run --rm -v n8n-data:/data -v $(pwd):/backup busybox tar czvf /backup/n8n_backup.tar.gz /dataTroubleshooting1. Service Fails to RestartCheck logs:pm2 logs n8nDocker logs:docker logs <container_name>2. Version Didn’t UpdateClear npm cache:npm cache clean --forceEnsure you are updating the correct npm installation or Docker image.3. Workflow Errors After UpdateVerify environment variablesCheck credentialsRestore from backup if needed ConclusionRestarting and updating n8n on your VPS is a simple but essential maintenance task. Whether you’re using Node.js, PM2, or Docker, regular updates improve security, stability, and functionality.Always back up your data before major updates and use a reliable VPS provider like BigCloudy to keep your automation environment running smoothly and reliably. Need Help? If you face any issues updating your nameservers or need further assistance, our support team is always available: Email: support@bigcloudy.com Submit a support ticket FAQ How often should I update n8n?It’s recommended to update n8n every few weeks or whenever a security or feature update is released. Will updating n8n delete my workflows?No. Workflows and credentials are stored separately, especially when using volumes or the .n8n directory. Do I need to stop workflows before updating?Active workflows may pause briefly during a restart. Updating during low-traffic periods is best. Is Docker the safest way to update n8n?Yes. Docker updates are predictable and reduce dependency conflicts, especially on VPS platforms like BigCloudy. Can I roll back to a previous version?Yes. With Docker, you can pull a specific image tag. With Node.js, reinstall the previous version via npm.