# Creating a new Worker

# Serial Number Generation (Licence)

Execute the following commande to get the machine's uuid

The machine's uuid looks similar to abc1de2-fg3hi4jkl-mn5opq-rs6tuvw78xy9z10

sudo dmidecode -s system-uuid

If instead of machine's uuid you got the message Not Settable execute the following command

cat /etc/machine-id | sed 's/\(......\)\(....\)\(....\)\(....\)/\1-\2-\3-\4-/'

Copy the machine's uuid to the KhaCloud dashboard's Serial Generator

The generated Serial Number will look similar to PrSer2r10Pr07U7soAceQserFIrM6iPk8PSerlxtbPrSeHvqprserizo5IuPr5GlCESngyprserDEOjZFXOB

Then go the KhaCloud's servers section and insert the serial number to the new created server

# Installation of (npm / node / pm2)

apt update
apt install npm
npm i -g n

n lts to install latest LTS version


n lts

node -v to get Node's version

Latest tested working version is v18.13.0

node -v

So the latest version works fine, you have to reconnect

exit

Finally install PM2

npm install pm2 -g
pm2 startup

# Installation of (wkhtmltopdf)

Downloading the .deb file for Ubuntu 20

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb

Installation with dependencies auto installation

apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

⚠️ If the last command throws an error, then the missing dependencies will marked in the system, so run the following commands to keep the installation

# Will install the marked missing dependencies
sudo apt --fix-broken install
# Will install wkhtmltopdf
apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

# Installation of (ImageMagick)

apt install imagemagick
  • Increase memory limit by changing the file /etc/ImageMagick-6/policy.xml
  ...
  <policy domain="resource" name="memory" value="1GiB"/>
  <policy domain="resource" name="map" value="1GiB"/>
  ...
  <policy domain="resource" name="area" value="1GiB"/>
  <policy domain="resource" name="disk" value="10GiB"/>
  ...

# Required custom modifications

mkdir "/var/projects"