# Installation via Windows installer

> Source: https://ferron.sh/docs/installation/windows

Ferron 3 offers an official Windows installer for easy setup on Windows and Windows Server. The installer supports x64 and ARM64 architectures.

## Prerequisites

Before installing Ferron, make sure you have:

- Windows 10+ or Windows Server 2016+.
- Administrator privileges to install the Windows service and modify the system PATH.
- A web browser to download the installer.

## Downloading the installer

Visit the [Ferron downloads page](https://ferron.sh/download) and download the installer that matches your architecture:

- **x64**: `ferron-<version>-x86_64-pc-windows-msvc-setup.exe`
- **ARM64**: `ferron-<version>-aarch64-pc-windows-msvc-setup.exe`

> [!note]
> The x64 installer works with x64 emulated mode on Windows ARM devices. For best performance, use the native ARM64 installer on ARM64 hardware.

## Installation steps

### 1. Run the installer

Double-click the downloaded `.exe` installer to launch the setup wizard.

> [!tip]
> If Windows SmartScreen shows a warning, click "More info" and then "Run anyway".

### 2. Follow the setup wizard

1. **License agreement**: review and accept the terms to continue.
2. **Installation directory**: Ferron installs to `C:\Program Files\Ferron` by default.
3. **Setup options**: add Ferron to the system PATH and install it as a Windows service.
4. **Ready to install**: review your choices and click "Install".

### 3. Finish the installation

Once the installer completes, click "Finish" to close the wizard.

### 4. Start the web server

After installing Ferron, start a Windows service by following these steps:

1. Open the Services app (`services.msc`).
2. Find and double-click on the `Ferron web server` service.
3. Click Start in the Actions pane.

### 5. Access the web server

By default, Ferron serves content from its `wwwroot` directory. Open a web browser and navigate to `http://localhost` to verify the server works.

If you see a "Ferron is ready to serve." message on the page, the web server works.

> [!tip]
> If you cannot access the server from another machine, make sure Windows Defender Firewall allows incoming connections on port 80. If port 80 is already in use, change the listen port in `C:\ProgramData\Ferron\ferron.conf` and restart the service.

## File structure

Ferron 3 installed via the Windows installer has the following file structure:

- `C:\Program Files\Ferron\ferron.exe`, the main Ferron web server executable.
- `C:\Program Files\Ferron\ferron-fmt.exe`, a tool for formatting Ferron configuration files.
- `C:\Program Files\Ferron\ferron-kdl2ferron.exe`, a tool for converting Ferron 2 KDL configurations to Ferron 3 configurations.
- `C:\Program Files\Ferron\ferron-passwd.exe`, a tool for generating hashed passwords for the server configuration.
- `C:\Program Files\Ferron\ferron-precompress.exe`, a tool for precompressing static files.
- `C:\Program Files\Ferron\ferron-serve.exe`, a command for serving static files with zero configuration.

## Managing Ferron as a Windows service

### Starting the service

To start the Ferron service, run the following in an elevated PowerShell session (run as administrator):

```powershell
Start-Service Ferron
```

### Stopping the service

To stop the Ferron service:

```powershell
Stop-Service Ferron
```

### Restarting the service

To restart the Ferron service:

```powershell
Restart-Service Ferron
```

### Reloading the configuration

To reload the configuration without restarting the service:

```powershell
Restart-Service Ferron
```

### Viewing service status

To check the status of the Ferron service:

```powershell
Get-Service Ferron
```

### Uninstalling the service

To uninstall the Windows service before removing Ferron:

```powershell
Stop-Service Ferron
ferron winservice uninstall
```

## Other CLI commands

Ferron also offers several commands for working with configuration files. Open Command Prompt or PowerShell and run:

```cmd
ferron validate -c C:\ProgramData\Ferron\ferron.conf
```

```cmd
ferron adapt -c C:\ProgramData\Ferron\ferron.conf
```