🇩🇪 DE 🇬🇧 EN
NexoraHost / Docs home
Popular searches:Minecraft won't startCreate Minecraft serverFiveM txAdminInstall WordPressSet up subdomainVPS GermanySSL errorOpen port 25565Discord bot hostingDNS troubleshooting

n8n - Optimization and Configuration

In this guide, we will help you optimize your n8n server and reduce server load.

1. Recommended System Resources

For optimal performance of n8n, it is recommended to use the following resources:

2. Environment Configuration of n8n

In this section, you will learn how to configure and optimize n8n.

  1. Configure the Node.js Server:
  2. <code>
        # Set the maximum amount of memory (RAM) for the n8n server
        export NODE_OPTIONS="--max-old-space-size=4096"
    
        # Start the n8n server with optimizations
        yarn start --max-old-space-size=4096
        </code>
  3. Configure the .env File:
    • Edit the file `.n8n/.env` in a text editor.
    • Add configurations to improve performance. For example:
    • <code>
              # Optimize the Node.js Heap
              NODE_OPTIONS="--max-old-space-size=4096"
      
              # Disable unnecessary warnings
              N8N_LOGGING_LEVEL="warn"
              </code>
  4. Optimize the User Interface:
    • Configure the user interface to deactivate unnecessary UI components.
    • <code>
              # Disable the Sidebar Command Wizard
              N8N_HIDE_SIDEBAR_COMMANDS=true
      
              # Disable the authentication warning feature (if not needed)
              N8N_DISABLE_AUTHENTICATION_WARNING=true
              </code>
  5. Optimize Workflows:
    • Minimize the Workflow Planner to remove unnecessary workflows and improve performance.
    • <code>
              # Minimize the Workflow Planner
              n8n planer minimize
              </code>

3. Network Component Optimization (Optional)

To enhance performance, you can configure network components like Nginx:

  1. Install and Configure Nginx:
  2. <code>
        # Install Nginx (example for Debian/Ubuntu)
        sudo apt-get update
        sudo apt-get install nginx
    
        # Configure Nginx to forward the n8n server
        sudo nano /etc/nginx/sites-available/n8n
        </code>
  3. Edit Configuration File:
  4. <code>
        server {
            listen 80;
            server_name your_domain_or_ip;
    
            location / {
                proxy_pass http://localhost:5678;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
            }
        }
        </code>
  5. Test and Enable the Configuration:
  6. <code>
        sudo nginx -t
        sudo systemctl restart nginx
        </code>

4. Performance Optimization

In this section, you will find instructions for improving performance:

  1. Edit the Performance Configuration in .n8n/.n8n.config.js:
  2. <code>
        const config = {
            // Set the logging level
            logging: "warn",
    
            // Configure the Workflow Planner
            planerMinimize: true,
    
            // Disable unnecessary features
            disableAuthenticationWarning: true,
        };
        </code>

5. Debugging and Troubleshooting

In this section, you will find instructions for debugging:

  1. Job Management:
  2. <code>
        Navigate to "Jobs" in the left navigation, to view and manage jobs.
        </code>
  3. Log Files:
    • Navigate to the log file in the .n8n directory.
    • Read the logs to identify and fix errors.

6. Conclusion

You have successfully optimized and configured n8n. This guide serves as a reference for further configurations and optimizations.

NexoraHost

Need hosting?

Game servers, VPS & webspace at Maincubes FRA01 – 1 Tbit/s DDoS, 99.9% uptime SLA.

nexorahost.com · Maincubes FRA01 · 1 Tbit/s DDoS · 99,9 % Uptime