Docker Compose Installation

Rasa X version 0.33.0 or higher is only compatible with Rasa Open Source 2.x. If you are on Rasa Open Source 1.x, please check the compatibility matrix for a compatible version.

License Terms

For the use of Rasa X the Rasa X License Terms apply. For the use of Rasa Enterprise the Rasa Enterprise License Terms apply.

In this installation method, Rasa X is deployed on a server as a set of Docker containers.

An install script is available for servers that meet the hardware and OS requirements. For other operating systems, you can install Rasa X via Docker Compose manually.

Requirements #

note

Rasa X is intended to be deployed on a server and not to a personal/local machine. Deploying on a server is recommended because Rasa X is designed to stay up continuously, and not to be frequently stopped or restarted.

Hardware & OS Requirements #

Here are the minimum and recommended hardware specs and OS requirements:

Install Script Manual Installation
Operating System Ubuntu 18.04 / 20.04 Debian 9 / 10 CentOS 7 / 8 RHEL 8 a modern Linux or Windows distribution that can run Docker
vCPUs Minimum: 2 vCPUs Recommended: 2-6 vCPUs
RAM Minimum: 4 GB RAM Recommended: 8 GB RAM
Disk Space * Recommended: 100 GB disk space available

Port Requirements #

When creating the server, make sure the following ports of are open:

Port Service Description
22 SSH SSH access.
80 HTTP Web application access.
443 HTTPS Web application over HTTPS access (optional)

Supported Browsers #

The web interface aims to support browsers that meet the following criteria:

Docker Compose Install Script #

Watch the Rasa Masterclass video below to follow along with the install script instructions:

(Ep #9 - Rasa Masterclass) Improving the assistant: Setting up the Rasa X | Rasa 1.8.0 - YouTube

(Ep #9 - Rasa Masterclass) Improving the assistant: Setting up the Rasa X | Rasa 1.8.0

1. Download #

Download the install script:

On the server, download the install script for the latest stable version:

curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/0.42.6/install.sh

To download the latest edge version instead, download the script with the latest tag:

curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/latest/install.sh

2. Install #

To install all of the files into the default folder, /etc/rasa, run:

sudo bash ./install.sh

To choose your own installation folder instead of /etc/rasa, set the RASA_HOME environment variable:

export RASA_HOME=~/rasa/dir
sudo -E bash ./install.sh  # -E will preserve the environment variable you set

Replace /etc/rasa with ${RASA_HOME} in further commands.

3. Start #

Start up Rasa X and wait until all containers are running (-d will run Rasa X in the background):

cd /etc/rasa
sudo docker-compose up -d

4. Access #

Set your admin password:

cd /etc/rasa
sudo python3 rasa_x_commands.py create --update admin me <PASSWORD>

Navigate to the hostname or IP where your server is reachable and log in using your newly created password.

Docker Compose Manual Install #

We provide template docker-compose files which you can use directly. The Docker images for Rasa X are freely available via Docker Hub.

1. Prerequisites #

Make sure python3, docker, and docker-compose are installed on your server. Detailed instructions can be found in the Docker documentation.

You should be able to run the following command(s):

python3 --version && docker -v && docker-compose -v

Note that your python version should be above 3.6 to use Rasa and Rasa X.

2. Set Project Directory #

Create the project directory and switch to it:

mkdir /etc/rasa
cd /etc/rasa

3. Download #

Download the Rasa X docker-compose and commands files:

wget -qO docker-compose.yml https://storage.googleapis.com/rasa-x-releases/0.42.6/docker-compose.ce.yml
wget -qO rasa_x_commands.py https://storage.googleapis.com/rasa-x-releases/0.42.6/rasa_x_commands.py

Also download the Nginx configuration files:

mkdir nginx-config-files
wget -qO nginx-config-files/nginx.conf https://storage.googleapis.com/rasa-x-releases/0.42.6/nginx-config-files/nginx.conf
wget -qO nginx-config-files/ssl.conf.template https://storage.googleapis.com/rasa-x-releases/0.42.6/nginx-config-files/ssl.conf.template
wget -qO nginx-config-files/rasax.nginx.template https://storage.googleapis.com/rasa-x-releases/0.42.6/nginx-config-files/rasax.nginx.template

4. Configure #

Docker Environment File #

Create the docker environment file .env in your project directory with the following content:

# rasax specific settings

RASA_X_VERSION="0.42.6"
RASA_VERSION="2.8.14-full"
RASA_TOKEN=<random_string>
RASA_X_TOKEN=<random_string>
PASSWORD_SALT=<random_string>
JWT_SECRET=<random_string>
RABBITMQ_PASSWORD=<random_string>
DB_PASSWORD=<random_string>
REDIS_PASSWORD=<random_string>
RASA_TELEMETRY_ENABLED=false

The RASA_X_VERSION="0.42.6" tag will install the latest stable release of Rasa X. If you prefer the latest edge release of Rasa X, set RASA_X_VERSION="latest".

For each <random_string> please use a distinct, randomly generated, secure character sequence for each variable. A convenient way of generating random strings is using openssl:

openssl rand -base64 16

Credentials #

Create a credentials file credentials.yml in your project directory containing:

rasa:
  url: ${RASA_X_HOST}/api

Endpoints #

Create an endpoints file endpoints.yml in your project directory containing:

models:
  url: ${RASA_MODEL_SERVER}
  token: ${RASA_X_TOKEN}
  wait_time_between_pulls: ${RASA_MODEL_PULL_INTERVAL}
tracker_store:
  type: sql
  dialect: "postgresql"
  url: ${DB_HOST}
  port: ${DB_PORT}
  username: ${DB_USER}
  password: ${DB_PASSWORD}
  db: ${DB_DATABASE}
  login_db: ${DB_LOGIN_DB}
lock_store:
  type: "redis"
  url: ${REDIS_HOST}
  port: ${REDIS_PORT}
  password: ${REDIS_PASSWORD}
  db: ${REDIS_DB}
cache:
  type: "redis"
  url: ${REDIS_HOST}
  port: ${REDIS_PORT}
  password: ${REDIS_PASSWORD}
  db: ${REDIS_CACHE_DB}
event_broker:
  type: "pika"
  url: ${RABBITMQ_HOST}
  username: ${RABBITMQ_USERNAME}
  password: ${RABBITMQ_PASSWORD}
  queues:
    - ${RABBITMQ_QUEUE}
action_endpoint:
  url: ${RASA_USER_APP}/webhook
  token: ""

Deployment Environments #

Create an environments file at environments.yml in your project directory containing:

rasa:
  production:
    url: http://rasa-production:5005
    token: ${RASA_TOKEN}
  worker:
    url: http://rasa-worker:5005
    token: ${RASA_TOKEN}

Mounted Directories #

Create a few empty folders that we will mount into the containers:

mkdir /etc/rasa/auth
mkdir /etc/rasa/certs
mkdir /etc/rasa/credentials
mkdir /etc/rasa/models
mkdir /etc/rasa/logs
mkdir /etc/rasa/db

Permissions on Mounted Directories #

Set group and permissions of the mounted directories:

The Rasa containers are following Docker’s best practices and are not running as root user. Hence, please make sure that the root group has read and write access to the following directories and their content:

To set the permissions and group for everything in /etc/rasa you can use this command:

sudo chgrp -R root /etc/rasa/* && sudo chmod -R 770 /etc/rasa/*

Postgres Database Storage #

Configure persistent Postgres database storage

On Linux, a local directory is used for persistent Postgres database storage.

You must set the correct owner and permissions of the database persistence directory using this command:

sudo chown -R 1001 /etc/rasa/db && sudo chmod -R 750 /etc/rasa/db

(Optional) Custom Action Server #

If you are using custom actions, make sure to follow the instructions to connect a custom action server.

If you don’t want to configure custom actions yet, make sure to add this variable to your .env to use the demo app image:

RASA_X_DEMO_VERSION=<rasa_x_version>

5. Start #

Start up Rasa X and wait until all containers are running (-d will run Rasa X in the background):

sudo docker-compose up -d

6. Access #

Set your admin password with this command from your project directory:

sudo python rasa_x_commands.py create --update admin me <PASSWORD>

Navigate to the hostname or IP where your server is reachable and log in using your newly created password.