latest version of Fathom Analytics<\/a>.<\/p>\r\n\r\n\r\n\r\n# cd \/tmp\r\n# wget https:\/\/github.com\/usefathom\/fathom\/releases\/download\/v1.2.1\/fathom_1.2.1_linux_amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nNow, extract the downloaded file.<\/p>\r\n\r\n\r\n\r\n
# tar -xzvf fathom_1.2.1_linux_amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nThen, move the executable file.<\/p>\r\n\r\n\r\n\r\n
# mv fathom \/usr\/local\/bin\/<\/pre>\r\n\r\n\r\n\r\nRun this command below to check the Fathom version we have on the server.<\/p>\r\n\r\n\r\n\r\n
# fathom --version<\/pre>\r\n\r\n\r\n\r\nYou will get an output like this:<\/p>\r\n\r\n\r\n\r\n
Fathom version 1.2.1, commit 8f7c6d2e45ebb28651208e2a7320e29948ecdb2c, built at 2018-11-30T09:21:37Z<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 6. Run Fathom<\/span><\/h2>\r\n\r\n\r\n\r\nIn the previous step, we created a system user called ‘fathom’, and we will use this user to run Fathom Analytics.<\/p>\r\n\r\n\r\n\r\n
# sudo -u fathom bash
$ cd \/opt\/fathom<\/pre>\r\n\r\n\r\n\r\nAfter entering the directory, we can create a new environment file.<\/p>\r\n\r\n\r\n\r\n
$ nano .env<\/pre>\r\n\r\n\r\n\r\nPaste the following into the file.<\/p>\r\n\r\n\r\n\r\n
FATHOM_SERVER_ADDR=9000\r\nFATHOM_GZIP=true\r\nFATHOM_DEBUG=true\r\nFATHOM_DATABASE_DRIVER=\"mysql\"\r\nFATHOM_DATABASE_NAME=\"fathom\"\r\nFATHOM_DATABASE_USER=\"fathom\"\r\nFATHOM_DATABASE_PASSWORD=\"m0d1fyth15\"\r\nFATHOM_DATABASE_HOST=\"localhost\"\r\nFATHOM_SECRET=\"your_secret_string_change_it_to_a_sronger_string\"<\/pre>\r\n\r\n\r\n\r\nSave the file, exit, then run this command<\/p>\r\n\r\n\r\n\r\n
$ fathom user add --email=\"master@yourdomain.com\" --password=\"m0d1fyth15\"<\/pre>\r\n\r\n\r\n\r\nReplace the email address and password with your own credentials.<\/p>\r\n\r\n\r\n\r\n
This is the first time you\u2019re running fathom with the database configured. You will see an output like this:<\/p>\r\n\r\n\r\n\r\n
INFO[0000] Fathom version 1.2.1, commit 8f7c6d2e45ebb28651208e2a7320e29948ecdb2c, built at 2018-11-30T09:21:37Z
INFO[0000] Configuration file: \/opt\/fathom\/.env
INFO[0000] Connected to mysql database: fathom on localhost
INFO[0000] Applied 24 database migrations!
INFO[0000] Created user master@yourdomain.com<\/pre>\r\n\r\n\r\n\r\nNow, you can run Fathom by invoking this command.<\/p>\r\n\r\n\r\n\r\n
$ fathom server<\/pre>\r\n\r\n\r\n\r\nfathom@instance-1:~$ fathom server
INFO[0000] Fathom version 1.2.1, commit 8f7c6d2e45ebb28651208e2a7320e29948ecdb2c, built at 2018-11-30T09:21:37Z
INFO[0000] Configuration file: \/opt\/fathom\/.env
INFO[0000] Connected to mysql database: fathom on localhost
INFO[0000] Server is now listening on :9000<\/pre>\r\n\r\n\r\n\r\nYou can check Fathom from your other SSH session with this command below:<\/p>\r\n\r\n\r\n\r\n
$ curl localhost:9000<\/pre>\r\n\r\n\r\n\r\nYou will see an output like this:<\/p>\r\n\r\n\r\n\r\n
<!DOCTYPE html>\r\n<html class=\"no-js\" lang=\"en\">\r\n<head>\r\n <title>Fathom - simple website analytics<\/title>\r\n <link href=\"assets\/css\/styles.css?t=1543569696966\" rel=\"stylesheet\">\r\n <meta charset=\"utf-8\">\r\n <meta name=\"referrer\" content=\"no-referrer\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <link rel=\"icon\" type=\"image\/png\" sizes=\"32x32\" href=\"assets\/img\/favicon.png\">\r\n<\/head>\r\n<body class=\"fathom\">\r\n <div id=\"root\"><\/div>\r\n <noscript>To use Fathom, please enable JavaScript.<\/noscript> \r\n <script>\r\n document.documentElement.className = document.documentElement.className.replace('no-js', '');\r\n <\/script>\r\n <script src=\"assets\/js\/script.js?t=1543569696966\"><\/script>\r\n<\/body>\r\n<\/html><\/pre>\r\n\r\n\r\n\r\n