I am getting error "Could not connect to the controller" after installation of Leapwork and I am unable to start the controller service
I am getting error "Could not connect to the controller" after installation of Leapwork and I am unable to start the controller service
Introduction
The Leapwork Controller is the central component in the Leapwork Automation Platform. The studio depends on it to gain access to all the flows and related assets. The Controller also manages the Agents used for executing the automation flows. When a user starts the Studio for the first time, it automatically shows the available Controller(s) and prompts the user to select which Controller to connect to. Leapwork cannot be used before this selection.
Leapwork controller is installed as a Windows service and it runs in the background. After installing Leapwork, if the user sees an error indicating an inability to connect, they need to check whether the controller service is running.
Resolution 1
The user can open up services on the computer where the Leapwork controller is installed to verify the service is running and start the service manually if necessary. To check the service, follow these steps:
Go to the Start screen and start typing "services." Click or tap the View local services search result.
Alternatively, use the Run window: Press the Win + R keys, type "services.msc," and hit Enter or press OK.
The Services app window will open.
Look for the service named Leapwork Controller.
Check the status of the service. If it is not running, simply start or restart the service.
If the service is running, the user should be able to connect to the controller from the Studio. If an installation error occurs, the following error message may display:
Leapwork controller and agents run on specific ports for communication. An error indicating that port 9000 is already in use means another application is occupying that port.
Default Ports for Each Component:
- Leapwork Controller: 9000
- Leapwork Controller API: 9001
- Leapwork Agent: 6777
To identify which application is using a port, follow these steps:
- Open the command prompt: start » run » cmd or start » All Programs » Accessories » Command Prompt.
- Type netstat -aon | findstr [port_number] (replace [port_number] with the actual port number) and hit enter.
- If the port is in use, details of the application will display, including its PID (process ID).
- Type tasklist | findstr [PID] to find the application name using that port.
If another application is using a default port, change the port for the Leapwork service accordingly. Refer to the article for changing the installation port.
Another common issue during service start/restart is:
This error typically occurs when the service runs under a Local Service account. Assign a Local System account: 6. Select your service, right-click, and select Properties. 7. Go to Logon Properties, select Local System Account, then click OK.
Resolution 2
To check port availability and connectivity, use this PowerShell command (run as administrator):
Test-NetConnection -ComputerName 10.61.121.119 -Port 9000
Note: Replace the IP address (10.61.121.119) with your destination IP and specify the port number.
If it returns "True," the specified port is open and reachable. If it returns "False," the port may be closed; contact your IT team for assistance.
To uninstall Leapwork completely:
- Uninstall LEAPWORK from the control panel.
- Delete the "LEAPWORK" folder from C:\Program Files.
- Delete the "LEAPWORK" key from the registry editor (Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LEAPWORK).
- Delete the "LEAPWORK" folder from C:\Users[profile]\AppData\Local.
- Restart the machine.
Refer to the articles for changing the controller port:
- How to change the port number of the Leapwork Controller after installation
- How to change Agent Port
For any clarification, please contact our Priority Support.