Trouble Setting n8n WEBHOOK_URL

If you have an instance of n8n running in a Proxmox LCX created from the community script Proxmox VE Helper-Scripts and want to set / change environment variables you need to edit:

nano /etc/systemd/system/n8n.service


Environment variables like WEBHOOK_URL can be set here (note: setting them in .bashrc etc does not work!)

e.g.

[Unit]
Description=n8n

[Service]
Type=simple
Environment="N8N_SECURE_COOKIE=false"
Environment="WEBHOOK_URL=https://n8n.example.com"
ExecStart=n8n start
[Install]
WantedBy=multi-user.target

Install Proxmox for PfSense

System Specifications

  • Mini PC with at least ETH 3 ports CWWK Mini PC
  • 16GB RAM
  • 256GB NVMe SSD
  • Single-node Proxmox setup (no clustering)
  • No dedicated GPU or RAID

Installation

  • Step 1 – Download Proxmox VE ISO
  • Step 2 – Download Rufus
  • Step 3 – Install ISO onto empty USB stick



  • Step 4 – Start the Proxmox installer (UEFI mode)
  • Step 5 – On the “Target Hard Disk” screen:
    • Select your drive
    • Then click the button labeled “Options” at the bottom-right corner of the screen
  • Step 6 – In the Options Window:
    • Filesystem: Choose ext4
    • hdsize: Default is fine unless you want to shrink it
    • swapsize: Set this to 0 to disable disk swap (note: we will be enabling zram swap later).
    • maxroot: Leave blank unless you want to cap /
    • minfree: Optional (for snapshots or alignment)
    • maxvz: Leave blank (it will use remaining space)
  • Step 7 – On the Management Network Configuration screen:
    • Management Interface: Choose the first port being used for your Linux Bridge (LAN)
    • Hostname (FQDN): Example pve.home.arpa
    • IP Address (CIDR): IP Address
    • Gateway: Gateway IP address
    • DNS Server: Usually the same as the Gateway

Enable Trim/Discard

Login to the PVE shell and enable Trim/discard on the root filesystem:

lvextend -l +100%FREE /dev/pve/root
resize2fs /dev/pve/root
nano /etc/fstab

Update root line to:

/dev/pve/root / ext4 discard,errors=remount-ro 0 1
systemctl daemon-reload
mount -o remount /
nano /etc/pve/storage.cfg
lvmthin: local-lvm
    thinpool data
    vgname pve
    content rootdir,images
    discard 1
systemctl enable fstrim.timer
systemctl restart fstrim.timer

Set up zram swap:

apt update
apt install zram-tools
nano /etc/default/zramswap

Set:

ALGO=lz4
PERCENT=13
systemctl enable zramswap
systemctl restart zramswap
swapon --show
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   2G   0B  100

Post Install Script

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/post-pve-install.sh)"

CPU Monitoring Script

Have you ever had a rogue process chew up all the CPU on your Linux server for a days and nobody notice?

This happens to me quite a lot so I decided to write a bash script that looks for these processes and send an alert email.

#!/bin/bash

#
# cpumon - monitors CPU usage and sends an alert email if limit is exceeded
#
# 2009 - martin [at] teamburns [dot] com
#

host=`hostname`
file="/tmp/cpumon.txt"

rm $file > /dev/null 2>&1

function sendEmail() {
   subject="High CPU on $host"
   /usr/bin/mail -s "$subject" user@domain.com < $file
}

while read a b c
do
   pid="$a"
   cmd="$b"
   cpu_percentage="$c"

   if [[ -z "$cpu_percentage" ]]
   then
      echo "process $pid $cmd is using less than zero percent of the cpu!"
      continue
   else
      cpu_percentage_integer=$(echo "$cpu_percentage"|sed 's/^\([^\.]*\)\..*$/\1/')
   fi

   if [[ $cpu_percentage_integer -gt 10 ]]
   then
      echo "$pid $cmd is using $cpu_percentage_integer percent of our CPU" >> $file
   fi
done <<< "`ps --no-heading -eo pid,comm,pcpu`"

if [[ -f $file ]]
then
   sendEmail
fi

This script can be scheduled to run periodically by placing an entry in the crontab file. Make sure use replace username with a valid name:

*/30 *  * * *   username    /home/username/cpumon >/dev/null 2>&1