How do I install n8n on my VPS? IntroductionInstalling n8n on your Virtual Private Server (VPS) is one of the most efficient ways to gain full control over your workflow automation environment. If you are looking for a reliable and high-performance VPS, you can explore the available plans on BigCloudy to get started quickly. With a self-hosted VPS setup, you can customize configurations, improve security, and run powerful automations without relying on third-party platforms.This guide walks you through everything you need to install n8n on your VPS — whether you’re using Ubuntu, Linux, or a similar system — and helps you create a secure, production-ready automation platform. Once you’ve chosen your plan, click the button to begin your registration. What You Need Before Installing n8n Basic RequirementsOperating System: Ubuntu 20.04 or later (Linux recommended)CPU & RAM: Minimum 1 vCPU and 1–2 GB RAMAccess: Root or sudo access via SSHInternet Connection: Required for installing dependencies and pulling packages Recommended ToolsSSH Client: PuTTY (Windows) or Terminal (macOS/Linux)Package Manager: apt or yumFirewall Control: ufw or firewalld Step 1: Connect to Your VPSConnect to your VPS using SSH (login details provided by your hosting provider, such as BigCloudy VPS services available at www.bigcloudy.com:ssh root@your_vps_ipUpdate your system:sudo apt update && sudo apt upgrade -y Step 2: Install Node.js and npmn8n requires Node.js. Install it using NodeSource:curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash –sudo apt install -y nodejsVerify the installation:node -vnpm -v Step 3: Install n8n GloballyInstall n8n using npm:sudo npm install n8n -gCheck the installed version:n8n –version Step 4: Run n8nStart n8n:n8n startBy default, n8n runs on port 5678.Open your browser and visit:http://your_vps_ip:5678You should now see the n8n dashboard. Step 5: Keep n8n Running in the BackgroundClosing your SSH session will stop n8n unless it runs as a background service.Option 1: Using PM2 (Recommended for Node.js Installations)Install PM2:sudo npm install pm2 -gStart n8n with PM2:pm2 start n8npm2 savepm2 startupThis ensures n8n restarts automatically after server reboots.Option 2: Using Docker (Recommended for Production)Install Docker and Docker Compose:sudo apt install -y docker.io docker-composeCreate a docker-compose.yml file:version: ‘3’services:n8n: image: n8nio/n8n ports: – “5678:5678” environment: – N8N_BASIC_AUTH_ACTIVE=true – N8N_BASIC_AUTH_USER=admin – N8N_BASIC_AUTH_PASSWORD=yourpassword volumes: – ~/.n8n:/home/node/.n8nStart the container:docker-compose up -dn8n will now run continuously in the background. Step 6: Secure Your n8n Installation1. Enable HTTPSUse NGINX with Let’s Encrypt to secure your n8n instance using SSL certificates.2. Enable AuthenticationProtect your dashboard with login credentials:export N8N_BASIC_AUTH_ACTIVE=trueexport N8N_BASIC_AUTH_USER=adminexport N8N_BASIC_AUTH_PASSWORD=securepassword3. Configure a FirewallAllow only essential ports:sudo ufw allow 22sudo ufw allow 80sudo ufw allow 443sudo ufw enable Step 7: Access and Use n8nAfter installation and security setup, access your n8n dashboard via:https://yourdomain.comYou can now build workflows, connect APIs, automate tasks, and manage integrations directly from your VPS ConclusionInstalling n8n on your VPS gives you complete control, enhanced security, and flexibility to build powerful automation workflows. Choosing a dependable VPS provider like BigCloudy makes it easier to scale resources, maintain uptime, and run n8n smoothly in production. By following this guide — from SSH access and Node.js installation to background execution and security hardening — you’ll have a robust, self-hosted automation platform.Whether you’re automating business processes, integrating APIs, or managing complex data flows, n8n on a VPS provides the perfect balance of power, privacy, and scalability. Need Help? If you face any issues updating your nameservers or need further assistance, our support team is always available: Email: support@bigcloudy.com Submit a support ticket FAQ Is n8n free to use on a VPS?Yes. n8n is open-source and free to self-host on your VPS. You only pay for your server infrastructure. What is the recommended way to run n8n in production?Using Docker with Docker Compose is the most reliable and scalable option for production environments. Can I run n8n without Docker?Yes. You can install n8n directly using Node.js and manage it with PM2 for background execution. How much RAM does n8n need?For small workflows, 1 GB RAM is sufficient. For heavy automation or multiple workflows, 2 GB or more is recommended. Is it safe to expose port 5678 to the internet?No. It’s best to secure n8n behind NGINX, enable HTTPS, and restrict direct access using a firewall.