Hello all, my boss has asked a question about Pref...
# ask-community
m
Hello all, my boss has asked a question about Prefect that I don't quite know the answer to. We are using Prefect server and the question was: can we host Prefect server on 1 server, but have our program code, including the flows, on another server? I don't quite know whether or not that is something Prefect Server can do. We are wanting a dedicated server for Prefect, but the program code hosted elsewhere in our infrastructure
c
Hi Matthew - this question entirely depends on how comfortable you are with networking; when you spin up Prefect Server, you’re hosting an API. Your agent and the flows that it submits need network access to this API to function properly; as long as that is true, it doesn’t matter whether the agent runs on the same machine as Server.
m
@Chris White so I can deploy an agent to a different server, that as long as the firewall rules allow for access to the Server, it will just work? Is there any specific configuration/requirements of the machine that hosts the Agent?
c
That’s correct — this is analogous to how folks use Prefect Cloud; the agent machine configuration depends partially on what type of agent you’re using, but for standard workflows you shouldn’t need any special configuration
m
@Chris White in our case, we use the DockerAgent. Do we need prefect installed on the Server that is hosting the agent?
c
Correct, and the agent needs registry access to whatever docker images you want to use
m
@Chris White so, minimally, we need to have prefect installed on, for simplicity sake, what we will call the Agent server, and the only thing of prefect that needs to be running on that server is the DockerAgent, and the server for the Prefect Server with the UI and everything needs to have firewall access to the Agent Server, that it will do some auto discovery magic to locate the DockerAgent, and from there things should just work as intended as long as there is ingress and egress access to/from the Agent server and the Prefect Server server?
c
Almost, two points of clarification: • the agent needs access to the Prefect Server API, not the other way around (all traffic will be one way to the Server instance) • because the UI is a single page app that runs in your browser and queries the API for its data, all users of the UI will also need network access to the Server instance for that to work
m
@Chris White ah awesome! We would have them both on the internal network, so that should be easy enough to handle then.
💯 1