Setting up the environment to install kurukshetra

Before installing kurukshetra, we have to configure the environment so that all the installation prerequisites are taken care of.

Supported Platforms

Kurukshetra has been tested both on Ubuntu/Debian (apt-get based distros) and Mac OS. It should ideally work with any linux based distributions with PHP 7.2, MySQL and Docker (along with remote API enabled) installed.

Prerequisites:

There are a few packages which are necessary before proceeding with the installation:

Installing PHP 7.2

In ubuntu, the following commands can be run to install PHP 7.2 along with all the necessary extensions:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

# Installing php7.2 along with MySQL and other dependencies
sudo apt-get install php7.2 php7.2-curl php7.2-mbstring php7.2-mysql mysql-server

Read the official instructions on how to install PHP on other distributions.

Installing Docker

In ubuntu, following commands can be run to install Docker (add the GPG key from official repository and install it):

# add the GPG key for the official Docker repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Add the Docker repository to APT sources
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# Update and install docker-ce
sudo apt-get update
sudo apt-get install -y docker-ce

Enabling Docker Remote API:

# Add the following lines to **/etc/systemd/system/docker.service.d/override.conf**
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2376

Read the official installation guide for installing on other distributions.

Configuring directories

Create a folder /var/config/ with write permission to www-data user. All the config files will be saved under this directory which will contain the MySQL credentials and Google OAuth credentials.

# Create the directory
sudo mkdir /var/config

# Make www-data the owner of the directory
sudo chown www-data: /var/config

Now kurukshetra can be installed via the browser by logging onto http://127.0.0.1/.

Tags: