Automation is transforming how you run your business, and platforms like n8n are at the forefront of this shift. Whether you’re prototyping a new idea, building a minimum viable product (MVP), or connecting services for large-scale, mission-critical workflows, n8n’s open-source, no-code platform empowers you to create seamless automation. From crafting viral video content to managing massive outbound messaging campaigns, n8n’s flexibility makes it a go-to tool for solutions engineers and vibe coders alike. By self-hosting n8n on InMotion Hosting’s Virtual Private Server (VPS) plans, which support Docker, you gain full control over your workflows, data privacy, and customization without the recurring costs of cloud-based alternatives.
In this guide, you’ll learn how to self-host n8n using Docker on InMotion Hosting’s VPS plans. We’ll walk you through the setup process step-by-step, highlight common issues users face when self-hosting n8n, and provide practical workarounds tailored to InMotion Hosting’s infrastructure. By the end, you’ll have a secure, fully functional n8n instance ready to automate your workflows.
Why Self-Host n8n Instead of Using Cloud Solutions
n8n Cloud imposes significant limitations that can stunt your automation growth. Their Starter plan restricts you to just 2,500 workflow executions per month with only 5 active workflows, while their Pro plan caps you at 10,000 executions with 15 active workflows. For businesses running complex automation campaigns, these limits become bottlenecks quickly.
InMotion Hosting’s VPS Hosting plans eliminate these artificial constraints entirely. Your only limits are the server resources you choose, giving you the freedom to run unlimited workflows with unlimited executions. This translates to substantial cost savings for high-volume operations.
Consider a business running automated outbound messaging campaigns. With n8n Cloud’s Pro plan at $50 monthly, you’re capped at 10,000 executions. If your campaign generates 15,000 message sends per month, you’d need to upgrade to Enterprise pricing. With InMotion’s VPS plans starting at competitive rates, you get unlimited executions plus full control over your data and infrastructure.
The technical advantages extend beyond cost. Self-hosting provides complete customization freedom, allowing you to install custom nodes, modify configurations, and integrate with internal systems that cloud solutions can’t access. You maintain data sovereignty, crucial for businesses handling sensitive information or operating under strict compliance requirements.
n8n Cloud Pricing
Pre-Installation Planning and Requirements
Before diving into the technical setup, proper planning prevents the common pitfalls that derail many n8n self-hosting attempts. Based on community feedback and our experience supporting customers, most deployment failures stem from inadequate preparation rather than technical complexity.
Prerequisites for Self-Hosting n8n
Before you begin, ensure your InMotion Hosting VPS meets the minimum requirements for running n8n:
- Operating System: Ubuntu 20.04 or 22.04
- Hardware: At least 4 vCPU and 8GB RAM for basic setups; 8 vCPU and 16GB RAM recommended for production environments.
- Docker: Pre-installed on InMotion Hosting’s VPS plans, but you’ll need to verify it’s active.
- Domain Name (Optional): A domain (e.g., n8n.yourdomain.com) for easier access and SSL setup.
- SSH Access: Access to your VPS via SSH (default port 22 on InMotion Hosting servers).
- Basic Tools: Familiarity with SSH (via Terminal on Mac/Linux or PuTTY on Windows) and basic Linux commands.
InMotion Hosting’s VPS plans are Docker compatible, eliminating one of the most common setup hurdles. The minimum requirements for a stable n8n deployment include 2GB RAM, though we recommend starting with 4GB. CPU requirements are modest – even a single-core VPS can handle moderate automation loads, but multi-core configurations provide better performance for concurrent workflow executions.
Storage needs vary dramatically based on your workflow complexity and data retention requirements. Plan for at least 10GB for the base installation, but factor in database growth if you’re storing execution history or handling file operations. InMotion’s VPS plans offer scalable storage options, allowing you to expand as your automation needs grow.
Network considerations matter more than most realize. n8n workflows often involve API calls, webhook receivers, and file transfers. Ensure your VPS plan includes sufficient bandwidth for your expected traffic patterns. InMotion’s network infrastructure provides reliable connectivity essential for webhook-dependent workflows.
If you don’t yet have a VPS, InMotion Hosting offers plans starting with 4 vCPU for small projects, with higher-tier options available for more demanding workflows. Dedicated Servers are also available with Docker support for enterprise-scale deployments.
Security Planning and SSH Configuration
InMotion Hosting VPS servers use port 22 as the default SSH port, which is open by default. While this simplifies initial access, security best practices recommend changing to a non-standard port to mitigate automated attacks. This change requires opening the new port in your firewall (such as APF or CSF), editing /etc/ssh/sshd_config
to specify the new port, and restarting the SSH service for changes to take effect.
Document your security configurations during setup. Many users struggle later when they forget custom SSH ports or firewall rules, leading to lockouts during maintenance windows. Create a secure note with your server access details, custom ports, and emergency access procedures.
Plan your SSL certificate strategy early. n8n requires HTTPS for production use, and webhook integrations demand valid certificates. Whether you choose Let’s Encrypt automated certificates or custom SSL implementations, factor this into your initial setup timeline.
Step-by-Step Guide to Self-Hosting n8n with Docker
Source: n8n github
Follow these detailed steps to set up n8n on your InMotion Hosting VPS using Docker. This guide assumes you’re using an Ubuntu-based VPS with Docker pre-installed.
Step 1: Connect to Your VPS
- Access Your VPS via SSH: Log in to your InMotion Hosting account and navigate to the VPS dashboard in cPanel or AMP. Find your server’s IP address and SSH credentials.
- Open a terminal (Mac/Linux) or PuTTY (Windows).
- Run:
ssh root@your_server_ip
(replace your_server_ip
with your VPS IP).
- Enter your root password when prompted.
- Update Your System: Ensure your server is up to date to avoid compatibility issues.
- Run:
apt update && apt upgrade -y
- This updates package lists and installs the latest security patches.
Step 2: Verify Docker Installation
InMotion Hosting’s VPS plans come with Docker pre-installed, but you should confirm it’s active.
- Check Docker Version: Run
docker --version
to verify Docker is installed.
- Expected output:
Docker version 20.x.x
or similar.
- Start Docker Service: If Docker isn’t running, start it with:
systemctl start docker
- Enable it to run on boot:
systemctl enable docker
- Test Docker: Run
docker run hello-world
to confirm Docker is functioning. You should see a confirmation message.
Step 3: Install n8n Using Docker
n8n recommends using Docker for self-hosted deployments due to its simplicity and portability. We’ll use Docker Compose for persistent data storage and easier configuration.
- Install Docker Compose:
- Check if Docker Compose is installed:
docker-compose --version
- If not installed, install it:
apt install docker-compose -y
- Create a Docker Compose File:
- Create a directory for n8n:
mkdir ~/n8n && cd ~/n8n
- Create a file named
docker-compose.yml
: nano docker-compose.yml
- Paste the following configuration (from n8n’s official documentation):
version: "3"
services:
n8n:
image: n8nio/n8n
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=your_username
- N8N_BASIC_AUTH_PASSWORD=your_password
- N8N_HOST=yourdomain.com
- N8N_PORT=5678
- WEBHOOK_URL=https://yourdomain.com/
- GENERIC_TIMEZONE=UTC
volumes:
- ~/.n8n:/home/node/.n8n
- Replace
your_username
, your_password
, and yourdomain.com
with your desired credentials and domain (or server IP if no domain is used).
- Save and exit: Press Ctrl+O, Enter, then Ctrl+X.
- Set File Permissions:
- Ensure the
.n8n
directory has correct permissions: chown -R 1000:1000 ~/.n8n && chmod -R 755 ~/.n8n
- Start n8n:
- Run:
docker-compose up -d
- This starts n8n in detached mode. Verify it’s running:
docker ps
Step 4: Access the n8n Dashboard
- Open n8n in Your Browser:
- Navigate to http://your_server_ip:5678 or https://yourdomain.com if you’ve set up a domain and SSL.
- Log in with the username and password defined in the
docker-compose.yml
file.
- Complete Setup:
- Follow the on-screen instructions to create an n8n owner account.
- You’ll land on the n8n dashboard, where you can start building workflows.
Step 5: Secure Your n8n Instance
Security is critical when self-hosting n8n, as misconfigurations can expose your workflows to the internet. InMotion Hosting’s VPS servers use port 22 for SSH by default, but you’ll need to secure both SSH and n8n.
- Change the Default SSH Port:
- Open the SSH configuration file:
nano /etc/ssh/sshd_config
- Find the line
#Port 22
and change it to a non-standard port (e.g., Port 2222
).
- Save and exit.
- Open the new port in the firewall:
ufw allow 2222/tcp
ufw deny 22
ufw enable
- Restart the SSH service:
systemctl restart sshd
- Set Up SSL for n8n:
- Obtain an SSL certificate using Let’s Encrypt:
apt install certbot python3-certbot-nginx -y
certbot --nginx -d yourdomain.com
- Update the
docker-compose.yml
file to use HTTPS by setting WEBHOOK_URL=https://yourdomain.com/
.
- Restart n8n:
docker-compose down && docker-compose up -d
- Restrict n8n Access:
- Limit access to n8n by binding it to a private network or specific IP:
- Edit
docker-compose.yml
to add network_mode: host
and bind to 127.0.0.1:5678
.
- Use a reverse proxy like Nginx to manage external access securely.
Complete Docker Compose Configuration
Create your docker-compose.yml
file with the following production-ready configuration.
This configuration addresses several common deployment failures. The health check ensures PostgreSQL is ready before n8n attempts connections. Traefik handles SSL certificate automation, eliminating manual certificate management. Volume mounts provide data persistence across container restarts.
version: '3.8'
services:
traefik:
image: traefik:v2.9
restart: unless-stopped
command:
- --api=true
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.websecure.address=:443
- --certificatesresolvers.mytlschallenge.acme.tlschallenge=true
- --certificatesresolvers.mytlschallenge.acme.email=${EMAIL}
- --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json
ports:
- 443:443
- 80:80
volumes:
- traefik_data:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
environment:
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- TZ=${GENERIC_TIMEZONE}
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=443
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE}
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}
- DB_TYPE=${DB_TYPE}
- DB_POSTGRESDB_DATABASE=${DB_POSTGRESDB_DATABASE}
- DB_POSTGRESDB_HOST=${DB_POSTGRESDB_HOST}
- DB_POSTGRESDB_PORT=${DB_POSTGRESDB_PORT}
- DB_POSTGRESDB_USER=${DB_POSTGRESDB_USER}
- DB_POSTGRESDB_PASSWORD=${DB_POSTGRESDB_PASSWORD}
volumes:
- n8n_data:/home/node/.n8n
- ./local-files:/files
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
depends_on:
- db
- traefik
db:
image: postgres:13
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_POSTGRESDB_USER}
- POSTGRES_PASSWORD=${DB_POSTGRESDB_PASSWORD}
- POSTGRES_DB=${DB_POSTGRESDB_DATABASE}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_POSTGRESDB_USER} -d ${DB_POSTGRESDB_DATABASE}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
traefik_data:
n8n_data:
db_data:
Common Issues and Workarounds
Self-hosting n8n can present challenges, especially for users new to server management. Based on community feedback and web research, here are common issues and workarounds tailored to InMotion Hosting’s VPS plans:
- Steep Learning Curve for Server Setup:
- Issue: Users often struggle with command-line interfaces, Docker setup, and server configuration due to limited technical expertise.
- Workaround: InMotion Hosting’s VPS plans simplify this with pre-installed Docker. Use the one-click Docker Compose setup above to avoid manual Node.js installations. InMotion Hosting’s support team can assist with basic VPS troubleshooting, reducing the learning curve.
- Security Risks from Exposed Ports:
- Issue: By default, n8n runs on port 5678 without authentication, potentially exposing your instance to attackers if your VPS has a public IP.
- Workaround: Enable basic authentication in the
docker-compose.yml
file as shown above. Change the SSH port and use InMotion Hosting’s firewall (via ufw) to restrict access to trusted IPs. Set up a reverse proxy with NGINX and SSL to encrypt traffic.
- Performance Bottlenecks with Growing Workflows:
- Issue: As workflows scale, a basic VPS may struggle with CPU or memory limitations, causing slowdowns or crashes.
- Workaround: Start with InMotion Hosting’s 4 vCPU plan. You can also configure PostgreSQL for increased connection pooling and memory allocation. Add these parameters to your database configuration:
db:
image: postgres:13
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
environment:
- POSTGRES_USER=${DB_POSTGRESDB_USER}
- POSTGRES_PASSWORD=${DB_POSTGRESDB_PASSWORD}
- POSTGRES_DB=${DB_POSTGRESDB_DATABASE}
- Lack of Collaboration Features:
- Issue: The n8n Community Edition lacks built-in collaboration tools, making it hard for teams to co-edit workflows.
- Workaround: Use InMotion Hosting’s VPS to host a Git repository for manual version control. Share workflow JSON files among team members via secure channels. For advanced features, consider n8n’s Enterprise Edition on a Dedicated Server.
- Maintenance Overhead:
- Issue: Keeping n8n, Docker, and the OS updated requires ongoing effort, which can be time-consuming.
- Workaround: Automate updates using a cron job:
crontab -e 0 2 * * * apt update && apt upgrade -y && docker-compose -f ~/n8n/docker-compose.yml pull && docker-compose -f ~/n8n/docker-compose.yml up -d
This runs daily updates at 2 AM. InMotion Hosting’s 99.9% uptime guarantee ensures minimal disruption during maintenance.
Benefits of Self-Hosting n8n with InMotion Hosting
By self-hosting n8n on InMotion Hosting’s VPS, you unlock several advantages:
- Cost Savings: Pay for powerful yet flexible VPS hosting and run unlimited workflows, unlike cloud plans with per-execution fees.
- Data Control: Keep sensitive data on your server, meeting compliance needs for industries like healthcare or finance.
- Customization: Build custom nodes to integrate with internal systems or APIs, leveraging n8n’s extensibility.
- Performance: InMotion Hosting’s high-performance CPUs and SSD storage ensure smooth workflow execution, even for complex tasks like AI-driven content creation or messaging campaigns.
Wrap Up
With n8n running on your InMotion Hosting VPS, you’re ready to automate tasks like syncing databases, managing social media, or building AI-powered workflows. Explore n8n’s node-based interface to connect over 400 applications, from Google Sheets to Slack. If you hit roadblocks, InMotion Hosting’s support team and n8n’s community forums are valuable resources.
To get started, sign up for an InMotion Hosting VPS Hosting plan, follow the steps above, and begin automating your workflows today. See how InMotion’s infrastructure provides the flexibility and performance your organization needs to automate efficiently and scale effectively.
Frequently Asked Questions
How much does it cost to self-host n8n compared to n8n Cloud?
Self-hosting n8n on InMotion’s VPS plans typically costs significantly less for high-volume operations. n8n Cloud’s Pro plan costs $50 monthly for 10,000 executions and 15 active workflows. With unlimited executions on a VPS, businesses running 20,000+ monthly executions can save hundreds of dollars while gaining complete control over their infrastructure.
Can I run multiple n8n instances on one VPS?
Yes, you can run multiple n8n instances on a single InMotion Hosting VPS by using different ports or domains for each instance. Create separate Docker Compose files (e.g., docker-compose-instance1.yml
, docker-compose-instance2.yml
) with unique port mappings (e.g., 5678:5678
for one, 5679:5679
for another). Ensure your VPS has enough resources. InMotion Hosting’s support can help verify resource allocation to prevent conflicts.
What if I encounter Docker-related errors during setup?
If Docker fails to start or n8n doesn’t run, check the Docker service status: systemctl status docker.
Ensure Docker Compose is installed (docker-compose --version
). If the n8n container crashes, view logs with docker logs <container_id>
(find the container ID with docker ps -a
). Common issues include incorrect permissions on the ~/.n8n
directory or port conflicts. Fix permissions with chown -R 1000:1000 ~/.n8n
and verify port 5678 is free with netstat -tuln | grep 5678
. InMotion Hosting’s support team can assist with Docker troubleshooting.
How do I back up my n8n workflows?
To back up your n8n workflows, export them as JSON files from the n8n dashboard (Workflows > Download). Store these files securely on your InMotion Hosting VPS or an external service like Google Drive. For persistent data, the ~/.n8n
directory (mapped in the Docker Compose file) contains your database and configurations. Back it up regularly with:
tar -czf n8n_backup_$(date +%F).tar.gz ~/.n8n
Copy the backup to a secure location using scp
or InMotion Hosting’s file manager. Automate backups with a cron job for consistency.
How often should I update my self-hosted n8n installation?
n8n releases new versions weekly, but you don’t need to update immediately. Establish a monthly update schedule for minor versions and test updates in a staging environment before applying to production. Monitor the n8n community forums and GitHub releases for security updates that require immediate attention.
How do I scale my n8n deployment as my automation needs grow?
InMotion’s VPS plans support vertical scaling by adding CPU, RAM, and storage resources without service interruption. For extreme scale requirements, implement n8n’s queue mode with multiple worker containers. This horizontal scaling approach distributes workflow execution across multiple processes, supporting virtually unlimited automation capacity.