Step-by-Step Guide to Host n8n on Hostinger VPS

Affiliate disclosure: this post contains a referral link; we may earn a commission from qualifying purchases.

Direct Answer: How to Host n8n on Hostinger VPS

To host n8n on a Hostinger VPS, you need to deploy n8n in a controlled environment such as Docker or Node.js on your VPS, configure environment variables properly for production usage, secure access with HTTPS and authentication, and ensure persistent workflow data storage. This guide walks you through these steps in detail.

Prerequisites Before Starting

  • Hostinger VPS: Purchase a VPS plan from Hostinger with suitable resources (at least 2GB RAM recommended for n8n).
  • Basic Linux Command Line Knowledge: Comfort with SSH access and running shell commands.
  • Domain Name: Optional but recommended for public access with HTTPS.
  • Docker installed on VPS: Docker simplifies deployment but installing Node.js directly is also possible.
  • SSH Client: Terminal on Linux/macOS or PuTTY/Windows Terminal on Windows.

Step-by-Step Instructions to Host n8n on Hostinger VPS

1. Access Your Hostinger VPS via SSH

Use the SSH credentials from your Hostinger control panel to connect:

ssh root@your-vps-ip-address

2. Update System Packages

sudo apt update && sudo apt upgrade -y

3. Install Docker (Recommended)

Install Docker if not already installed.

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker

4. Prepare n8n Deployment with Docker

Create a Docker volume for persistent data:

docker volume create n8n-data

5. Run n8n Docker Container

To ensure proper operation, set critical environment variables such as WEBHOOK_TUNNEL_URL (if exposing n8n behind proxies), N8N_BASIC_AUTH_ACTIVE, and others as applicable.

Example Docker command to run n8n:

docker run -d --name n8n \
  -p 5678:5678 \
  -v n8n-data:/home/node/.n8n \
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=admin \
  -e N8N_BASIC_AUTH_PASSWORD=strongpassword \
  n8nio/n8n

6. Set Up Reverse Proxy and HTTPS (Optional but Recommended)

If you want n8n accessible via domain name with SSL:

  1. Install Nginx on VPS.
  2. Configure Nginx to reverse proxy port 5678.
  3. Use Certbot to enable free HTTPS certificates.

This step secures workflow access and prevents unauthorized use.

7. Verify n8n Is Running

Open your browser to http://your-vps-ip:5678 or https://your-domain.com after setting up reverse proxy. You should see the n8n editor.

Common Pitfalls and How to Avoid Them

  • Missing Environment Variables: Ensure to set environment variables like VUE_APP_URL_BASE_API, WEBHOOK_TUNNEL_URL, and basic auth credentials.
    Without these, n8n may default to localhost or expose unprotected workflows.
  • Insufficient VPS Resources: n8n can become slow or crash if VPS RAM/CPU are too low.
  • Firewall Blocking Ports: Confirm your VPS firewall allows inbound traffic on port 5678 or your chosen proxy port.

Troubleshooting Alternatives

  • If Docker is not preferred, install Node.js (v16+) and n8n globally with npm, then run directly.
    npm install -g n8n
    n8n
  • Use Hostinger’s preconfigured applications or deployment scripts if available for simplified setup.
  • Consider tools like Coolify for containerized app deployments that support n8n.

How to Verify and Maintain Your n8n Setup

  1. Test workflows to confirm triggers and actions execute correctly.
  2. Backup workflow data regularly from n8n volume or database.
  3. Monitor VPS resource usage with htop or Hostinger control panel.
  4. Update n8n container periodically by pulling latest images.

Short FAQs

Can I host n8n without Docker on Hostinger VPS?

Yes, you can install Node.js and n8n directly, but Docker simplifies dependencies and portability.

Is it safe to expose n8n publicly?

You must secure n8n with authentication and HTTPS to protect sensitive workflows.

What VPS size do I need for n8n?

At least 2GB RAM and a moderate CPU are recommended for small-to-medium workloads.

Advanced Configuration: Securing n8n with HTTPS and Reverse Proxy Setup

While the previous steps outlined a basic reverse proxy configuration, here we provide a detailed method to secure your n8n instance fully with HTTPS using Nginx and Let’s Encrypt on your Hostinger VPS.

1. Install Nginx and Certbot

sudo apt install nginx certbot python3-certbot-nginx -y

2. Configure Nginx as a Reverse Proxy for n8n

Create a new Nginx configuration file for your domain:

sudo nano /etc/nginx/sites-available/n8n

Paste the following configuration, replacing your-domain.com with your actual domain. This proxy setup forwards traffic securely from port 443 to the n8n Docker container running on port 5678.

server {
    listen 80;
    server_name your-domain.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl http2;
    server_name your-domain.com;

    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256";

    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;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Save and close the file.

3. Enable the Nginx Site and Test Configuration

sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

4. Obtain SSL Certificates with Certbot

Run the following command to secure your domain with Let’s Encrypt certificates automatically:

sudo certbot --nginx -d your-domain.com

Follow the interactive prompts to complete certificate issuance. Certbot will automatically adjust your Nginx configuration for SSL.

5. Update n8n Environment Variables for HTTPS and Reverse Proxy

Edit your Docker run command or Docker Compose file to include these important environment variables:

  • N8N_HOST=your-domain.com — tells n8n your public hostname.
  • WEBHOOK_TUNNEL_URL=https://your-domain.com — for correct webhook URLs behind reverse proxy.
  • NODE_ENV=production — enables production optimizations.
  • VUE_APP_URL_BASE_API=https://your-domain.com/ — correct frontend API base path.

Example updated Docker run command snippet:

docker run -d --name n8n \
  -p 5678:5678 \
  -v n8n-data:/home/node/.n8n \
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=admin \
  -e N8N_BASIC_AUTH_PASSWORD=strongpassword \
  -e N8N_HOST=your-domain.com \
  -e WEBHOOK_TUNNEL_URL=https://your-domain.com \
  -e NODE_ENV=production \
  -e VUE_APP_URL_BASE_API=https://your-domain.com/ \
  n8nio/n8n

Verifying and Managing n8n Deployment on Hostinger VPS

Confirming Service Accessibility

  1. Open your web browser and visit https://your-domain.com. You should see the n8n editor interface. If you configured basic auth, it will prompt for credentials.
  2. Test webhook URLs by creating dummy workflows that trigger via webhook requests and ensure response success.
  3. Check the status of the Docker container using docker ps and logs with docker logs n8n.

Monitoring Resource Usage

  • Use htop or top to monitor CPU and RAM usage live.
  • From Hostinger’s control panel dashboard, observe resource utilization trends over time.
  • Consider scaling VPS resources if CPU or memory approaches >80% during typical loads.

Updating n8n Container to Latest Version

  1. Pull the newest image:
    docker pull n8nio/n8n
  2. Stop and remove current container:
    docker stop n8n
    docker rm n8n
  3. Re-run the container with the updated image and previous environment variables/volumes.

Automate this with cron jobs or CI/CD tools to keep your workflows secure and updated.

Handling Common Edge Cases and Troubleshooting Tips

n8n Editor Not Loading or Showing Error

  • Check if Docker container is running (docker ps).
  • Review Docker logs for errors (docker logs n8n).
  • Ensure ports are not being blocked by VPS firewall (ufw status on Ubuntu).
  • Verify Nginx proxy settings and SSL certificate validity with sudo nginx -t and browser security details.

Webhook URLs Returning 404 or Not Reachable

  • Check WEBHOOK_TUNNEL_URL environment variable matches your domain with correct protocol.
  • Ensure that the reverse proxy forwards all paths correctly to n8n.
  • Confirm VPS firewall or Hostinger network rules allow inbound webhook requests.

Basic Authentication Not Prompting or Not Working

  • Double-check N8N_BASIC_AUTH_ACTIVE is set to true.
  • Verify username and password environment variables are correct.
  • If using Nginx, ensure SSL termination does not interfere with authentication headers.

Additional FAQs

Can I Use a Database Other Than SQLite for n8n on VPS?

Yes, for production usage, it is recommended to use a dedicated database like PostgreSQL or MySQL for workflow persistence instead of the default SQLite. This requires configuring environment variables like DB_TYPE, DB_POSTGRESDB_HOST, etc., and running an external database service.

How to Backup n8n Workflows and Credentials?

Backups depend on your data storage method:

  • Docker Volume: Export or copy n8n-data volume data regularly using Docker commands or manual file backup.
  • External Database: Use standard database backup tools like pg_dump or mysqldump.
  • Export workflows manually from the n8n UI as JSON files for additional safety.

Is It Possible to Run Multiple n8n Instances on a Single VPS?

Yes, but:
– Use different ports and Docker volumes.
– Configure each instance with unique N8N_HOST and authentication.
– Manage reverse proxy rules carefully per domain or subdomain.

This allows separation of workflows for different teams or projects.

Related service

If you are considering VPS, self-hosting, n8n infrastructure and deployment articles, you can review Hostinger KVM 2 VPS (24-month cart). Compare features, pricing and suitability before deciding.

Featured cover: original AI-generated editorial illustration, not a software screenshot.

Leave a Comment

Scroll to Top