# Installing RabbitMQ

Before installing RabbitMQ and erlang:

You must add two cookie files for each server that will be clustered; note that these cookie files must be same on all servers. After installing RabbitMQ and erlang, place the rabbitmq.config file in C:\ProgramData\RabbitMQ on each machine. After restarting rabbit on all machines that will be clustered, rabbit should auto-cluster.

1. Add a new Environment Variable to each Document Generation Services server.
   - RABBITMQ_BASE, C:\ProgramData\RabbitMQ
     - Click the Start button and search for the environment. Select Edit the system environment variables. Click the Environment Variables button and add the RABBITMQ_BASE variable to the System variables section.
     Note: This step is mandatory; if not completed, all RabbitMQ configuration information is placed at C:\Users\<current user>\AppData\Roaming\RabbitMQ. This path is incompatible if multiple users access the server hosting RabbitMQ.
2. If clustering multiple DGS servers together, a rabbitmq.config file is required to define the servers for the cluster. Update the server names for your environment. See Appendix: RabbitMQ.config file for a sample .config file.
   Note: Enter the server names in UPPERCASE.
3. Install otp_win64_18.3.exe from http://www.erlang.org/download.html; the default options are recommended.
4. Install rabbitmq-server-3.6.1.exe from https://www.rabbitmq.com/download.html; the default options are recommended.
5. From a command prompt, enter C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.1\sbin; execute rabbitmq-plugins enable rabbitmq_management. If you receive an error stating Erlang cannot be located, check if a previous command prompt was open.
   Note: This enables a web UI for a Management application at http://localhost:15672/; username and password are both “guest.”

Repeat these steps for every server that hosts the main Document Generation Services application. Note that this procedure does not apply to servers that only host the Scheduler Service.