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:

Installation Steps

  1. Open Terminal by pressing 'Command + Space' and typing 'Terminal'

  2. 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 node
    
  3. Clone 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-server
    
  4. Install the required Node.js packages for Countly using npm. Run the following command:

    npm install
    
  5. Install 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 mongodb
    
  6. Run MongoDB in the background by running the following command:

    mongod --fork --logpath /usr/local/var/log/mongodb/mongo.log --config /usr/local/etc/mongod.conf
    
  7. Create 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;
    
  8. Start Countly by running the following command:

    npm run start
    

    This 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!

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!