Installing the Countly Server

Follow

Requirements

Countly needs to be installed on a Linux server (see system requirements for more information). By default, the webserver will run on port 80 or 443 (for HTTPS), so it is essential to ensure that those ports are free and unblocked (as in the case of Amazon AWS).

Ubuntu Flavors

Ubuntu flavors (eg. Kubuntu, Lubuntu) are not supported.

Method 1: One liner installation

The following command will download and install the Countly Community Edition on your Ubuntu or CentOS server.

Latest Stable Development
sudo su - 
wget -qO- http://c.ly/install | bash

Method 2: One-click installation via Digital Ocean

If you have a Digital Ocean account and would like to install Countly Community Edition, create a droplet using this link. Once you select a plan and a datacenter region, your Countly instance is ready to go!

Method 3: Downloading via Github or package installation

As an alternative method, you can download Countly Community Edition via Github:

Note: The Enterprise Edition’s source code is not available to the public and is downloaded from the Enterprise Edition customer private repository. However, installation procedures for both editions is the same as follows:

Extract the Countly package to the directory of your taste (e.g. under /usr) - do not use the /root folder for this purpose. Then, fire the easy installation script that comes with Countly, which will work for both Ubuntu and RHEL/CentOS:

sudo su - 
cd COUNTLY_INSTALLATION_DIRECTORY/bin
bash countly.install.sh

Using SELinux

Countly may not work on a server where SELinux is enabled (blocking Nginx and its ports), so you must add those as exceptions or disable SELinux. In order to disable SELinux, run "setenforce 0".

Installation will take between 10-15 minutes. Using your browser, go to http://YOUR_SERVER_IP_OR_DOMAIN in order to create your admin account and login to your dashboard. Also, do not forget to download the client SDKs.

64-bit support only

Due to MongoDB and 32-bit limitations, we only support new installations on 64-bit servers.

Running Countly from a Subdirectory

It is also possible to run Countly from a subdirectory. Follow these instructions for configuration.

Method 4: Installation via Docker

We provide various Docker images suitable for both Countly Community Edition and Countly Enterprise Edition: standard Docker installations and Kubernetes clusters. Please, refer to the Docker & Kubernetes page for further information.

Configure DNS

While the Countly server will work without a DNS, it's suggested that you assign a DNS A record to your server, so you won’t have to memorize an IP address, such as countly.yourserver.com.

Configure Email Delivery

Due to potential spam issues, you need to ensure that you configure your DNS records (explained below), so that emails sent from Countly (e.g. when you add a new user or daily/weekly email reports) can be sent and not caught by SPAM preventions.

Here are a few important things you should check first:

  1. Ensure your ISP has a reverse DNS record entered to associate the domain names and IP addresses from which you send mail. Test your Reverse PTR record here. If your ISP does not enter the proper reverse DNS pointer record, it's very unlikely any of your emails will be delivered.
  2. Is your domain's SPF record correct? Test your SPF record here. Note that TXT is the correct official record type for SPF.
  3. Is your domain's DKIM record correct? This will significantly improve email deliverability. Test your DKIM record here.
  4. If you run your own mail server, check to ensure your mail server IPs are not on any email blacklists. Also, verify that it is definitely sending a fully qualified hostname that resolves in DNS in its HELO message. If not, this will cause your email to be rejected by many mail services.

We highly recommend you send a test email to mail-tester.com to verify that everything mentioned above is working correctly.

Using a Third-party Email Server

  1. Rename this file (countly/extend/mail.example.js in your Countly directory) to countly/extend/mail.js.
  2. Add your email server information. An example has been provided below:
module.exports = function(mail){
    //define this if you need to send email from some third party service
    mail.smtpTransport = nodemailer.createTransport(smtpTransport({
        host: "example-mailserver-host.com",
        secureConnection: true,
        port: 2525,
        auth: {
            user: "your-mailserver-username",
            pass: "your-mailserver-password"
        }
    }));

Configure Server Monitoring

When your server has a problem (e.g. lack of enough RAM, lack of swap space, running out of disk, etc.), chances are that Linux kernel will kill some of the processes or Countly won't work properly. In order to ensure you have a healthy and stable server, we suggest using a monitoring and alerting solution, such as Server DensityNagios, or New Relic.

Monitoring Metrics

CPU and Memory (both in Countly and MongoDB Servers)

We don't have any specific threshold for CPU and memory so you can try to start with your team's standard threshold. However, note that you may get false positives most of the times since the CPU on Countly servers and the memory on MongoDB servers could cause usage spikes with resource-hungry, short-term features - like Push - or increasing incoming requests on an app.

Boot Disk (both in Countly and MongoDB Servers)

Customers can set a threshold for a boot disk based on the capacity of the boot disk and the response time of the IT team. Alerts for boot disk monitoring shouldn't be triggered if everything is OK with log rotations.
Note: You may need to enlarge the boot disk over time for Countly servers if Crash Symbolication is enabled.

Data Disk (MongoDB Servers)

We always suggest a size for data disks in MongoDB servers based on the customers' usage plan and data retention policy but consider that the capacity needs for data disks are open to change since business choices may change over time.

Suggested thresholds are 5GB space for disks <= 100GB & 15GB space for disks > 100GB. Again, the customer can tune it based on the response time of the IT team.

'mongod' Process (MongoDB Servers)

MongoDB, for sure, must be running all the time. Having a failing MongoDB service over and over again may indicate an issue on the system such as kernel limits, etc. MongoDB should be restarted immediately and the infra team should inspect the server and logs for the root cause of service interruption. You can integrate this command into your monitoring system if you don't have any MongoDB-specific helper on your system. You can also check the exit code of this command; MongoDB is running if it is 0 and not running if it is 1.

ps aux | grep -v grep | grep -q /usr/bin/mongod

Making Countly More Secure

We have a list of security and privacy recommendations, together with guidelines, on how to ensure secure deployment. Read more here.

Was this article helpful?
0 out of 0 found this helpful

Looking for help?