How to Install GoAccess Web Log Analyzer on Ubuntu 20.04

A vital part of server and application administration is to know all the change and status logs that each of them have. To help you with this task, we have presented this post, so you can learn how to install GoAccess Web Log Analyzer on Ubuntu 20.04.

What is GoAccess?

The most precise definition of the tool can be found on their website

GoAccess is an open source real-time web log analyzer and interactive viewer that runs on a terminal on *nix systems or through your browser.

Therefore, thanks to GoAccess we can examine the logs and behavior of a web server. This will give us important information about the behavior of the server without sacrificing computer resources.

GoAccess was born with the central idea to quickly analyze and view web server statistics in real time without the need to use the browser. This is great for sysadmin who want to know server data without much effort.

Some main features of the application are:

  • Fast, real time, millisecond updates, written in C
  • Only ncurses as a dependency so it does not waste computer resources.
  • Supports almost all web log formats (Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, Caddy, etc).
  • Easy configuration so simply set the log format and run it against your registry
  • Beautiful terminal and bootstrap dashboards (Adapt GoAccess to suit your own tastes/color schemes)

Let’s go for it.

Install GoAccess on Ubuntu 20.04

The developers of the application provide excellent support for Ubuntu, and so much so that they have a dedicated repository for this distribution. This means that we can quickly install it and get the latest stable version of it.

Adding the GoAccess repository

The first thing we need to do is to connect via terminal and update the whole system.

apt update
apt upgrade

Thereafter, we have to get the GPG key and add it to the system.

wget -O - https://deb.goaccess.io/gnugpg.key | apt-key --keyring /etc/apt/trusted.gpg.d/goaccess.gpg add -

With the key already on the system, we can now add the repository to the system using the command.

echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/goaccess.list

Refresh APT to make the new repository usable.

apt update

Install GoAccess

Now do install GoAccess by running the following command

apt install goaccess
Install GoAccess Web Log Analyzer on Ubuntu 20.04
Install GoAccess Web Log Analyzer on Ubuntu 20.04

Then check the version installed on the system

goaccess --version

Sample output:

Check the goaccess version
Check the goaccess version

Then, you can use it

Using GoAccess on Ubuntu

Before using it, you need to know where the configuration file is. To achieve this, you can run.

goaccess --dcf

You will get an output screen like this:

/etc/goaccess/goaccess.conf

In this file resides all the configuration of the application. You don’t need to modify it for now, but it’s good to keep it in mind.

One of the best things about GoAccess is that it is basic to use. To do so, you just need to invoke the command, the log file and the style in which the data will be presented.

Regarding Apache, if you want to get relevant information, you can use the following command

goaccess /var/log/apache2/access.log --log-format=COMBINED

You will then see an interactive console like this:

Using GoAccess
Using GoAccess

All that’s left for you to do is to browse through the options, searching for information.

It’s actually basic to use and analyze. There you can find out the unique visitors, the URLs requested, as well as their statistics and other information.

To exit, you just have to press the q key.

Alternatively, you can get these reports in HTML format, as follows

goaccess /var/log/apache2/access.log --log-format=COMBINED -a -o [output-directory]

Of course, you can define the name and location of the output file. And then view it with a web browser.

HTML output
HTML output

Conclusion

GoAccess is an excellent application to check the status of your web server. It is compatible with the main ones on the market and thus gives us the flexibility we are looking for. Besides this, the installation process is simple.

I hope you liked the post, and you can share it with all your friends.

Share This:

Leave a Comment

Your email address will not be published.