Tutorials  /  Linux Basics

Install GoAccess on CentOS 7 for Real-Time Log Analysis

Ccentron Redaktion · May 2025 ·4 min read ·Linux Basics, Tutorial

GoAccess is a freely available web log analyzer. It enables you to examine access logs live either through the terminal or via a web browser. Supporting various web log formats, it can produce reports in formats such as HTML, JSON, and CSV.

This tutorial outlines the procedure to install the newest version of GoAccess on a CentOS 7 server.

Prerequisites

  • A 64-bit CentOS 7 server instance
  • An account with sudo privileges
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: Update Your System

Before installing any software packages, it's a good practice to update your CentOS server. Access your server using the sudo user credentials and run the commands below to update the system:

Console
sudo yum -y install epel-release
sudo yum -y update
sudo shutdown -r now

After your server completes the reboot, log back in with the sudo user and continue with the installation.

Step 2: Install Required Packages

GoAccess is developed in the C language, so it requires the ncurses library and gcc compiler to function. To install these, use the following command:

Console
sudo yum -y install ncurses-devel gcc

To include optional features, install additional packages using:

Console
sudo yum -y install geoip-devel tokyocabinet-devel

Step 3: Install GoAccess

To begin the installation, download the GoAccess archive file using the command below:

Console
wget http://tar.goaccess.io/goaccess-1.2.tar.gz

You can always get the most recent version from GoAccess's official download page.

Once downloaded, extract the contents of the archive:

Code
tar -xzvf goaccess-1.2.tar.gz

Navigate into the extracted directory, configure the build settings, and compile the software:

Console
cd goaccess-1.2
sudo ./configure --enable-utf8 --enable-geoip=legacy
sudo make
sudo make install

After the installation is complete, create a symbolic link to make GoAccess accessible from anywhere in the terminal:

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

GoAccess has now been successfully installed on your CentOS 7 server.

Step 4: Using GoAccess for Web Log Analysis

GoAccess serves as a web log analyzer. If you haven’t already configured a web server, you can install Apache by executing the command below:

Console
sudo yum -y install httpd

Enable and start the Apache service so it will launch automatically upon boot:

Console
sudo systemctl start httpd
sudo systemctl enable httpd

Allow HTTP traffic through the firewall to ensure web access is available:

Console
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload

To examine the log file directly from the terminal using GoAccess, run:

Console
sudo goaccess /var/log/httpd/access_log --log-format=COMBINED

After parsing the file, GoAccess will generate a live statistics report similar to the following:

 Dashboard - Overall Analyzed Requests (29/Jun/2017 - 29/Jun/2017)                               [Active Panel: Visitors]

  Total Requests  16 Unique Visitors  1  Unique Files 1 Referrers 0
  Valid Requests  16 Init. Proc. Time 0s Static Files 4 Log Size  3.92 KiB
  Failed Requests 0  Excl. IP Hits    0  Unique 404   6 Bandwidth 41.82 KiB
  Log Source      /var/log/httpd/access_log

 > 1 - Unique visitors per day - Including spiders                                                            Total: 1/1

 Hits      h% Vis.      v%   Bandwidth Data
 ---- ------- ---- ------- ----------- ----
 16   100.00%    1 100.00%   41.82 KiB 29/Jun/2017 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

   2 - Requested Files (URLs)                                                                                 Total: 1/1

 Hits      h% Vis.    v%   Bandwidth Mtd Proto    Data
 ---- ------- ---- ----- ----------- --- -------- ----
 2    100.00%    0 0.00%    9.56 KiB GET HTTP/1.1 /

   3 - Static Requests                                                                                        Total: 4/4

 Hits     h% Vis.     v%   Bandwidth Mtd Proto    Data
 ---- ------ ---- ------ ----------- --- -------- ----

 [?] Help [Enter] Exp. Panel  0 - Thu Jun 29 10:20:31 2017                                           [Q]uit GoAccess 1.2

To create an interactive HTML report, execute the following command:

Console
sudo goaccess /var/log/httpd/access_log --log-format=COMBINED -a -o /var/www/html/report.html

Conclusion

By following this guide, you’ve successfully installed and configured GoAccess on a CentOS 7 server. With this powerful tool, you can now analyze your web access logs in real-time, either via the command line or through a web-based report. Whether you're looking to monitor visitors, request patterns, or bandwidth usage, GoAccess provides an efficient and interactive way to visualize your server’s activity. This helps in optimizing performance, identifying issues, and understanding user behavior more effectively.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren