Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host n8n on DigitalOcean (2026 Guide)

Learn how to self-host n8n on DigitalOcean with a step-by-step 2026 guide covering setup, configuration, and recommended specs for a smooth deployment.

Introduction

n8n is a powerful open-source workflow automation tool that allows you to connect various apps and automate tasks without writing extensive code. Self-hosting n8n on a VPS, particularly through DigitalOcean, provides better control, customization, and security for your automation workflows. In this guide, we will walk through the process of installing n8n on DigitalOcean, ensuring your self-hosted instance runs smoothly.

Prerequisites

Before diving into the installation process, ensure you have the following:

ProviderPrice (Monthly)Features
DigitalOcean6 USDSimple API, data center locations
Contabo VPS5.99 EUR/moHigh storage, affordable pricing
Hetzner Cloud4.15 EUR/moEuropean data centers, flexible
Vultr6 USDHigh performance, multiple OS types
Linode (Akamai)5 USDFast SSD, 99.99% uptime guarantee

You can explore further options in our full VPS comparison.

Step-by-Step Installation of n8n on DigitalOcean

Step 1: Create a Droplet

  1. Log in to your DigitalOcean account.
  2. Click on the โ€œCreateโ€ button in the upper right corner and select โ€œDroplets.โ€
  3. Choose an OS image. We recommend Ubuntu 20.04 LTS.
  4. Pick a plan based on your needs (the Basic Droplet with 1GB RAM is usually sufficient).
  5. Select a data center region close to your target audience.
  6. Set up authentication (use SSH keys for security).
  7. Finalize your droplet settings and click โ€œCreate Droplet.โ€

Step 2: Connect to Your Droplet

Use SSH to connect to your newly created droplet:

ssh root@your_droplet_IP_address

Replace your_droplet_IP_address with the actual IP address of your droplet.

Step 3: Install Node.js and npm

n8n requires Node.js; install it using the following commands:

sudo apt update
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs

Step 4: Install n8n

Once Node.js is installed, install n8n globally using npm:

sudo npm install n8n -g

Step 5: Run n8n

You can start n8n directly in the terminal with:

n8n

By default, n8n runs on port 5678. To access it, navigate to http://your_droplet_IP_address:5678 in your browser.

Step 6: Set Up n8n to Run in the Background

To keep n8n running even when the terminal is closed, you can use screen or pm2. Hereโ€™s how to do it with pm2:

  1. Install pm2:

    sudo npm install pm2 -g
  2. Start n8n using pm2:

    pm2 start n8n
    pm2 save
    pm2 startup

Step 7: Configure Reverse Proxy (Optional)

For better security and management, configure a reverse proxy using Nginx:

  1. Install Nginx:

    sudo apt install nginx
  2. Create a new configuration file:

    sudo nano /etc/nginx/sites-available/n8n
  3. Insert the following configuration:

    server {
        listen 80;
        server_name your_domain_or_ip;
    
        location / {
            proxy_pass http://localhost:5678;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }
    }
  4. Enable the configuration and restart Nginx:

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

Access n8n using http://your_domain_or_ip.

FAQs

How can I secure my n8n installation on DigitalOcean?

Securing your n8n installation involves several steps. First, always use HTTPS by configuring SSL certificates. You can use Letโ€™s Encrypt to obtain free SSL certificates. Second, protect your n8n instance with basic authentication. Finally, regularly update your n8n version to incorporate security patches and improvements.

Is it necessary to have a domain name to run n8n on DigitalOcean?

While itโ€™s not strictly necessary to have a domain name to run n8n on DigitalOcean, it is highly recommended. Using a domain makes it easier to access your n8n instance and is more user-friendly than using an IP address. Additionally, a domain name helps in securing your application with an SSL certificate, which is essential for a production environment.

Can I run n8n on other VPS providers?

Yes, n8n can be installed on any VPS provider that supports Node.js. This includes providers like Contabo, Hetzner Cloud, Vultr, and Linode. Follow similar steps as outlined above, ensuring your VPS has sufficient resources. Always refer to the documentation for specific configurations based on the provider.

Conclusion

Self-hosting n8n on DigitalOcean is a straightforward process, enabling you to leverage powerful workflow automation tools in your projects. With the steps outlined above, you can quickly get your n8n instance running and start defining your workflows. Donโ€™t forget to explore other VPS options if DigitalOcean isnโ€™t your top choice, and have fun automating!