##### License Terms

For the use of Rasa X the [Rasa X License Terms](https://storage.googleapis.com/rasa-x-releases/rasa_x_ce_license_agreement.pdf) apply.
For the use of Rasa Enterprise the [Rasa Enterprise License Terms](https://storage.googleapis.com/rasa-x-releases/rasa_x_ee_license_agreement.pdf) 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](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#requirements).
For other operating systems, you can install Rasa X via Docker Compose manually.

## Requirements [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#requirements "Direct link to heading")

##### 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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#hardware--os-requirements "Direct link to heading")

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

|  |  |  |
| --- | --- | --- |
|  | [Install Script](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#docker-compose-install-script) | [Manual Installation](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#docker-compose-manual-install) |
| **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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#port-requirements "Direct link to heading")

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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#supported-browsers "Direct link to heading")

The web interface aims to support [browsers that meet the following criteria](https://browserl.ist/?q=%3E0.2%25%2Cnot+ie+%3C%3D+11%2Cnot+op_mini+all):

- > 0.2% market share
- not Internet Explorer
- not Opera Mini

## Docker Compose Install Script [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#docker-compose-install-script "Direct link to heading")

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](https://www.youtube.com/watch?v=IUYdwy8HPVc) [Rasa](https://www.youtube.com/channel/UCJ0V6493mLvqdiVwOKWBODQ)

### 1. Download [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#1-download "Direct link to heading")

Download the install script on the server:

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

##### installing edge vs. stable

The above command downloads the install script for the latest stable release of Rasa X.
To download the install script for the latest edge release of Rasa X, run the following instead:

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

### 2. Install [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#2-install "Direct link to heading")

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

```bash
sudo bash ./install.sh
```

##### note

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

```bash
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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#3-start "Direct link to heading")

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

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

### 4. Access [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#4-access "Direct link to heading")

Set your admin password:

```bash
cd /etc/rasa
sudo python rasa_x_commands.py --update create admin <USER><PASSWORD>
```

Unless the `RASA_X_USERNAME` environment variable was configured, the value of `<USER>` should be set to `admin.

While using Rasa Enterprise, you can use this command on the server to create a new admin account at any time, by removing the `--update` argument.
See [Role-Based Access Control](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/enterprise/role-based-access-control) for more information about assigning and configuring user permissions.

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

### 5. **Optional**: Activate Rasa Enterprise [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#5-optional-activate-rasa-enterprise "Direct link to heading")

Rasa X can be upgraded to **Rasa Enterprise** by uploading a valid license. To learn how to do this, please visit the [Product Activation](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/enterprise/activation) section.

## Docker Compose Manual Install [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#docker-compose-manual-install "Direct link to heading")

We provide template docker-compose files which you can use directly.
The Docker images for Rasa X are freely available via Docker Hub.
The images for Rasa Enterprise are hosted on a private registry and are accessible with an enterprise license.
If you have a Rasa Enterprise license, please see the Enterprise instructions where applicable.

### 1. Prerequisites [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#1-prerequisites "Direct link to heading")

Make sure `python3`, `docker`, and `docker-compose` are installed on your server. Detailed instructions can be found in the [Docker documentation](https://docs.docker.com/install/).

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

```bash
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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#2-set-project-directory "Direct link to heading")

Create the project directory and switch to it:

```bash
mkdir /etc/rasa
cd /etc/rasa
```

### 3. Download [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#3-download "Direct link to heading")

Download the Rasa X docker-compose and commands files:

```bash
wget -qO docker-compose.yml https://storage.googleapis.com/rasa-x-releases/1.0.4/docker-compose.yml
wget -qO rasa_x_commands.py https://storage.googleapis.com/rasa-x-releases/1.0.4/rasa_x_commands.py
```

Also download the Nginx configuration files:

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

### 4. Configure [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#4-configure "Direct link to heading")

#### Docker Environment File [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#docker-environment-file "Direct link to heading")

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

```bash
# rasax specific settings
RASA_X_VERSION="1.0.4"
RASA_VERSION="2.8.31-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
```

##### installing edge vs. stable

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

You can also choose any compatible Rasa X and Rasa Open source versions according to the [Compatibility Matrix](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/changelog/compatibility-matrix).

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`:

```bash
openssl rand -base64 16
```

For more information about these environment variables and others used by Rasa X, see [Environment Variables](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/customize#adding-environment-variables).

##### note

The `PASSWORD_SALT` is used to hash passwords. If you change this variable after setting it, you will have to create new logins for each of your users.

#### Credentials [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#credentials "Direct link to heading")

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

```yaml
rasa:
  url: ${RASA_X_HOST}/api
```

These are the credentials used for messaging with the bot via the Rasa X UI. You can also add credentials for other [messaging and voice channels](/content/docs/rasa/user-guide/messaging-and-voice-channels/index.html) such as your custom connector or the REST input channel.

#### Endpoints [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#endpoints "Direct link to heading")

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

```yaml
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:""
```

If you want to know more about the environment variables used here, see [Environment Variables](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/customize#adding-environment-variables).

#### Deployment Environments [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#deployment-environments "Direct link to heading")

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

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

If you plan on using Rasa Enterprise, you can also add further environments as described in [Deployment Environments](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/enterprise/deployment-environments).

#### Mounted Directories [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#mounted-directories "Direct link to heading")

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

```bash
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 [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#permissions-on-mounted-directories "Direct link to heading")

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:

- `/etc/rasa/credentials.yml`
- `/etc/rasa/endpoints.yml`
- `/etc/rasa/environments.yml`
- `/etc/rasa/auth`
- `/etc/rasa/certs`
- `/etc/rasa/credentials`
- `/etc/rasa/models`
- `/etc/rasa/logs`

To set the permissions and group for everything in `/etc/rasa` you can use this command, but make sure to correct it for the `/etc/rasa/db` directory as described in the next step:

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

If you are mounting different or extra directories, please adapt their permissions accordingly.

#### Postgres Database Storage [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#postgres-database-storage "Direct link to heading")

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:

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

#### (Optional) Custom Action Server [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#optional-custom-action-server "Direct link to heading")

If you are using custom actions, make sure to follow the instructions to [connect a custom action server](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/customize#adding-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:

```bash
RASA_X_DEMO_VERSION=<rasa_x_version>
```

### 5. Start [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#5-start "Direct link to heading")

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

```bash
sudo docker-compose up -d
```

### 6. Access [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#6-access "Direct link to heading")

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

```bash
sudo python rasa_x_commands.py create --update admin <USER><PASSWORD>
```

Unless the `RASA_X_USERNAME` environment variable was configured, the value of `<USER>` should be set to `admin.

While using Rasa Enterprise, you can use this command on the server to create a new admin account at any time, by removing the `--update` argument. See [Role-Based Access Control](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/enterprise/role-based-access-control) for more information about assigning and configuring user permissions.

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

### 7. **Optional**: Activate Rasa Enterprise [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#7-optional-activate-rasa-enterprise "Direct link to heading")

## Next Steps [#](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/install/docker-compose/#next-steps "Direct link to heading")

- [Deploy your assistant](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/deploy#how-to-deploy) using Rasa X.
- [Set up Integrated Version Control](https://legacy-docs-enterprise.rasa.com/docs/rasa-enterprise/1.0.x/installation-and-setup/deploy#integrated-version-control) to connect your Rasa X instance to a remote Git repository.
