Install PencilBlue on a Debian 8 VPS

install-pencilblue-on-a-debian-8-vpsIn this blog post we will show you how to install PencilBlue CMS on a Debian 8 VPS with the latest version of Nginx. PencilBlue is an open source content management system built on Node.js. This guide should work on other Linux VPS systems as well but was tested and written for Debian 8 VPS.

Login to your VPS via SSH

ssh user@vps

Update the system and install necessary packages.

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install curl git

Install Node.js

We will install the latest nodejs package from the NodeSource repository:

[user]$ curl --silent --location | sudo bash -
[user]$ sudo apt-get install nodejs

Install Redis and MongoDB

Install the latest Redis and MongoDB packages from the official Debian repository:

[user]$ sudo apt-get install mongodb redis-server

Install PencilBlue

Clone the PencilBlue git repository from github using the following command:

[user]$ git clone ~/pencilblue

Pull all dependencies:

[user]$ cd ~/pencilblue
[user]$ npm install

Create a custom configuration file:

cp sample.config.js config.js

Open the config.js file and edit to your liking.

Install and Configure Nginx

The latest version of Nginx, version 1.8 is not available via the default Debian repositories, so we will add the Dotdeb repository. Open the /etc/apt/sources.list file and append the following lines:

[user]$ sudo vim /etc/apt/sources.list
deb jessie all
deb-src jessie all

Fetch and install the GnuPG key:

[user]$ curl -sS | sudo apt-key add -

Update the system and install Nginx:

[user]$ sudo apt-get update
[user]$ sudo apt-get -y install nginx

Create a new Nginx server block with the following content

[user]$ sudo vim /etc/nginx/sites-available/
server {
    listen 80;

    access_log /var/log/nginx/my_pencilblue-access.log;
    error_log /var/log/nginx/my_pencilblue-error.log;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Test the Nginx configuration and restart nginx:

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

Create an systemd script

[user]$ sudo nano /etc/systemd/system/pencilblue.service

ExecStart=/usr/bin/node /home/your_username/pencilblue/pencilblue.js


Enable and start your PencilBlue instance with:

[user]$ sudo systemctl enable pencilblue
[user]$  sudo systemctl start pencilblue

That’s it. Now open your browser, type the address of your website and register the site’s first admin account.

For more information about how manage your PencilBlue CMS, please refer to the PencilBlue website.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Tips and Tricks
How to set up time zone on CentOS 7
Install ExpressionEngine on Debian 8
Install Kloxo-MR on a Linux VPS
There are currently no comments.