How to Install Countly Analytics on Ubuntu 16.10

Using a Different System?

  • How to Install Countly Analytics on CentOS 7

Are we missing a guide for your target system? Request one, or submit your own!

Countly is an open source web/mobile analytics and marketing platform. It comes with numerous features for collecting data from web, mobile, or game applications. It provides real time data updates and includes a plug-in based system. In this tutorial we will install Countly server on Ubuntu 16.10.


  • A Vultr 64-bit Ubuntu 16.10 server instance with atleast 2GB RAM.
  • A sudo user.

Step 1: Perform a system update

Before installing any packages on the Ubuntu server instance, it is recommended to update the system. Login using the sudo user and run the following commands to update the system.

sudo apt-get updatesudo apt-get -y upgrade

Step 2: Install Countly server

Countly server can be installed directly using the following command.

sudo apt-get install unzipsu -c "wget -qO- | bash"

The above command will download and install all of the required dependencies as well as the Countly server software.

Step 3: Secure server with Let’s Encrypt SSL

Before installing Let’s Encrypt, you must have a domain or subdomain pointed towards your IP address. Run the following commands to install Certbot on your system.

sudo add-apt-repository ppa:certbot/certbotsudo apt-get updatesudo apt-get -y install certbot

Initiate the Certbot script to obtain SSL certificates for you. Make sure to replace all occurrences of with your actual domain name. Also replace <user_name> with the current username.

sudo certbot certonly --webroot -w /home/<user_name>/countly/frontend/express/public -d

The above command will ask for your email address and will generate the SSL certificates for

Generate strong Diffie-Hellman parameters using following command.

sudo openssl dhparam -outform pem -out /etc/letsencrypt/live/ 2048

Now you will need to modify the default Nginx configuration so that your website can be accessible using HTTPS. Run the following command to edit the default Nginx configuration file.

sudo nano /etc/nginx/sites-available/default

Replace the existing configuration with the following.

server {    listen 80;    return 301 https://$host$request_uri;}server {    listen   443;    server_name  localhost;    access_log  off;    ssl on;    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;    ssl_prefer_server_ciphers on;    ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !EXP !PSK !SRP !CAMELLIA !SEED';    ssl_session_cache builtin:1000 shared:SSL:10m;    ssl_stapling on;    ssl_dhparam /etc/letsencrypt/live/;    ssl_certificate /etc/letsencrypt/live/;    ssl_certificate_key /etc/letsencrypt/live/;    location = /i {        proxy_pass;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-Real-IP $remote_addr;    }    location ^~ /i/ {        proxy_pass;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-Real-IP $remote_addr;    }    location = /o {        proxy_pass;    }    location ^~ /o/ {        proxy_pass;    }    location / {        proxy_pass;        proxy_set_header Host $http_host;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-Real-IP $remote_addr;    }}

Now restart the Countly server and the Nginx web server.

sudo countly restartsudo systemctl restart nginx

The installation of Countly Server is now finished, you can access the dashboard on the following address.

You will be asked to create an administrator account as soon as you open the above link in browser. Once the administrator account has been created, you will be asked to add a new application into Countly for data collection. Enjoy your new Countly server!

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article

No comments

Powered by Blogger.