How to Install Countly Community Edition on macOS
Countly is an open-source analytics platform that helps businesses track and analyze their mobile and web app usage. In this tutorial, we'll be explaining how to install Countly's Community Edition on macOS.
Prerequisites
Before we begin, please make sure that your system meets the following minimum requirements:
- MacOS 10.12 or later
- At least 4 GB of RAM
- 2 CPU cores
- Node.js
Installation Steps
Open Terminal by pressing 'Command + Space' and typing 'Terminal'
Install Node.js using either Homebrew or directly from the Node.js website. Here is an example of how to install Node.js with Homebrew:
brew install nodeClone the Countly repository from GitHub and navigate to the cloned directory. To do this, run the following commands in your Terminal:
git clone https://github.com/Countly/countly-server.git cd countly-serverInstall the required Node.js packages for Countly using npm. Run the following command:
npm installInstall MongoDB on your system using either Homebrew or by downloading the package from the MongoDB official website. Here is an example of how to install MongoDB with Homebrew:
brew install mongodbRun MongoDB in the background by running the following command:
mongod --fork --logpath /usr/local/var/log/mongodb/mongo.log --config /usr/local/etc/mongod.confCreate a new file called "config.js" in the "config" directory of the Countly directory (/countly-server/config/config.js) and paste the following code inside it:
var countlyConfig = { mongodb: { host: "localhost", db: "countly", port: 27017, max_pool_size: 500, user: "", password: "" }, api: { port: 3001, host: "localhost", max_sockets: 1024 }, path: "", cdn: "", logging: { info: ["jobs", "dashboard"], default: "warn", path: "" }, web: { port: 6001, session_timeout: 3600, enable_sessions: true, session_name: "countly_web_session", secure_cookies: false, require_ssl: false, use_intercom: false, city_data: true, default_timezone: "Asia/Kolkata", metric_change: "percent", metric_period: 30, metric_limit: 3, session_cooldown: 15, max_views: 1000, max_custom_events: 50, max_query_params: 200, show_realtime_notification: true, multisite: false } }; module.exports = countlyConfig;Start Countly by running the following command:
npm run startThis will launch Countly on your local machine on port 6001, which you can access by visiting "http://localhost:6001" in your browser.
Congratulations, you have successfully installed Countly Community Edition on your macOS machine. Happy analyzing!