Windows support
Prefect provides comprehensive Windows support with the Windows ecosystem. Prefect automatically detects PowerShell and uses it as the default shell on Windows, allowing you to run shell commands and scripts naturally without additional configuration. The subprocess execution is fully compatible with Windows process management. Windows path conventions are fully supported, including UNC paths for network storage. This allows you to configure Prefect to use network shares for databases, storage, and other resources, which is particularly useful in enterprise environments where shared storage is common:Database configuration and workers
By default, Prefect uses SQLite stored at%USERPROFILE%\.prefect\prefect.db
with no additional configuration needed. For production deployments, you can configure PostgreSQL using standard connection strings:
Security and performance considerations
Windows environments require specific security configurations for optimal Prefect operation. You’ll need to allow Prefect server through Windows Firewall and configure PowerShell execution policies. Additionally, antivirus software can significantly impact performance if not configured properly. Configure Windows Firewall to allow Prefect server traffic on port 4200:%USERPROFILE%\.prefect\
, your Python installation directory, and temporary directories used by flows. This prevents real-time scanning from interfering with Prefect operations.
Production deployment as Windows service
For production environments, you should run Prefect server as a Windows service to ensure it starts automatically and runs reliably. The Non-Sucking Service Manager (NSSM) is the recommended tool for this purpose. Download NSSM from nssm.cc and install the service with administrator privileges:Troubleshooting common Windows issues
Several Windows-specific issues can occur when running Prefect. The most common problems relate to PATH configuration, encoding issues, port conflicts, and permission errors.Command not found errors
These typically indicate PATH issues. Verify that the Python Scripts directory is in your PATH and restart PowerShell after making changes. You can also try runningwhere prefect
to see if the command is found.
For example, if the prefect
command isn’t found, you’ll need to add the Python Scripts directory to your PATH
. This is a common issue on Windows when Python isn’t installed system-wide:
Port conflicts
These can prevent the server from starting. Check what’s using port 4200 and kill the process if necessary:PREFECT_SERVER_API_HOST
and PREFECT_SERVER_API_PORT
environment variables:
Character encoding errors
Character encoding errors (particularly'charmap' codec
errors) can occur on some Windows systems. Set the Python I/O encoding to UTF-8: