Development, Guide

How to Install n8n on cPanel Hosting: Complete Step-by-Step Guide

Install n8n on cPanel

Install n8n on cPanel- If you are looking to automate workflows and supercharge your productivity, n8n is a fantastic open-source automation tool you should try. This comprehensive tutorial will walk you through installing n8n on your shared cPanel hosting account and getting it running smoothly with SSL support using a dedicated subdomain.

What is n8n?

n8n is an advanced workflow automation tool that lets you visually build complex workflows by integrating hundreds of apps and APIs without writing code. It’s a self-hosted alternative to Zapier that gives you full control over your data and workflows.

Prerequisites

Before you start, ensure you have:

  • cPanel shared hosting account with Node.js support (minimum Node.js 20.17.0)
  • Access to Terminal (Shell) via cPanel
  • AutoSSL or valid SSL certificates enabled
  • Basic knowledge of cPanel interface

Step 1: Create a Subdomain

We’ll set up a dedicated subdomain for n8n, e.g., n8n.yourdomain.com to avoid conflicts with your main website.

  1. Log in to your cPanel dashboard
  2. Navigate to Domains → Subdomains
  3. Enter n8n as the subdomain
  4. Select your main domain
  5. Document root will automatically populate – leave it as is
  6. Click Create
  7. Wait 10-15 minutes for DNS propagation

Step 2: Enable SSL for Your Subdomain

To secure your n8n instance:

  1. Go to Security → SSL/TLS Status in cPanel
  2. Find and select your new subdomain n8n.yourdomain.com
  3. Click Run AutoSSL
  4. Wait a few minutes for SSL to be issued

Step 3: Set Up Node.js Application

  1. Navigate to Software → Setup Node.js App in cPanel
  2. Click Create Application
  3. Choose Node.js version 20.x or above
  4. Set Application mode to Development (change later to Production)
  5. Application root set to your subdomain document root (e.g., n8n)
  6. Application URL should show your subdomain
  7. Startup file defaults to app.js – we’ll change this
  8. Click Create
  9. Copy the environment activation command shown

Step 4: Install n8n Using Terminal

  1. Open Terminal from cPanel
  2. Paste the environment activation command copied in the previous step
  3. Confirm you are inside the application directory
  4. Initialize the project: npm init -y
  5. Install n8n: npm install n8n It may take several minutes. Retry if it times out
  6. Confirmnode_modules/n8n/bin/n8n exists

Step 5: Configure Application Settings

  1. Return to Node.js app settings
  2. Change Startup file to: node_modules/n8n/bin/n8n
  3. Set Application mode to Production

Step 6: Set Environment Variables

Add these critical variables

  • N8N_BASIC_AUTH_ACTIVE: true
  • N8N_BASIC_AUTH_USER: [your_username]
  • N8N_BASIC_AUTH_PASSWORD: [your_password]
  • N8N_HOST: 0.0.0.0
  • N8N_PORT: 5678
  • N8N_PROTOCOL: https
  • N8N_PUSH_BACKEND: websocket
  • VUE_APP_URL_BASE_API: https://n8n.yourdomain.com/
  • WEBHOOK_URL: https://n8n.yourdomain.com
  • NODE_OPTIONS: --max-old-space-size=512
  • EXECUTIONS_DATA_SAVE_ON_ERROR: none
  • EXECUTIONS_DATA_SAVE_ON_SUCCESS: none

Step 7: Start the Application

  1. Click Restart or Start App in Node.js App
  2. Wait 2-3 minutes for it to fully start
  3. Access your instance at: texthttps://n8n.yourdomain.com

You should see the login prompt. Use the credentials defined in environment variables.

Troubleshooting Common Issues

503 Service Unavailable Error

Ensure the app status is running
Verify the startup file is exactly node_modules/n8n/bin/n8n
Check all environment variables are correctly set

SSL Certificate Errors

Confirm AutoSSL is running and complete
Wait for DNS propagation (up to 24 hours)
Test DNS resolution using online tools

Installation Timeouts

Retry npm install n8n multiple timesn8n
Use the environment activation command before each retry
Try during off-peak hours for better performance

Node.js Version Warnings

Use Node.js 18.x or 20.x for best compatibility
Ignore EBADENGINE warnings – n8n will still function

Maintenance and Updates

To keep your n8n installation updated:

1. Access terminal with Node environment active
2. Run update command: bashnpm update n8n
3. Restart your Node.js application in cPanel

Limitations on Shared Hosting

Be aware of these shared hosting constraints:

  • Memory limitations may restrict complex workflows
  • Process timeouts can affect long-running operations
  • WebSocket restrictions may impact real-time features
  • Community nodes may not install due to compilation requirements