Implementing n8n
n8n is easily implemented in N88panel using Docker container.
Step 1 : Log into the VPS via SSH/terminal as a root user.
Step 2 : We now need to create a folder to store n8n related files and data. Also this folder has to have linux UID and GID permission of 1000 . Though we can create our folder in any directory. Here I am choosing to create the folder in /var folder. Below are the steps to do so
cd /var mkdir n8n-data chown 1000:1000 n8n-data
Step 3 : Now we create our docker compose file using which the docker will run our n8n container. Here I will create this file under the folder /var/custom-containers
mkdir /var/custom-containers ## required if folder custom-containers does not exist cd /var/custom-containers
Next we save the following using our favourite text editor nano or vi to the file n8n.yaml
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "127.0.0.1:26000:5678"
volumes:
- /var/n8n-data:/home/node/.n8n
environment:
- N8N_HOST=localhost
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_FUNCTION_ALLOW_EXTERNAL=axios,lodash
Important - Here the host port number is 26000 . This number has to be between 26000 and 26999, and should not have been assigned to any other container
Now we start our container using the command
docker compose -f /var/custom-containers/n8n.yaml up -d
Step 4 : Now we can finally link our container to nginx using the documentation at : linking with containers.
Ensure that the System Port number is same as the host port number.
When you link the container, please keep the 'Local URL' to / . If you wish to change to your own specific URL, you will need look into the n8n documentation
Now when you open the VHost in your browser, you should be able to access the n8n interface
