How to Install GoAccess on Ubuntu?

While I personally do not feel too strongly about this issue, in the past year, there has been a strong push in getting away from Google services. I am aware of the privacy concerns and implications of using Google’s _free_ services but as an individual, you must weigh the pros/cons and whether usage of Google’s world-class applications is worth it?

For more privacy-conscious folks, GoAccess is an open source web log analyzer which is a decent replacement for Google Analytics (which I’m using on this website). It is able to run in either the web browser or the terminal and with the ability to generate reports in HTML, JSON and CSV formats.

As always, it’s a good idea to perform an update on your Ubuntu system before installing any new packages, especially if it’s been some time since you’ve done so:

sudo apt-get update
sudo apt-get upgrade

Install the dependencies:

sudo apt-get -y install libncursesw5-dev gcc make libgeoip-dev libtokyocabinet-dev

Install GoAccess:

tar -xzvf goaccess-1.2.tar.gz
cd goaccess-1.2
sudo ./configure –enable-utf8 –enable-geoip=legacy
sudo make
sudo make install

Create a symlink for convenient access:

sudo ln -s /usr/local/bin/goaccess /usr/bin/goaccess

That’s it. GoAccess is now installed on your server.

sudo goaccess /var/log/nginx/access.log -o /var/www/html/stats.html –log-format=COMBINED –real-time-html –daemonize

You can check out the man for more configuration options.