How to install n8n on nat vps


Natvps.idN8N is the Open Source Workflow Automation Platform (Open-source) which allows us to connect various services and applications to carry out automatic processes without the need for complicated coding.

This article discusses the steps to install N8N on NAT VPS using a docker, along with the Nginx configuration for Reverse-Proxy. This article uses Ubuntu 22.04 as a reference, but you can use other distributions such as Debian and Centos. Make sure the OS used supports the docker.

Port forwarding configuration

Considering we use grout, we need to add 2 Port Forwarding Configuration on the virtualizor panel (or other VPS panels according to the provider), namely Port Forwarding HTTP and HTTPS For the N8N domain.

For example, in this article will use a domain n8n.tutorial.mdinata.my.id To access N8N. You are free to change the domain according to your choice. Record this port and domain, because we will use it again in the deploy process.

Don’t forget to add DNS Records to go to your NAT VPS public IP, like this:

Install Docker

We will use a docker and compile a docker for men-spread Status.

First, install curly Using Orders:

apt update && apt install curl -y

Then, run manuscript Automatic installation from the docker by entering:

Wait until the installation process is complete.

Install N8N

N8N provides an example of a compose docker configuration that is ready to be used in its repositories, so we don’t need to create configuration files docker-compose.yml from the beginning.

Create a new folder with the name N8N

mkdir n8n
cd n8n/

Create a new file with the name docker-compose.yml

apt install nano -y
nano docker-compose.yml

Then, fill in the following configuration:

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - n8n_data:/home/node/.n8n
      - ./local-files:/files

volumes:
  n8n_data:

Create a new file again to store the configuration variable with the name .env

nano .env

Fill in the following code:

# DOMAIN_NAME and SUBDOMAIN together determine where n8n will be reachable from
# The top level domain to serve from
DOMAIN_NAME=mdinata.my.id

# The subdomain to serve from
SUBDOMAIN=n8n.tutorial

# Optional timezone to set which gets used by Cron and other scheduling nodes
# New York is the default value if not set
GENERIC_TIMEZONE=Asia/jakarta

# The email address to use for the TLS/SSL certificate creation
[email protected]
  • Change Domain_name with your domain (such as: Example.com, Mdinata.my.id)
  • Change Subdomain With your subdomain (such as: N8N, n8n.tutorial)
  • Change Ssl_email with your email

Finally, create an empty directory with a name Local file For the need to store files between N8N and host machines:

mkdir local-files/

Run the N8N using a compose docker:

docker compose up -d

Wait until the process spread finished.

Nginx Configuration (Reverse Proxy)

So that we can access the URL through a domain like server-tutorial.mdinata.my.idwe can use Reverse Proxy Like Nginx.

First, install Nginx through the command:

# Hapus Apache2 dan pendukungnya (biasanya terpasang secara bawaan di VPS OpenVZ)
apt purge apache2* -y

# Install NGINX
apt install nginx -y

Create a new host configuration specifically for status:

nano /etc/nginx/sites-available/n8n

Then stick the following configuration:

# Konfigurasi NGINX untuk deploy Status di NAT VPS
# 

server {
    server_name n8n.tutorial.tutorial.mdinata.my.id;
    listen 80;

    location / {
        proxy_pass 
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header Origin $scheme://$http_host;
        proxy_cache off;
        proxy_buffering off;
    }
}

Adjust n8n.tutorial.mdinata.my.id with your domain.

Activate the configuration with:

ln -sf /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/n8n

# Restart NGINX
systemctl restart nginx

Produce SSL certificate (let’s encryption)

So that our domain can be accessed through HTTPS, we need to make a SSL certificate. We can use a free SSL certificate from Let’s Encrypt through Certbot.

Install Certbot and Nginx plugin use the command:

apt install python3-certbot python3-certbot-nginx

So, produce Certificate through Certbot with the command

certbot --nginx -d n8n.tutorial.mdinata.my.id

Change n8n.tutorial.mdinata.my.id with your domain.

Happy! Your current domain can be accessed via a safe connection https.

Access the dashboard N8N

The N8N dashboard can be accessed through your previous domain. Example: https://n8n.tutorial.mdinata.my.id.

Cover

Thus this article is about the steps to install N8N on NAT VPS. If you are confused or doubtful, don’t hesitate to ask questions in the telegram group @ipv6indonesia. Thank You!



Game Center

Game News

Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime

Gaming Center