# Installation via package managers (RHEL/Fedora)

> Source: https://ferron.sh/docs/installation/linux/rhel-fedora

Ferron 3 has official packages available for Red Hat Enterprise Linux (RHEL), Fedora, openSUSE and derivatives. Below are the instructions on how to install Ferron 3 on RHEL or Fedora via a package manager.

## Installation steps

### 1. Add Ferron's repository

To add Ferron's repository, run the following commands (for RHEL/Fedora):

```bash
# Install packages required for adding a new repository
sudo yum install yum-utils

# Add a new RPM package repository
sudo yum-config-manager --add-repo https://rpm.ferron.sh/ferron.repo
```

For openSUSE, use the following commands instead:

```bash
sudo zypper addrepo https://rpm.ferron.sh/ferron.repo
```

### 2. Install Ferron

To install Ferron 3, run the following command (for RHEL/Fedora):

```bash
sudo yum install ferron3
```

For openSUSE, use the following command instead:

```bash
sudo zypper install ferron3
```

> [!note]
> Keep Ferron up to date by running `sudo yum update ferron3` or `sudo zypper update ferron3`.

#### FIPS-certified cryptography variant

A FIPS-certified variant is available as the `ferron3-fips` package. Install it if you must run Ferron in a FIPS-compliant environment:

```bash
sudo yum install ferron3-fips # RHEL/Fedora
sudo zypper install ferron3-fips # openSUSE
```

The `ferron3-fips` package conflicts with the standard `ferron3` package, so you cannot install both at the same time. A FIPS build restricts cryptography to FIPS-approved algorithms: OCSP stapling, TLS cipher suites and key exchange groups are filtered, and HTTP basic auth password verification accepts only PBKDF2 hashes (Argon2, scrypt and bcrypt are rejected).

### 3. Enable and start the service

To enable and start the Ferron service, run the following commands:

```bash
sudo systemctl enable ferron
sudo systemctl start ferron
```

### 4. Access the web server

By default, Ferron serves content from the `/var/www/ferron` directory. Open a web browser and navigate to `http://localhost` to check whether the server runs and serves the default `index.html` file.

If you see a "Ferron is ready to serve." message on the page, the web server installed successfully and runs.

> [!tip]
> If you cannot access the server from another machine, make sure your firewall allows incoming connections on port 80 (or whichever port you configured). If port 80 is already in use, change the listen port in `/etc/ferron/ferron.conf` and reload the service.

## File structure

Ferron 3 installed via the package for RHEL/Fedora has the following file structure:

- `/usr/sbin/ferron` - Ferron web server
- `/usr/sbin/ferron-fmt` - Ferron configuration formatter
- `/usr/sbin/ferron-kdl2ferron` - Ferron configuration conversion tool
- `/usr/sbin/ferron-passwd` - Ferron user password generation tool
- `/usr/sbin/ferron-precompress` - Ferron static files precompression tool
- `/usr/sbin/ferron-serve` - Ferron zero-configuration static file serving
- `/var/log/ferron/access.log` - Ferron access log in Combined Log Format
- `/var/log/ferron/error.log` - Ferron error log
- `/var/www/ferron` - Ferron's web root
- `/etc/ferron/ferron.conf` - Ferron configuration

## Managing the Ferron service

### Stopping the service

To stop the Ferron service, run:

```sh
sudo systemctl stop ferron
```

### Restarting the service

To restart the service:

```sh
sudo systemctl restart ferron
```

### Reloading the configuration

To reload the configuration without restarting the service:

```sh
sudo systemctl reload ferron
```