<@ULVA73B9P> How can I make sure that my self-host...
# ask-marvin
s
@Marvin How can I make sure that my self-hosted server uses the correct settings while it's running?
m
To tackle the question of ensuring correct settings on your self-hosted server running Prefect, let's first determine which version of Prefect you're using, as the solution can vary. Could you please confirm whether you're using Prefect 2.x or 3.x?
s
@Marvin It's Prefect 3.1.0
m
To ensure your self-hosted server uses the correct settings while running Prefect 3.1.0, you can manage configurations using Prefect's settings management tools. Here’s a step-by-step guide: 1. Edit Your Profiles: Prefect uses a
profiles.toml
file for configuration. You can directly edit this file to configure server settings. This allows for custom setups depending on your use case. 2. Common Settings: - For databases, configure
server.database.connection_url
with a SQLAlchemy-compatible connection string (e.g., for SQLite or Postgres). - Security configurations like CSRF protection can be managed via this setup. 3. Use of Environment Variables: Environment variables always take precedence over other configurations. You can set these variables for runtime behavior adjustments. For example,
PREFECT_API_URL
and
PREFECT_API_KEY
can be set to ensure communication with your Prefect server. 4. Command Line Interface: Utilize the Prefect CLI to manage your configuration: - Set a Configuration:
prefect config set <setting_key>=<value>
- Unset (restore default):
prefect config unset <setting_key>
- View Current Settings:
prefect config view
5. Reverse Proxy Setup: If you are using a reverse proxy like Nginx, configure
ui.api_url
to point to your external proxy URL, ensuring proper routing of traffic to your Prefect UI instance. For more detailed guidance, you can explore the following resources: - Settings and Profiles Documentation - Infrastructure Examples for Serverless Environments Remember, using environment variables to fine-tune the server while it's running provides flexibility and ensures the correct settings are always applied.