---
title: "Install Caddy on Rocky Linux 8.x"
description: "Install the Caddy web server on Rocky Linux 8.x as an alternative to Apache and Nginx, with package repo and service setup."
image: "https://8labs.id/opengraph.jpg"
---

> Documentation Index
> Fetch the complete documentation index at: https://8labs.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Caddy on Rocky Linux 8.x

Alternative Web Server besides Apache and Nginx. Installation on Rocky Linux 8.x

### Preparation
You can connect to the server via SSH or console.
```bash
ssh [username]@[ip_server] -p [ssh_port]
```

Update the system 
```bash
sudo dnf update
```

Add caddy repository
```bash
sudo dnf install 'dnf-command(copr)'
sudo dnf copr enable @caddy/caddy
```


### Installation
Install Caddy
```bash
sudo dnf install caddy
```

Check Caddy Version
```bash
caddy version
```

Sample Output of Caddy version

![Caddy Version Output](https://8labs.id/_nimbus/md/9lgar5/caddy-version.png)


### Set Firewall
#### Allow HTTP & HTTPS
```bash
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
```

#### Restart Firewall
```bash
sudo firewall-cmd --reload
```

### Start Service
```bash
sudo systemctl enable --now caddy
sudo systemctl start caddy
sudo systemctl status caddy
```

Sample Output of Service status.
![Caddy Status Service Output](https://8labs.id/_nimbus/md/jlaj3v/caddy-status.png)

### Access the sample page

Open [http://localhost](http://localhost/) or [http://your-server-ip](http://127.0.0.1/) to access the sample page.

Output of Caddy sample page.
![Caddy Sample Page](https://8labs.id/_nimbus/md/1aqkdgf/caddy-sample-page.png)

Source: https://8labs.id/id/guides/caddy/caddy-rockylinux-8-install/index.mdx
