Question on grafana alloy startup

I am getting exception while starting alloy server in windows machine
alloy.exe run alloy.hcl

it is starting up the serve but at the last it throws the exception that 12345 port is already in use. I have tried multiple Approaches to fix the issue bu none of them are working

level=error msg=“failed to listen on 127.0.0.1:12345” service=http err="listen tcp 127.0.0.1:12345: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

Welcome @badwaikpunamchand to the Grafana forum.

Did you view the logs? To view Alloy log files, run the following command in a terminal window:
sudo journalctl -u alloy
which should provide some insight on the problem.

Do you have another service or program using the port 12345? I do in my case. The fix was to add a non-default port during the service install:

alloy-installer-windows-amd64.exe /ENVIRONMENT=--server.http.listen-addr=127.0.0.1:$grafanaPort

Alternatively, you can add --server.http.listen-addr=LISTEN_ADDR:12345 as a command line argument.