Okay so I have been using Piwik for about a year now and find it to be  flawless so I thought I’d do a write up about it.

From the Piwik website: Piwik is the leading open source web analytics platform that give s you valuable insights into your website’s visitors, your marketing campaigns and much more, so you can optimize your strategy and online experience of your visitors.



This is assuming the following is already configured:

  • A valid public domain
  • The said public domain has A records pointing to a publicly visible Apache web server
  • The said Apache web server has a valid vhost configuration for said domain
  • The said Apache web server has PHP 5.5 or greater installed and working
  • The said Apache server has internet access to download files
  • The said web server has mySQL installed and configured correctly

Configuring Apache

Create a directing for the Piwik install, I will be using example.com as an example domain

mkdir -p /var/www/vhosts/example.com/piwik

Download Piwik

cd /var/www/vhosts/example.com/piwik
wget http://builds.piwik.org/piwik.zip

Install Unzip (if not installed)

apt-get install unzip

Unzip the contents of the zip file

unzip piwik.zip -d ../

Change ownership and permissions

chown -R www-data:www-data /var/www/vhosts/example.com/piwik
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp/assets/
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp/cache/
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp/logs/
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp/tcpdf/
chmod -R 0755 /var/www/vhosts/example.com/piwik/tmp/templates_c/

Configuring mySQL

Note1: Do not use the “mysql>” at the beginning of the command, that is just to indicate you are in mysql command prompt.

Note2: mySQL commands require a “;” at the end of the command

Log into mySQL

mysql -u root -p

Create  a new database

mysql> CREATE DATABASE piwik;

Use the database

mysql> USE piwik;

Create a user

mysql> CREATE USER 'piwik'@'localhost' IDENTIFIED BY 'password123';

Grant permissions for the piwik account to the piwik database (don’t use password123)


Finish Install

Browse to the Piwik installation using your browser (I am using example.com)Piwik Install Step 1


Select “Next”


Make sure everything has green ticks next to them and click “Next”Piwik Install Step 2

Leave the database server as

Type in the username

Type in the password

Type in the database name


Click “Next”

Piwik Install Step 3


Ensure tables are created and click “Next”Piwik Install Step 4

Type in the desired admin login name, password and email address and press “Next”Piwik Install Step 5

Type in the website name, URL, time zone and whether or not it is a ecommerce site or not and then press “Next”

Piwik Install Step 6


Take a copy of the Javascript tracking code and select “Next”Piwik Install Step 7


Click on “Continue to Piwik” to continuePiwik Install Step 8


If prompted, upgrade databasePiwik Install Step 9


I recommend donating using the secure PayPal feature, select “Continue to Piwik”Piwik Install Step 10

Sign in to start using PiwikPiwik_Sign_In

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.