DEV Community

imprahld
imprahld

Posted on

How to Setup n8n vps hosting with Docker in 2025

n8n is a versatile open-source automation platform that lets you build powerful workflows by visually connecting apps, services, and APIs — all without needing to write complex code. Often seen as a self-hosted alternative to tools like Zapier or Make.com, n8n provides greater flexibility and complete control over your data. This step-by-step guide will show you how to install n8n on Docker easily and securely.

How to Set up a Docker Environment with YouStable

Step 1: Deploy Ubuntu VM (20.04 or 22.04)

Get started from the YouStable N8N VPS Hosting page and choose a plan. Launch your instance with
root access.

Step 2: Connect your VM with SSH

If you are using a Windows machine, download PuTTY. If you are using it like me, use this command in your terminal to access your VM.

ssh root@your-server-ip
Enter fullscreen mode Exit fullscreen mode

Step 3: Create Docker Compose for n8n

apt update && apt install docker.io docker-compose -y
Enter fullscreen mode Exit fullscreen mode

Step 4: Create a docker-compose.yml file

version: "3"
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- DB_TYPE=sqlite
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=YourSecurePassword
volumes:
- ./n8n_data:/home/node/.n8n
Enter fullscreen mode Exit fullscreen mode

Step 5: Launch and Verify n8n Container

docker-compose up -d
Enter fullscreen mode Exit fullscreen mode

Now you can access your N8N Dashboard with http://your-vm-ip:5678 on your Google Chrome or any browser of your choice.

How to Set Up n8n with Node.js in 2025 with YouStable

If you prefer not to use Docker or are using a standard KVM VPS from a hosting provider other than YouStable, then follow these simple steps to deploy your n8n project without Docker.

Step 1: Install Node.Js and npm

apt update && apt install curl -y
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs build-essential
Enter fullscreen mode Exit fullscreen mode

Step 2: Add a system user for N8N

adduser --disabled-password --gecos "" n8nuser
usermod -aG sudo n8nuser
Enter fullscreen mode Exit fullscreen mode

Step 3: Installing N8N

su - n8nuser
npm install n8n -g
Enter fullscreen mode Exit fullscreen mode

Step 4: Start N8N

n8n
Enter fullscreen mode Exit fullscreen mode

Now you have set up your N8N without using a docket on port number 5678, to keep it running, you’ll need to consider using PM2.

npm install pm2 -g
pm2 start n8n
pm2 startup && pm2 save
Enter fullscreen mode Exit fullscreen mode

Final Step: Add your Domain & SSL (Optional)

Top comments (0)