|
1 | 1 | --- |
2 | | -title: Deploying FrankenPHP in production with Docker Compose |
3 | | -description: Deploy a PHP application to production with FrankenPHP and Docker Compose on a single Linux server, including TLS, reverse proxy, and multi-node setups. |
| 2 | +title: Deploying FrankenPHP in production |
| 3 | +description: Deploy a PHP application to production with FrankenPHP and Docker Compose on a single Linux server, including TLS, reverse proxy, and multi-node setups, or natively on Windows. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Deploying in production |
@@ -189,3 +189,48 @@ brew services start dunglas/frankenphp/frankenphp |
189 | 189 | ``` |
190 | 190 |
|
191 | 191 | The service runs FrankenPHP with the configuration file located at `$(brew --prefix)/etc/Caddyfile`. |
| 192 | + |
| 193 | +## Deploying on Windows |
| 194 | + |
| 195 | +FrankenPHP runs natively on Windows, with full support for [the worker mode](worker.md) and [hot reloading](hot-reload.md). |
| 196 | + |
| 197 | +To install it, run this in PowerShell: |
| 198 | + |
| 199 | +```powershell |
| 200 | +irm https://frankenphp.dev/install.ps1 | iex |
| 201 | +``` |
| 202 | + |
| 203 | +Alternatively, [download the Windows archive from the releases page](https://github.com/php/frankenphp/releases). |
| 204 | +It contains the FrankenPHP executable as well as the official PHP binary for Windows. |
| 205 | + |
| 206 | +To run FrankenPHP in the background and start it automatically at boot, register it as a Windows service. |
| 207 | +As [recommended by the Caddy documentation](https://caddyserver.com/docs/running#windows-service), use [WinSW](https://github.com/winsw/winsw): |
| 208 | + |
| 209 | +1. Download [the latest version of WinSW](https://github.com/winsw/winsw/releases) as `frankenphp-service.exe` in the directory containing `frankenphp.exe` |
| 210 | +2. In the same directory, create a `frankenphp-service.xml` file: |
| 211 | + |
| 212 | + ```xml |
| 213 | + <service> |
| 214 | + <id>frankenphp</id> |
| 215 | + <name>FrankenPHP</name> |
| 216 | + <description>The modern PHP app server (https://frankenphp.dev)</description> |
| 217 | + <executable>%BASE%\frankenphp.exe</executable> |
| 218 | + <arguments>run --config %BASE%\Caddyfile</arguments> |
| 219 | + <log mode="roll-by-time"> |
| 220 | + <pattern>yyyy-MM-dd</pattern> |
| 221 | + </log> |
| 222 | + </service> |
| 223 | + ``` |
| 224 | + |
| 225 | +3. Install and start the service: |
| 226 | + |
| 227 | + ```powershell |
| 228 | + .\frankenphp-service.exe install |
| 229 | + .\frankenphp-service.exe start |
| 230 | + ``` |
| 231 | + |
| 232 | +Windows services cannot be reloaded. To apply configuration changes gracefully, without restarting the service, run: |
| 233 | + |
| 234 | +```powershell |
| 235 | +.\frankenphp.exe reload --config Caddyfile |
| 236 | +``` |
0 commit comments