# Installing CUPS server

To install the server the cupsd package and dependencies need to be downloaded.

```bash
dnf install cups -y
```

After installation only a couple of items need to be changed under

```bash
/etc/cups/cupsd.conf
```

Find Listen 127.0.0.1:631 and replace with

```
Listen *:631
```

Confirm the following is enabled

```bash
Browsing On
BrowseLocalProtocols dnssd
```

Edit these two sections as follows

```bash
# Restrict access to the server...
<Location />
 Order allow,deny
 Allow @LOCAl
</Location>

# Restrict access to the admin pages...
<Location /admin>
 AuthType Default
 Require valid-user
 Order allow,deny
 Allow @LOCAL
</Location>
```

This line can be added near the top if a 400 bad request is happening due to DNS problems or the gold image that is being used.

```bash
ServerAlias *
```

Save. Now add the firewall rules

```bash
firewall-cmd --add-port=631/tcp --permanent
firewall-cmd --reload
```

Restart cups

```bash
systemctl restart cups
```