This guide walks through a self-hosted installation of GoAccess.
For Docker installation, see Docker.
For Debian/Ubuntu:
sudo apt-get update && sudo apt-get install -y goaccess
For RHEL/Fedora:
sudo yum install goaccess
# or for newer versions
sudo dnf install goaccess
For macOS:
brew install goaccess
# Download the latest version (v1.10.1)
wget https://tar.goaccess.io/goaccess-1.10.1.tar.gz
tar -xzvf goaccess-1.10.1.tar.gz
cd goaccess-1.10.1/
# Configure with common options (enable UTF-8 and GeoIP support)
./configure --enable-utf8 --enable-geoip=mmdb --with-zlib
make
sudo make install
# Generate a static HTML report
cat /path/to/access.log | docker run --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED - > report.html
# For real-time reports accessible via browser
tail -F /path/to/access.log | docker run -p 7890:7890 --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED --real-time-html -
Create a docker-compose.yml file:
version: '3.8'
services:
goaccess:
image: allinurl/goaccess:1.10.1 # Pin to specific version for stability
restart: unless-stopped
ports:
- "7890:7890" # Expose the WebSocket port for real-time updates
volumes:
- /var/log/nginx:/logs:ro # Mount your log directory
- ./config/goaccess.conf:/etc/goaccess/goaccess.conf:ro # Optional: custom config
command: >
goaccess
--log-format=COMBINED
--geoip-database=/usr/share/GeoIP/GeoLite2-City.mmdb
--real-time-html
--port=7890
--daemonize
Start the service:
docker-compose up -d
Generate an HTML report from a log file:
goaccess /var/log/nginx/access.log -o report.html --log-format=COMBINED
Run in terminal for real-time analysis:
goaccess /var/log/nginx/access.log
Monitor live log updates:
tail -f /var/log/nginx/access.log | goaccess - --log-format=COMBINED
Prefer automation? See GoAccess Ansible Setup for an example playbook.
Prefer containers? See GoAccess Docker Setup.
Any questions?
Feel free to contact us. Find all contact information on our contact page.