Hello. Thank for accepting me in this Slack. I'd ...
# prefect-getting-started
j
Hello. Thank for accepting me in this Slack. I'd like to ask some feedback on the issues I am getting with Prefect that is hosted on a Windows server. I'm unsure if it's the right channel to ask this, so please let me know if it isn't so that I can move this to the right one. Unable to run the Prefect server on machine's IP address when using NSSM I have configured our Prefect server so that it runs on the machine's IP address. Here's how I did it.
Copy code
env\Scripts\activate.bat 
(env) prefect config set PREFECT_SERVER_API_HOST='SERVER-IP-ADDRESS'
(env) prefect server start
 ___ ___ ___ ___ ___ ___ _____ 
| _ \ _ \ __| __| __/ __|_   _| 
|  _/   / _|| _|| _| (__  | |  
|_| |_|_\___|_| |___\___| |_|  

Configure Prefect to communicate with the server with:

    prefect config set PREFECT_API_URL=<http://SERVER-IP-ADDRESS:4200/api>

View the API reference documentation at <http://SERVER-IP-ADDRESS:4200/docs>

Check out the dashboard at <http://SERVER-IP-ADDRESS:4200>
I used NSSM to run the server as a service on Windows. I used a batch file for this.
Copy code
cd C:\Users\username\Documents\Projects\prefect-server\env\Scripts
call activate.bat
prefect.exe server start
Running this batch file on Command Prompt gives the same output as above. I created the service using
nssm install
with the batch file as parameter. When I run the service either using
nssm start
or from Windows Services, Prefect server runs on the default IP address 127.0.0.1:4200 instead. What did I miss here? Could
I found the solution. Before posting this question, I have a hunch that nssm runs Prefect with a different environment regardless if you set it up before installing the service. nssm has an option to set environment variables. I had to re-install the service. On this tab, I added
PREFECT_SERVER_API_HOST=SERVER-IP-ADDRESS
. I ran the service, and Prefect now runs on the machine IP address. This question is also posted on [Stack OverFlow](https://stackoverflow.com/questions/78460896/unable-to-run-the-prefect-server-on-machines-ip-address-when-using-nssm)