Author Archives: admin

Guide to Deploying n8n Workflow Automation with PostgreSQL, Redis, Uptime Kuma, and Netdata Monitoring

In this guide, we’ll deploy a complete n8n automation system on Ubuntu, including PostgreSQL, Redis, NGINX, SSL (Certbot), and monitoring tools such as Netdata and Uptime Kuma, plus a daily automatic backup system.
The entire stack is managed using Docker Compose, making it easy to scale, maintain, and ensure a stable environment for n8n.

How the System Works:

  • Users access the system through an HTTPS domain, protected by NGINX and SSL certificates from Certbot.

  • NGINX acts as a reverse proxy, routing requests to n8n, Netdata, and Uptime Kuma.

  • When an event or trigger occurs, n8n executes the corresponding workflow.

  • n8n pushes tasks into the Redis queue for asynchronous processing.

  • n8n workers fetch tasks from Redis and execute them.

  • Execution results and logs are stored in the PostgreSQL database.

  • Configuration data and internal files are saved in the n8n_data volume.

  • Netdata monitors system and container performance in real time.

  • Uptime Kuma tracks the uptime of services and stores logs in kuma_data.

  • The backup system automatically saves PostgreSQL data and Docker volumes daily for data recovery when needed.

Step 1: Update and Install Basic Components:

sudo apt update && sudo apt install -y docker.io docker-compose nginx certbot python3-certbot-nginx git curl

sudo systemctl enable –now docker

sudo systemctl enable –now nginx

Step 2: Install Netdata for System Monitoring

bash <(curl -Ss https://get.netdata.cloud/kickstart.sh)

Step 3: Create and Configure Docker Compose for n8n

nano docker-compose.yml

 

version: “3.9”

 

services:

postgres:

image: postgres:15

container_name: postgres

restart: unless-stopped

environment:

POSTGRES_USER: n8n

POSTGRES_PASSWORD: datacloudPass

POSTGRES_DB: n8n

ports:

– “5432:5432”

volumes:

– pg_data:/var/lib/postgresql/data

networks:

– datacloud

 

redis:

image: redis:7

container_name: redis

restart: unless-stopped

networks:

– datacloud

 

n8n:

image: n8nio/n8n:1.113.3

container_name: n8n

restart: unless-stopped

environment:

– N8N_HOST=n8n.datacloud.vn

– WEBHOOK_URL=https://n8n.datacloud.vn/

– DB_TYPE=postgresdb

– DB_POSTGRESDB_HOST=postgres

– DB_POSTGRESDB_PORT=5432

– DB_POSTGRESDB_DATABASE=n8n

– DB_POSTGRESDB_USER=n8n

– DB_POSTGRESDB_PASSWORD=datacloudPass

– EXECUTIONS_MODE=queue

– QUEUE_BULL_REDIS_HOST=redis

– QUEUE_BULL_REDIS_PORT=6379

ports:

– “5678:5678”

volumes:

– n8n_data:/home/node/.n8n

depends_on:

– postgres

– redis

networks:

– datacloud

 

uptime-kuma:

image: louislam/uptime-kuma:latest

container_name: uptime-kuma

restart: unless-stopped

ports:

– “3001:3001”

volumes:

– ./kuma-data:/app/data

networks:

– datacloud

 

volumes:

pg_data:

n8n_data:

 

networks:

datacloud:

driver: bridge

Step 4: Launch the Docker Stack

docker compose up -d

docker ps

Step 5: Configure NGINX Reverse Proxy and SSL

server {

server_name n8n.datacloud.vn;

 

# n8n

location / {

proxy_pass http://localhost:5678;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

}

 

# Netdata /netdata/

location /netdata/ {

proxy_pass http://localhost:19999/;

proxy_set_header Host $host;

proxy_set_header X-Forwarded-Host $server_name;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_redirect off;

}

 

listen 443 ssl; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/n8n.datacloud.vn/fullchain.pem; # managed by Certbot

ssl_certificate_key /etc/letsencrypt/live/n8n.datacloud.vn/privkey.pem; # managed by Certbot

include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

 

}

server {

if ($host = n8n.datacloud.vn) {

return 301 https://$host$request_uri;

} # managed by Certbot

 

 

server_name n8n.datacloud.vn;

 

listen 80;

return 404; # managed by Certbot

 

 

}

Step 6: Enable and Test the Site

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

nginx -t && systemctl reload nginx

Step 7: Obtain SSL Certificate with Certbot

certbot –nginx -d n8n.datacloud.vn

Step 8: Set Up Auto Renewal

crontab -e
0 2 * * * certbot renew –quiet –post-hook “systemctl restart nginx”

Step 9: Access Your Interfaces

https://n8n.datacloud.vn → n8n Dashboard

http://n8n.datacloud.vn:3001 -> Uptime Kuma Dashboard

https://n8n.datacloud.vn/netdata → Netdata Monitoring

sudo cat /var/lib/netdata/netdata_random_session_id

Step 10: Set Up Automatic Backup System

Step 10.1: Create Backup Directory

mkdir -p /root/backups/logs

 

Step 10.2: Download Backup Script

wget https://script.datacloudvn.com/n8n/backup_n8n.sh
chmod +x /root/backup_n8n.sh

Step 10.3: Test Backup

 

bash /root/backup_n8n.sh
ls -lh /root/backups

Step 10.4: Schedule Daily Backup at 01:00 AM

 

crontab -e

 

0 1 * * * /root/backup_n8n.sh

Step 10.5: Verify Cron Service

systemctl status cron

sudo grep CRON /var/log/syslog

 

Conclusion

We have successfully deployed a complete n8n system with all the essential components database, queue, monitoring, SSL security, and automated daily backups.
This architecture is scalable, recoverable, and easy to monitor, making it ideal for real-world workflow automation environments.

Thanks for reading!

Bé Snake

 

Guide to Installing DirectAdmin and Configuring a Website with Just One Command

DirectAdmin is a widely known control panel nowadays, used for managing servers that host multiple websites and services.
If you are new and have just purchased a license, you might not know what additional components are needed for a stable website setup. This guide will help you get started with the basic DirectAdmin setup.

Step 1: Install DirectAdmin

wget -O da-install.sh https://script.datacloudvn.com/directadmin/da-install.sh

chmod +x da-install.sh

./da-install.sh

Or:

bash <(wget -qO- https://script.datacloudvn.com/directadmin/da-install.sh | tr -d ‘\r’)

Step 2: Check DirectAdmin Login Information.

Step 3: Monitor the Installation Progress.

tail -f /var/log/directadmin/custombuild.*.log

Step 3.1: Or log in to DirectAdmin and monitor the progress via CustomBuild.

Step 4: Create a package and enable the display of feature lists.

Step 5: Add a user in DirectAdmin using the package you created.

Step 6: Check the features that have been assigned to the user.

Step 7: Create a WordPress website for the newly added user.

Step 7.1: Enter WordPress user information.

Step 7.2: Review the created WordPress user information.

Step 7.3: Verify the website details in WordPress Manager.

Step 8: Log in to the newly created website.

Conclusion

We have completed the initial setup steps for DirectAdmin. This streamlined control panel setup includes phpMyAdmin, Roundcube, and WordPress Manager for convenient website management. It supports Multi PHP with PHP-FPM, allowing easy version switching per website, integrates Redis for faster processing, and uses CSF Firewall for security.

Thank you for reading this guide !

Bé Snake

 

Guide to Deploying n8n with Docker and HTTPS

In the digital era, workflow automation plays a crucial role in optimizing efficiency and reducing manual tasks. n8n is an open-source automation platform that enables seamless connections between applications, services, and processes without requiring complex programming.

This system is deployed on n8n.datacloud.vn, utilizing Docker to ensure flexibility, scalability, and easy management. With HTTPS integration via Nginx Reverse Proxy, the system provides a secure, stable connection, ready for automation tasks.

This guide will detail the deployment of n8n, HTTPS configuration, and system stability assurance.

Recommended Configuration

  • CPU: 2-4 vCPU
  • RAM: 4-8 GB
  • Disk: 20-50 GB SSD

Installing Docker & Docker Compose

Step 1: Install Docker & Docker Compose

sudo apt update && sudo apt install -y docker.io docker-compose

sudo systemctl enable –now docker

Step 2: Check the Docker version

docker –version

docker-compose –version

Step 3: Configure n8n with the domain n8n.datacloud.vn

Recreate Directory and Set Correct Permissions

sudo mkdir -p ~/.n8n sudo

chown -R 1000:1000 ~/.n8n

sudo chmod -R 770 ~/.n8n

docker run -d –name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n –restart always n8nio/n8n

Step 4: Verify if the container is running and check on the website

docker ps

Enable HTTPS or Disable Secure Cookie

For security, Datacloudvn recommends installing SSL

2.Installing SSL

Step 1: Install both Nginx and Certbot

apt install -y nginx certbot python3-certbot-nginx

Step 2: Generate an SSL certificate using DNS TXT record authentication and set up email notifications

sudo certbot -d n8n.datacloud.vn –manual –preferred-challenges dns certonly –email hungnguyentran326@gmail.com

Step 3: After updating DNS records, verify them using dnschecker

Step 4: Once DNS propagation is complete, return to the n8n server and press Enter to continue

3.Configuring Nginx Reverse Proxy

Step 1: Create an Nginx configuration file for n8n

nano /etc/nginx/sites-available/n8n

 

server {

listen 80;

server_name n8n.datacloud.vn;

return 301 https://$host$request_uri;

}

 

server {

listen 443 ssl;

server_name n8n.datacloud.vn;

 

ssl_certificate /etc/letsencrypt/live/n8n.datacloud.vn/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/n8n.datacloud.vn/privkey.pem;

ssl_protocols TLSv1.2 TLSv1.3;

 

location / {

proxy_pass http://localhost:5678/;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

}

}

Step 2: Save and activate the configuration

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

nginx -t

systemctl restart nginx

Step 3: Configure n8n to support HTTPS

Stop the current container and change the n8n port (5678) to HTTPS

docker stop n8n && docker rm n8n

docker run -d –name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n -e N8N_PROTOCOL=https -e N8N_HOST=n8n.datacloud.vn -e WEBHOOK_URL=https://n8n.datacloud.vn/ –restart always n8nio/n8n

4.Final Verification on the Website

https://n8n.datacloud.vn/

Conclusion

We have successfully completed the deployment of n8n using Docker, ensuring flexibility, scalability, and easy management. With this setup, we can leverage n8n to automate the connection of applications, services, and workflows in a seamless way without the need for complex programming.

Thank you for reading this article!

Bé Snake

Fix error message IonCube not enabled when installing softaculous cPanel and adding key

ionCube Loader is not loaded. Please enable it to continue installation

When installing softaculous, it says IonCube is not enabled.

Step 1: Server Configuration > Tweak Settings > Find the keyword loader, select ioncube then Save

Step 2: After turning on IonCube, install softaculous and check the IonCube version

cd /home

wget -N http://files.softaculous.com/install.sh

chmod 755 install.sh

./install.sh

/usr/local/cpanel/3rdparty/bin/php -v

Step 3: Add key to softaculous and update cron

cd /usr/local/cpanel/whostmgr/docroot/cgi/softaculous

./cli.php –license YOUR_LICENSE_KEY

./bin/cron.php

Note the case

The system is trying to run cli.php as a shell script, while cli.php is actually a PHP file. Since the file does not have a shebang line (#!/usr/bin/php) at the beginning, the command ./cli.php will be treated as a bash script.

Step 3.1: Add key to softaculous and update cron

php cli.php –license YOUR_LICENSE_KEY

php cron.php

Step 4: Check if the key has been activated successfully

Conclusion

We have just completed the steps of the Guide to fix the error message IonCube is not enabled when installing softaculous cPanel, here we can continue to install and use popular CMS (WordPress, Joomla, Magento, Laravel, forums, wikis, CRM).

Thank you for reading.

Bé Snake

Instructions for configuring mail in opencart

During the web operation, the website will have sections for customers to fill out

Quick message to contact you, to receive other information, contact customers usually

We will configure receiving by mail the information will appear as in the contact form

on the web, here are the steps to configure mail in opencart

mail configuration in opencart

Step 1: Go to System > Settings > Mail to enter the mail configuration

Step 2: Configure mail and select save to save

Step 3: To send mail to accounts in the web, go to Marketing > Mail and fill in the email information to send and select Send to start sending.

Step 4: Go to your mail to check that the mail has been sent successfully

Conclusion

We have just completed the steps of configuring mail on opencart here we can create and send automatic mail for our opencart web .

Thank you for reading.

Bé Snake

Instructions for Backup and Restore in opencart

In the process of web administration we will need to store web data to prevent loss of web data, on the opencart web admin page there will be an effective backup and restore feature that we need.

Backup and restore on opencart

Step 1: Go to System > Maintenance > Backup / Restore > Backup > Select All > Export to export the backup file

Step 2: After clicking Export, the backup file will be downloaded and stored

Step 3: to proceed to restore web data, also create and re-login the above steps and
Go to Restore > Import and choose the backup file

Step 4: Wait for the restore process and notify the import successfully

Conclusion

We have just completed the backup and restore steps on opencart here we can actively backup our opencart web data  .

Thank you for reading.

Bé Snake

Firewalld installation instructions

Firewalld is a firewall system that uses zones and services to manage

Install firewalld

Step 1: To use the firewalld installation package, use the command

yum install firewalld 

Step 2: Then select yes to agree to download and install

Step 3: After the installation is complete to launch the firewalld service use the command

systemctl start firewalld 

Step 4: To check the service runs successfully use the command

systemctl status firewalld

Step 5: If you want, every time you start your computer on firewalld, start using the command

systemctl enable firewalld

Step 6: Check again using command

systemctl is-enabled firewalld

Step 7: Stop the firewalld service using the command

systemctl stop firewalld

or

systemctl disable firewalld

Step 8: List the zones using the . command

firewall-cmd –get-zones

Step 9: See which zone is default using the command

firewall-cmd –get-default-zone

Step 10: Change the default zone like public to work using the command

firewall-cmd –set-default-zone=word

Step 11: Then check again with the command

firewall-cmd –get-default-zone

Step 12: List rules in zones using command

firewall-cmd –list-all-zones

Step 13: The public zone shows that it is enabled and working by default using the ens192 network card running the dhcpv6 and ssh service

Step 14: Or you can use the command to see the running service

firewall-cmd –zone=public –list-services

Step 15: See the ports that are allowed to use the command

firewall-cmd –zone=public –list-ports

Step 16: View the system’s services using the command

firewall-cmd –get-services

Step 17: Allow the dhcp service to run in the public zone using the command

firewall-cmd –zone=public –add-service=dhcp

Step 18: Check if the translation is allowed to use the command

firewall-cmd –zone=public –list-services

Step 19: To cancel service like dhcp use command

firewall-cmd –zone=public –remove-service=dhcp

(or add –permanent if the service cannot be removed)

Step 20: add port 300 to the firewall’s public zone with the command

firewall-cmd –zone=public –add-port=300/tcp

Step 21: Add a port range 301 to 400 on the public zone using the command

firewall-cmd –zone=public –add-port=301 -400/tcp

Step 22: Check the ports added to the public zone using the command

firewall-cmd –zone=public –list-ports

Step 23: Remove the added port with the command

firewall-cmd –zone=public –remove-port=300/tcp

Step 24: Add your own hung zone using the command

firewall-cmd –permanent –new-zone=hung

Step 25: After adding the hung zone, reload the service with the command

firewall-cmd –reload

Step 26: Check again with the command

firewall-cmd –get-zones

Step 27: After creating the zone, you can make it default and add services and ports

Conclusion

We have just completed the basic steps of using firewalld on cenos7, where we can exploit and use to manage the operating system.

Thank you for reading.

Bé Snake

Instructions for using Pair key to connect ssh

Pair key is formed from public key and private key

The public key is placed in the server so that when the client connects, there must be a new private key server for the connection. This process helps to secure the server if unfortunately the ip is exposed and the password is detected.

Step 1: Use putty to run ssh key pair, select RSA 2048, click Generate to start generating keys

Step 2: Save the public key in turn by clicking the save public key button

Step 3: Save the private key by clicking the save private key button

Step 4: Then open it up and copy the key off

 

Step 5: Go to the server to create the .ssh file with the command

mkdir .ssh

Step 6: Create and edit the authorized_keys file using the touch . command

touch authorized_keys

Step 7: Go to the authorized_keys file using the command

vi authorized_keys

Step 8: Then paste the key pair

Step 9: Next, reset the ssh file with the command

vi / etc / ssh / sshd_config

Step 10: Edit the config file to

PermitRootLogin prohibit-password

PasswordAuthentication no

Step 11: Restart the service to update the config file using the command

systemctl restart sshd.service

Step 12: Go to putty, go to Connection>SSH>Auth then click Browse to select the saved ssh key

Step 13: login to the server using ssh

Step 14: Try to log in with another machine and immediately report an error

Conclusion

We have just completed the basic steps to install Pair key on ssh, here we can remote ssh securely with Pair key.

Thank you for reading.

Bé Snake

Instructions for installing Squid Proxy

Squid Proxy is a cache that fully supports popular protocols such as HTPS,HTTPS,FTP, which is placed in front of the web server and improves the speed and performance of the web server by caching these repeated requests. iterate and filter web traffic.

Install Squid

Step 1: To install squid use the command

yum install squid

and press y to agree to install

Step 2: Then start the service with the command

systemctl start squid

Step 3: Start squid with the server using the command

systemctl enable squid

Step 4: To test use the command

systemctl status squid

Step 5: Go to the config file using the command

vi /etc/squid/squid.conf

Step 6: Allow ip ranges to use squid proxy using the command

acl localnet src ip 14.241.230.0/24

Step 7: Enable more secure ports to access via Squid proxy similar to for web port connection using command

acl Safe_ports port 80

Step 8: The default port of squid proxy is 3128, you can change another port

Step 9: To create a login account for Squid proxy install the necessary tools using the command

yum – y install httpd-tools

Step 10: To create a file and assign permissions to the file use the command

touch /etc/squid/passwd && chown squid /etc/squid/passwd

Step 11: To create a hung user for squid proxy use the command

htpasswd /etc/squid/passwd hung 

Step 12: go to the config file of squid proxy and add user authentication configuration commands

Step 13: To restart squid proxy service use command

systemctl restart squid

Step 14: To block any web when using proxy use command

vi /etc/squid/blocked_sites

and add to site eg:domain.com then save and exit

Step 15: Go to the squid config file and add the web block file path using the command

acl blocked_sites dstdomain “/etc/ squid/blocked_sites”

http_access deny blocked_sites

Step 16: Then save and restart squid proxy using command

Systemctl restart squid

Step 17: Go to the client, connect to the proxy and check

Step 18: Check the connection of blocked websites

Conclusion

We have just completed the steps of installing and configuring our own squid proxy server, where we can manage ips and websites when connecting to the server.

Thank you for reading.

Bé Snake

Instructions for installing Mailserver with Zimbra

MAIL SERVER uses SMTP protocol as the server that performs the task of mail management to control the amount of mail sent and received to avoid spam mail cases, virus intrusion leading to mail block.

Set the server to use the domain name vdata.cf

Step 1: Change the server name to mail.vdata.vn using the command

hostnamectl set-hostname “mail.vdata.cf”

and add an MX record to use the mail server on the domain management web

Step 2: Edit the server’s hosts using the command

vi /etc/hosts

Step 3: Add the host ip and mail domain add the command

ip mail.vdata.cf mail

Step 4: To install netstat use the commands

yum -y install net-tools

Step 5: Install the necessary packages using the command

yum install unzip net-tools sysstat openssh-clients perl-core libaio nmap-ncat libstdc++.so.6 wget -y

Step 6: To create zimbra folder use command

mkdir zimbra && cd zimbra

Step 7: To download zimbra use command

wget https://files.zimbra.com/downloads/8.8.10_GA/zcs-8.8.10_GA_3039.RHEL7_64.20180928094617.tgz

Step 8: To extract the ZCS 8.8.10 file use the command

tar zxpvf zcs-8.8.10_GA_3039.RHEL7_64.20180928094617.tgz

Step 9: Then go to the file using the command

cd zcs-8.8.10_GA_3039.RHEL7_64.20180928094617

Step 10: To run the file using the command use the command

./install.sh

Step 11: Select y to agree to install packages

Step 12: After checking the pointed mail.vdata.cf domain, press enter to continue the installation process

Step 13: Then choose 7 and 4 to choose to set password for admin mail

Step 14: Then follow the instructions and save to /opt/zimbra/config.

Step 15: Then go to the web to check https://mail.vdata.cf:7071

Step 16: If you want to send a message to a new mail, enter the name of the email you want to send to and click send

Step 17: Check sent successfully

Conclusion

We have just completed the steps to configure and install the zimbra mail server running with the domain name mail.vdata.cf here we can manage and set up our own mail server system under the business domain name.

Thank you for reading.

Bé Snake