← Back to Home

Setting Up n8n in Queue Mode on EasyPanel - A Complete Walkthrough

tags: n8n, easypanel, workflow automation, redis, postgresql, queue mode, deployment

n8n is a powerful workflow automation tool that helps you connect different services and automate tasks. While a single n8n instance works great for small workloads, scaling to handle hundreds or thousands of workflow executions requires a different approach. That’s where queue mode comes in.

In this walkthrough, I’ll guide you through setting up n8n in queue mode on EasyPanel - a modern server control panel that makes deployment straightforward. By the end, you’ll have a production-ready n8n setup with separate worker and editor instances backed by Redis and PostgreSQL.

Understanding n8n Queue Mode

Before we dive into the setup, let’s understand what queue mode is and why you need it.

Standard n8n vs Queue Mode:

In standard mode, a single n8n instance handles everything - the web interface, workflow execution, and webhook processing. This works fine for light usage, but has limitations:

Queue Mode Architecture:

Queue mode separates n8n into two types of instances:

These instances communicate through Redis (for the queue) and share data through PostgreSQL (for workflow definitions and execution history).

Benefits:

Prerequisites

Before starting, you’ll need:

Step 1: Create a New Project

First, we need to create a project in EasyPanel that will contain all our services.\

Initialize new project in EasyPanel

Click on “Create Project” in your EasyPanel dashboard. Give it a descriptive name like n8n or n8n-automation. This project will house all four services we’re about to create: Redis, PostgreSQL, n8n Worker, and n8n Editor.

Step 2: Set Up Redis

Redis will serve as our message queue, enabling communication between the editor and workers.

Initialize Redis Service

Initialize Redis service

Inside your newly created project, click “Create Service” and select Redis from the available templates. EasyPanel provides pre-configured templates that handle most of the setup for you.

Configure Redis

Name Redis service

Name your Redis service n8n-redis and deploy it with the default settings. Redis doesn’t require extensive configuration for n8n queue mode. EasyPanel will automatically:

Once deployed, make note of the service name (n8n-redis) as you’ll need it for environment variables later. Keep this tab open as we’ll copy credentials shortly.

Step 3: Set Up PostgreSQL

PostgreSQL will store all workflow definitions, execution history, and credentials.

Initialize PostgreSQL Service

Initialize PostgreSQL service

Create another service in your project and select PostgreSQL from the templates.

Configure PostgreSQL

Name PostgreSQL service

Name it n8n-postgres and proceed with deployment. EasyPanel will set up:

Again, keep this tab accessible as we’ll need to copy the connection credentials.

Step 4: Copy Database Credentials

Before setting up n8n services, gather the credentials from Redis and PostgreSQL.

PostgreSQL Credentials

Copy PostgreSQL credentials

Navigate to your PostgreSQL service settings and copy the following:

Redis Credentials

Copy Redis credentials

Navigate to your Redis service and copy:

Step 5: Set Up n8n Worker

The worker instances execute workflows in the background. They don’t need web access and run with a special command.

Initialize n8n Worker Service

Initialize n8n worker service

Create a new service and search for the n8n template. We’ll create the worker first.

Name the Worker

Name n8n worker service

Name it n8n-worker to clearly distinguish it from the editor instance.

Configure Worker Environment Variables

Create environment variables for n8n worker

This is the most critical step. The worker needs extensive configuration to connect to Redis, PostgreSQL, and operate in queue mode. Add the following environment variables:

Terminal window
# Core database config
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=n8n_n8n-postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=postgres
DB_POSTGRESDB_PASSWORD=<<your-postgres-password>>
# Redis queue setup
QUEUE_BULL_REDIS_HOST=n8n_n8n-redis
QUEUE_BULL_REDIS_PORT=6379
QUEUE_BULL_REDIS_USERNAME=default
QUEUE_BULL_REDIS_PASSWORD=<<your-redis-password>>
# Encryption key (generate a random string, must be same for editor and worker)
N8N_ENCRYPTION_KEY=<<your-secret-encryption-key>>
# Folder persistence (important)
N8N_USER_FOLDER=/home/node/.n8n
# Enable queue mode
EXECUTIONS_MODE=queue

Important Notes:

The internal hostnames follow EasyPanel’s convention: projectname_servicename. Adjust if you named your project or services differently.

Set Worker Command

Set command for n8n worker

Workers don’t run the default n8n command. Instead, they need to run the worker command:

Terminal window
n8n worker

Set this in the service configuration under the “Command” or “Startup Command” section. This tells n8n to start in worker mode, where it listens to the Redis queue for jobs instead of starting the web interface.

Remove Domain from Worker

Remove domain from n8n worker

Workers don’t need web access - they operate entirely in the background. Remove any domain configuration from the worker service. This:

Step 6: Set Up n8n Editor

The editor instance provides the web interface and receives webhooks. It queues execution jobs for workers.

Initialize n8n Editor Service

Initialize n8n editor service

Create another n8n service in your project.

Name the Editor

Name n8n editor service

Name it n8n-editor or n8n-main to distinguish it from the worker.

Configure Editor Environment Variables

Create environment variables for n8n editor

The editor needs similar configuration to the worker, plus webhook configuration:

Terminal window
# Webhook URL (your EasyPanel domain)
WEBHOOK_URL=https://<<your-easypanel-domain>>.easypanel.host
# Core database config (same as worker)
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=n8n_n8n-postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=postgres
DB_POSTGRESDB_PASSWORD=<<your-postgres-password>>
# Redis queue setup (same as worker)
QUEUE_BULL_REDIS_HOST=n8n_n8n-redis
QUEUE_BULL_REDIS_PORT=6379
QUEUE_BULL_REDIS_USERNAME=default
QUEUE_BULL_REDIS_PASSWORD=<<your-redis-password>>
# Encryption key (MUST be identical to worker)
N8N_ENCRYPTION_KEY=<<same-encryption-key-as-worker>>
# Folder persistence
N8N_USER_FOLDER=/home/node/.n8n
# Enable queue mode
EXECUTIONS_MODE=queue

Critical Configuration Points:

The editor uses the default n8n command (not n8n worker), so leave the command field empty or at default.

Step 7: Deploy and Access

With all services configured, it’s time to deploy and verify everything works.

Deployment Order:

  1. Ensure Redis and PostgreSQL are running
  2. Deploy the worker first
  3. Deploy the editor last

This order ensures dependencies are available when each service starts.

Access n8n Editor

Visit n8n editor domain

Once the editor is deployed and healthy, click on the domain link in EasyPanel. You should see the n8n setup screen where you can:

Initial Setup:

On first access, n8n will ask you to create an owner account. This is the admin account with full access to:

Verification and Testing

After setup, verify everything is working correctly.

Check Service Health

In EasyPanel, ensure all four services show as “Running”:

Test Workflow Execution

Create a simple test workflow:

  1. Add a “Schedule” trigger (every 5 minutes)
  2. Add a “Set” node to create some test data
  3. Activate the workflow

Watch the execution logs - if the workflow runs and completes successfully, your queue mode is working. The editor queued the job, and a worker picked it up and executed it.

Monitor Worker Activity

You can check worker logs in EasyPanel to see execution activity:

Scaling Your Setup

One of queue mode’s biggest advantages is easy horizontal scaling.

Adding More Workers

To handle increased load:

  1. Clone your n8n-worker service in EasyPanel
  2. Name it n8n-worker-2 (or use a sequential naming scheme)
  3. Use the exact same environment variables
  4. Deploy

The new worker will automatically connect to the same Redis queue and start processing jobs. You can add as many workers as your server resources allow.

Monitoring Performance

Watch for these indicators that you need more workers:

n8n provides execution statistics in the web interface under Settings → Usage & Plan.

Troubleshooting Common Issues

Here are solutions to common setup problems:

Workers Not Picking Up Jobs

Symptoms: Workflows queue but never execute

Causes:

Solutions:

  1. Verify N8N_ENCRYPTION_KEY is identical in editor and all workers
  2. Check Redis credentials and connectivity
  3. Review worker logs for connection errors

Database Connection Errors

Symptoms: Services crash with database errors

Causes:

Solutions:

  1. Verify all database environment variables
  2. Ensure PostgreSQL is fully started before deploying n8n services
  3. Check internal network connectivity in EasyPanel

Webhook Not Receiving Data

Symptoms: Webhook workflows don’t trigger

Causes:

Solutions:

  1. Verify WEBHOOK_URL matches your actual domain exactly
  2. Test webhook URL accessibility from external services
  3. Check SSL certificate status in EasyPanel

Production Considerations

Before using this setup in production, consider these best practices:

Backup Strategy

Your critical data is in PostgreSQL:

Resource Allocation

Allocate resources based on your workload:

Security

Monitoring

Set up monitoring for:

Conclusion

You now have a production-ready n8n installation running in queue mode on EasyPanel. This architecture gives you:

Key Takeaways:

Next Steps:

With this setup, you’re ready to automate workflows at scale. Happy automating!