Installing Node.JS on Raspberry PI For PFClient

I am going to assume that you know how to login to the command prompt on your Raspberry PI from your chosen system or you are accessing it via the console.

Most of the information that is contained below has been found on the internet and modified to suit the need here.

First off we are going to create a directory called node and this is where we are going to install node.js rather than in ‘/usr/local’ just make life a little more simple when updating things in the future.

sudo mkdir /opt/node

The next step is to dowload the Node.JS ARM binary package, unpack it and copy the content to our node directory /opt/node.

tar xvzf node-v0.10.24-linux-arm-pi.tar.gz
sudo cp -r node-v0.10.24-linux-arm-pi/* /opt/node

Finally we have to add Node.JS to our path.

sudo ln -s /opt/node/bin/node /usr/local/bin/node
sudo ln -s /opt/node/bin/npm /usr/local/bin/npm

That completes installing nodejs on the RBPI so next we will install the PFClient

Enter the following commands on the command line

cd ~


sudo wget
sudo npm install -g pfclient-latest.tgz

The command above will install PFClient (Be warned it will take some time to install)

You should see lots of information scrolling on the terminal window

and when completed you should see something like this

/usr/local/bin/pfclient -> /usr/local/lib/node_modules/pfclient/client.js
/usr/local/bin/pfclient-service -> /usr/local/lib/node_modules/pfclient/launcher.js
[email protected] /usr/local/lib/node_modules/pfclient
âââ [email protected]
âââ [email protected]
âââ [email protected]
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])

then type sudo pfclient at the command prompt and press enter then follow the on screen prompts to set up PFClient as per instructions

We need now a start script for PFClient. The script will start PFCLient with the user ‘pi’ . The output stream from PFCLient will be stored in the file /tmp/pfclient.log. Just create the file in your current directory with the following content:

at the command prompt and press enter then follow the on screen prompts

sudo nano

The add this



case “$1” in

echo “starting node: $NODE $PFCLIENT_SERVER”

killall $NODE

echo “usage: $0 (start|stop)”

exit 0

Then press ctrl and X then press Y to save the file and exit from nano

Next enter the following commands

sudo chmod 755
sudo cp /etc/init.d
sudo update-rc.d defaults

It’s time to start pfclient with our start script.

sudo /etc/init.d/ start

To stop pfclient just enter

sudo /etc/init.d/ stop

To check that everything is ok issue the following command

cat /tmp/pfclient.log

This should display the status of the software that is running

and if you want to remove then issue the following commands

sudo rm /etc/init.d/
sudo update-rc.d remove

I hope you find this of use

Author: admin