Help CenterVPS & CloudHow do I install n8n with Docker on my VPS?

How do I install n8n with Docker on my VPS?

Run n8n workflow automation on your own VPS with Docker, keep your data between restarts and put it behind SSL.

What you need

  • A VPS with at least 2 vCPU and 4 GB RAM
  • Docker installed
  • A domain or subdomain pointing to your server, for example n8n.example.com

Step 1: Install Docker

Follow the official Docker instructions for Ubuntu, then check it works.

docker --version

Step 2: Create a volume for your data

docker volume create n8n_data

The volume keeps your workflows and credentials when the container is replaced.

Step 3: Start n8n

docker run -d --restart unless-stopped --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n -e N8N_HOST=n8n.example.com -e N8N_PROTOCOL=https -e WEBHOOK_URL=https://n8n.example.com/ docker.n8n.io/n8nio/n8n

Replace n8n.example.com with your own domain.

Step 4: Put it behind Nginx with SSL

Use Nginx to proxy your domain to port 5678 and add a free certificate with Certbot. Do not leave port 5678 open to the internet.

Step 5: Create your owner account

Open your domain in a browser and create the owner account when prompted.

Keep it healthy

  • Back up the n8n_data volume regularly.
  • Update by pulling the newest image, then removing and re-creating the container with the same options.

Prefer not to manage it?

webzworld offers managed n8n hosting with a dedicated server, SSL, a custom domain, daily backups and managed updates.

Need help?

If you get stuck, open a support ticket or email info@webzworld.com and our team will help.

Was this article helpful? Contact Support