# How to Install and Setup Leapwork Environment

## Introduction

With the Leapwork Automation Platform, users at all business levels can build Web, Desktop, and Virtual Desktop automation in minutes. Cases are designed as flowcharts and automated without writing a single line of code. Your organization can set up and run automation without learning a new skill set or relying on external consultants.

The Leapwork Automation Platform consists of three components:

- **Studio** (the designer)
- **Controller** (the server)
- **Agent** (the runner)

## Leapwork Studio

The Leapwork Studio is a desktop application made for Microsoft Windows. It’s a powerful visual designer that can be used by anyone in your organization to easily create automation cases, set up schedules to run automation cases on physical or virtual machines and in the cloud, and dig into the results with dashboards and reports.

## Controller

The Controller is a service that runs in the background, and it’s also made for Microsoft Windows. It hosts and stores all automation assets such as cases, images, schedules, reports, and so on. It also controls how automation cases are run and in which environments.

## Agent

The Agent is also a service that runs in the background on Microsoft Windows. The runtime agent takes care of executing the individual automation cases one at a time when requested by either a Studio or Controller.

For more information about how to use Leapwork, see [Learning Center](/content/services/learning-center/index.html).

## Communication Protocols

The three components use different communication protocols to perform their work:

- The Studio communicates with the Controller using a REST API. The REST API is hosted on the Controller and can also be used by external scripts and integration mechanisms.
- The Controller communicates with connected Agents using an internal remote control protocol that is similar to VNC, with some added control mechanisms.
- The Studio can also communicate directly with an Agent using the internal remote control protocol when designing and preview-running automation cases.

You can install all three components (Studio, Controller, and Agent) on physical and virtual machines in protected networks behind firewalls and without internet access.

To see examples of how to use the REST API to integrate Leapwork with ALM systems such as: HP Quality Center, JIRA, Jenkins, see [Learning Center](/content/services/learning-center/index.html).

## Installation

You can install Leapwork in two different configurations:

- **Single user/local installation**
  
  In this case, the user will design and run tests on his local machine. This allows the user to get started quickly, but the local machine is blocked while tests run as Leapwork controls the keyboard and mouse. For local installation instructions, see [Learning Center](/content/services/learning-center/home/index.html).

- **Distributed installation**
  
  In this setup, the user can use Leapwork as a distributed testing environment. The user can trigger tests on remote machines without getting disturbed. Distributed testing enables the user to run tests in parallel, thereby reducing test execution time.

Distributed testing through Leapwork allows the user set up parallel test case execution on different browsers/platforms, allowing the test case results to be aggregated by the Leapwork Controller.

### Studio Installation

The studio is a desktop application made for Microsoft Windows 7 or later. It is a powerful, visual design that you can use to easily create automation cases, set up run schedules, and dig into the results with dashboards and reports.

The studio is most widely used in below three configurations:

- On local/development environment with internet access.
- On cloud or virtual environment with internet access.
- On firewalled test network with or without internet access.

After downloading the latest appropriate version (32-bit or 64-bit), to install Leapwork Studio, double-click the downloaded MSI file.

1. The version number appears on screen. Ensure that there is enough disk space to install the software. Click **Next** to begin the installation.

2. Select the components with appropriate option you want to install on the computer. (In this case, do not opt for Controller and Agent). Click **Next** to continue.

3. Click **Install** to continue.

**Note:** If you have chosen to install the Automation Controller, then Controller services will automatically start on Controller machines as the installation finishes.

4. Click **Continue** to start the IE Addon Installation.

5. Click **OK** to finish Installation.

### Controller Installation

The Controller is a service that runs in the background, and it is also made for Microsoft Windows 7 or later. It hosts all automation assets such as cases, images, schedules, reports, etc. It also controls how automation cases are run and in which environments.

Studio talks to the Controller using an open REST API that you can tap into as much as possible. Ideally, the Controller can be installed in any environment which is accessible to the Studio.

The Controller can be installed on:

- Firewalled networks
- Local or development network/environments
- Over the cloud, on the condition that the Controller API is accessible to Studio.

After downloading the latest appropriate version (32-bit or 64-bit), you install the Controller by double-clicking the downloaded MSI file.

1. The first screen will display the version number and ensure that the downloaded version fits your computer. Click **Next** to begin the installation.

2. Read the end user agreement tick "I accept the terms in the license agreement" checkbox and Click **Next** button if you agree.

3. The configuration screen contains several settings that you can modify before completing the installation.

4. Apply the following controller settings:

- **Controller Port**: Studio and the Controller always communicate using internal API calls, which requires using a TCP port. The default is port 9000, which you can change to any other port number that is not in use by other software on your computer. NOTE: Unless it is necessary for any particular reason, we do not recommend changing either the Controller, Controller API, or Agent port numbers.
- **Controller API Port**: For any integration effort, access Leapwork's open REST API using the port number set here. The default is port 9001, which you can change to any other port number that is not in use by other software on your computer. NOTE: Unless it is necessary for any particular reason, we do not recommend changing either the Controller, Controller API, or Agent port numbers.
- **Add exceptions for the Controller in Windows Firewall**: A check in this box will direct the installation process to add a rule to the Windows Firewall to permit all incoming connections to the Automation Controller. NOTE: The password is optional because the LEAPWORK Automation Platform is also often used in corporate and already secure test networks. For more information, see [Firewall and port settings](https://support.leapwork.com/s/article/FirewallandportsettingsbeforeyouinstallLeapwork633075515bb33).

5. Save the database encryption key, which is used to protect the database files created during the upgrade. This key is used to allow the Controller to gain access to the database files, so in case the Controller needs to be moved to a new machine or in case of a restore of the Leapwork system, this key is needed. Save the key in a protected and safe place.

6. In the Choose password for the 'admin' user screen, specify a password for the default user (“Admin”). The “admin” user is used for the first login in Studio after the installation. Note that the password you enter for the admin user is securely located in your local installation only. Therefore, Leapwork cannot assist in retrieving this password should you forget it.

7. When you are happy with the configuration, click **Next** to continue and then **Install** on the next screen.

If you have chosen to install the Automation Controller, then Controller services will automatically start on Controller machines as the installation finishes.

8. After the installation is complete, click **Continue**.

## Agent Installation on Windows

The agent is a service that will run in the background on any operating system or device that you want to run automation cases on. We call them environments. The Agent takes care of executing the automation cases on the environments and executes to the Controller using a closed remote-control continuously talks on the status.

**Note**: Agent service is available on Microsoft Windows 7 SP1 or later.

The Agent can communicate directly with Studios or the Controller. Additionally, the agent can be installed on:

- Firewalled network
- Local or development network/environment
- Over the cloud, on the condition that the Agent can communicate with Studios and the Controller without network interruption.

After downloading the latest appropriate version (32-bit or 64-bit), you install Leapwork Studios by double-clicking the downloaded MSI file.

1. The first screen will display the version number. Ensure that the downloaded version fits your computer. Click **Next** to begin the installation.

2. Choose which of the three components to install on the computer. Do this by clicking the drop arrows and choosing the appropriate option for each component (in this case, remove Studio and Controller). Click **Next** to continue.

The configuration screen contains several settings that you can modify before completing the installation. By default, the Agent talks to the Controller over port 6777; the user can change it if needed. In addition, Leapwork Agents now include a strong security feature to automate logging in and out of Windows. A user is no longer required to be logged into their machine in order to run a flow. Instead, Leapwork can be set up to log in on the user’s behalf. Users can also start testing single-sign-on between Windows and any other application that reuses the same login credentials. The User has to choose Windows login to be able to use windows credentials to configure the Agent OR user can choose the old way of setting a password. The password is left blank by default.

For more information, see [Firewall and port settings](https://support.leapwork.com/s/article/FirewallandportsettingsbeforeyouinstallLeapwork633075515bb33).

3. Click **Next** to continue and then **Install** on the next screen.

**Note:** If you have chosen to install the Automation Agent, then agent services will automatically start on the Agent machine as the installation completes.

4. After the installation is complete, click **Continue**.

## For any clarification, please contact our [Priority Support](mailto:prioritysupport@leapwork.com).
