How to Install Fathom website analytics tool on Ubuntu / CentOS / Arch Linux

(: September 21, 2018)

In this blog post, you’ll learn to install and use the Fathom Analytics tool on Linux – Ubuntu 18.04 / Ubuntu 16.04 / CentOS 7 / Arch Linux e.t.c. Fathom Analytics is an open source, easy to use and more privacy-focused alternative to Google Analytics.

This tool will help you collect information on the internet about any web service, can be for service/content improvement, historical analytics e.t.c. Your data and all users’ privacy are kept private by this free tool. Furthermore, Fathom respects the privacy of your users and does not collect any personally identifiable information.

How to Install Fathom website analytics tool on Linux

Download the latest release of Fathom with wget{text-align:left} img{margin:0 auto 0 0}
wget -O fathom

Make the file executable

chmod +x fathom

Move the binary file to  /usr/local/bin directory

sudo mv fathom /usr/local/bin

Use option--help to print help page.

$ fathom --help 

INFO[0000] Fathom 1.0.1                                 
   Fathom - simple & transparent website analytics

   fathom [global options] command [command options] [arguments...]


     server, s  start the fathom web server
     register   register a new admin user
     stats      view stats
     help, h    Shows a list of commands or help for one command

   --config FILE, -c FILE  Load configuration from FILE (default: ".env")
   --help, -h              show help
   --version, -v           print the version

How to Use Fathom

Before you can start using Fathom, you need to register your user account

$ fathom register --email=<email> --password=<password>

Sample output

NFO[0000] Fathom 1.0.1                                 
WARN[0000] Error reading configuration. File `.env` does not exist. 
INFO[0000] Connected to sqlite3 database: /home/jmutai/fathom.db?_loc=auto 
INFO[0000] Created user [email protected]

Read more about Fathom Configuration file to understand all possible configuration values.

Starting the Fathom web server

Create a  .env configuration file named with the following contents.


Once you have Fathom configured, you can start Fathom web server using the command fathom server.

fathom server

This should start serving up a website on port 9000 using an SQLite database file named fathom.db.

Manage Service with systemd

To ensure the Fathom web server starts on the system reboot, we should use Systemd.

Create a new file called /etc/systemd/system/fathom.service with the following contents. Replace $USER with your actual username.

Description=Fathom server management service unit

ExecStart=/usr/local/bin/fathom server


Reload the Systemd configuration and enable the service start on boot.

sudo systemctl daemon-reload
sudo systemctl enable fathom.service

Start Fathom web server by issuing the following command.

sudo systemctl start fathom.service

The service should start and switch to a running status.

Open the link http://server-ip-address-here:9000 to access Fathom dashboard.

Running Fathom with NGINX

Install nginx on CentOS

sudo yum install epel-release
sudo yum install nginx

Install nginx  on Ubuntu / Debian

sudo apt-get install nginx

Install nginx Arch

sudo pacman -S nginx

We then use NGINX to redirect all traffic for a certain domain to our Fathom application running on port 9000 by using the directiveproxy_pass.

Create the following file in /etc/nginx/conf.d/fathom.conf


server {

	location / {
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $remote_addr;
		proxy_set_header Host $host;

Test configuration syntax and restart nginx

sudo nginx -t
sudo systemctl enable nginx
sudo systemtl restart nginx

Open the link to access the Fathom dashboard.

Login with the configured email address and password

Tracking snippet

To start tracking, include the following JavaScript on your site and replace with the URL to your Fathom instance.

<!-- Fathom - simple website analytics - -->
(function(f, a, t, h, o, m){
	o.async=1; o.src=t;'fathom-script';
})(document, window, '//', 'fathom');
<!-- / Fathom -->

For a WordPress website, use Fathom WordPress Plugin

  1. In your WordPress admin panel, go to Plugins > New Plugin, search for Fathom Analytics and click “Install now

2. Alternatively, download the plugin and upload the contents of to your plugins directory, which usually is /wp-content/plugins/.

After installing and activating this plugin, go to Settings > General and enter the URL to your Fathom instance in the text field near the bottom.

After a few minutes, the analytics should start showing.

Thanks for using our guide to setup your personal analytics engine powered by Fathom. For any query drop a comment and I’ll be happy to respond.{text-align:left} img{margin:0 auto 0 0}