Please note, Countly will not provide support for Ubuntu 18 and CentOS/RHEL 7 anymore. However, support will be provided for Ubuntu 20 and 22; CentOS/RHEL 8 and 9. CentOS/RHEL 9 will be only supported OS for offline installations.
Please contact your account manager for more information.
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 Lite on your Ubuntu or CentOS server.
sudo su -
wget -qO- http://c.ly/install | bash
sudo su -
wget -qO- http://c.ly/install | bash -s dev
Method 2: Downloading via Github or package installation
As an alternative method, you can download Countly Lite via Github:
- Download main branch (recommended for technology preview installations)
- Download latest release (recommended for stable release installations)
Note: The source code of Countly Enterprise is not available to the public and is downloaded from Countly Enterprise's 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 3: Installation via Docker
We provide various Docker images suitable for both Countly Lite and Enterprise: 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:
- 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.
- Is your domain's SPF record correct? Test your SPF record here. Note that TXT is the correct official record type for SPF.
- Is your domain's DKIM record correct? This will significantly improve email deliverability. Test your DKIM record here.
- 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
- Rename this file (countly/extend/mail.example.js in your Countly directory) to countly/extend/mail.js.
- 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 Density, Nagios, 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.