<commit_before># Installation

## Using the all-in-one Docker recipe

If you are running Docker and just want to get your own Kuzzle running, you can use the provided docker-compose file.

Prerequisites:

* [Docker](https://docs.docker.com/installation/#installation)
* [Docker Compose](https://docs.docker.com/compose/install/)

From Kuzzle's root directory:

    $ docker-compose up

### Reset Kuzzle with Docker recipe

If you need to get a fresh start with all persistent data erased, from Kuzzle's root directory:

    $ LIKE_A_VIRGIN=1 docker-compose up

### Reset Kuzzle and insert sorme fixtures with Docker recipe

If you need to get a fresh start with all persistent data erased and populate it with default fixtures, from Kuzzle's root directory:

    $ FIXTURES=path/to/the/fixtures/file.json docker-compose up

Remember that the fixtures must be in the Docker container scope !

### Initialize Kuzzle mapping with Docker recipe

If you need to add a default mapping on Kuzzle start, from Kuzzle's root directory:

    $ DEFAULT_MAPPING=path/to/the/mapping/file.json docker-compose up

Remember that the default mapping must be in the Docker container scope !

## Using Vagrant

If you are not running Docker on your system, for instance if you are running Windows or MacOs, you can pop a virtual machine to run Kuzzle.

Prerequisites:

* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
* [Vagrant](https://www.vagrantup.com/)

From the root directory:

    $ vagrant up

## From source or NPM

First of all, you have to get the source code. You can use NPM or clone our GIT repository.

* NPM

    ```
    $ npm install kuzzle
    ```

* GIT

    ```
    $ git clone https://github.com/kuzzleio/kuzzle.git
    $ cd kuzzle
    ```

## Manual install

### Default

Prerequisites:

* A service [RabbitMQ](https://www.rabbitmq.com/) running on localhost:5672
* A service [Elasticsearch](https://www.elastic.co/products/elasticsearch) running on localhost:9200
* A service [Redis](http://redis.io/) running on localhost:6379

```bash
$ kuzzle start
```

To get a list of available options, you can run:

```bash
$ kuzzle start -h
```

You may also start Kuzzle by using [PM2](https://github.com/Unitech/pm2):

```bash
$ pm2 start app-start.js
```

### Change RabbitMQ and Elasticsearch hosts

If you are not running RabbitMQ and Elasticsearch on localhost, you can configure host and port:

```bash
$ export ELASTICSEARCH_HOST=myelasticsearch:9200
$ export RABBIT_HOST=myrabbitmq:5672
$ kuzzle start
```<commit_msg>Update installation.md documentation : * remove RabbitMQ from prerequisites * update doc about how to change external services settings<commit_after># Installation

## Using the all-in-one Docker recipe

If you are running Docker and just want to get your own Kuzzle running, you can use the provided docker-compose file.

Prerequisites:

* [Docker](https://docs.docker.com/installation/#installation)
* [Docker Compose](https://docs.docker.com/compose/install/)

From Kuzzle's root directory:

    $ docker-compose up

### Reset Kuzzle with Docker recipe

If you need to get a fresh start with all persistent data erased, from Kuzzle's root directory:

    $ LIKE_A_VIRGIN=1 docker-compose up

### Reset Kuzzle and insert sorme fixtures with Docker recipe

If you need to get a fresh start with all persistent data erased and populate it with default fixtures, from Kuzzle's root directory:

    $ FIXTURES=path/to/the/fixtures/file.json docker-compose up

Remember that the fixtures must be in the Docker container scope !

### Initialize Kuzzle mapping with Docker recipe

If you need to add a default mapping on Kuzzle start, from Kuzzle's root directory:

    $ DEFAULT_MAPPING=path/to/the/mapping/file.json docker-compose up

Remember that the default mapping must be in the Docker container scope !

## Using Vagrant

If you are not running Docker on your system, for instance if you are running Windows or MacOs, you can pop a virtual machine to run Kuzzle.

Prerequisites:

* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
* [Vagrant](https://www.vagrantup.com/)

From the root directory:

    $ vagrant up

## From source or NPM

First of all, you have to get the source code. You can use NPM or clone our GIT repository.

* NPM

    ```
    $ npm install kuzzle
    ```

* GIT

    ```
    $ git clone https://github.com/kuzzleio/kuzzle.git
    $ cd kuzzle
    ```

## Manual install

### Default

Prerequisites:

* A service [Elasticsearch](https://www.elastic.co/products/elasticsearch) running on localhost:9200
* A service [Redis](http://redis.io/) running on localhost:6379

```bash
$ kuzzle start
```

To get a list of available options, you can run:

```bash
$ kuzzle start -h
```

You may also start Kuzzle by using [PM2](https://github.com/Unitech/pm2):

```bash
$ pm2 start app-start.js
```


### Change external services hosts

If you are some external service in another host than localhost, you can configure host and port

examples:

```bash
# Elastic Search (read/write engine):
$ export READ_ENGINE_HOST=myelasticsearch:9200
$ export WRITE_ENGINE_HOST=myelasticsearch:9200

# Redis (notification cache):
$ export NOTIFICATION_CACHE_HOST=myredis:6379

# Rabbit MQ (external broker for AMQP/MQTT/STOMP clients):
$ export MQ_BROKER_HOST=myrabbitmq
$ export MQ_BROKER_PORT=5672

$ kuzzle start
```
{'fraction_non_alphanumeric': 0.0914179104477612, 'fraction_numerical': 0.009701492537313432, 'mean_word_length': 4.14985590778098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 15, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6095802', 'n_tokens_mistral': 1778, 'n_tokens_neox': 1590, 'n_words': 620}