How To Install Caddy on CentOS 8

Install Caddy on CentOS 8

In this tutorial, we will show you how to install the Caddy on CentOS 8. For those of you who didn’t know, The Caddy web server is an open-source web server written in Go. It is designed around simplicity and security that comes with a number of features that are useful for hosting websites. Caddy has been designed to support all popular platforms that’s why it is available for Windows, macOS, Linux, BSD, Android, Solaris, 32-bit, x64, ARM, mips64, and more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Caddy web server on a CentOS 8.

Install Caddy on CentOS 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf update
sudo dnf install epel-release

Step 2. Installing Cady on CentOS 8.

Now run the following command below to install Cady web servers:

sudo dnf install ‘dnf-command(copr)’
sudo dnf copr enable @caddy/caddy
sudo dnf install caddy

After installing Caddy, the commands below can be used to stop, start and enable the Caddy service to automatically start up when the server boots:

sudo systemctl start caddy
sudo systemctl enable caddy

You can verify the installation by the following command:

$ caddy version
v2.4.3 h1:Y1FaV2N4WO3rBmeilanaUZsZTQdN+PwcoOcAiZTM8C0I=

Step 3. Configure Firewall.

Assuming that you are using a firewalld as your server’s firewall, run the following command to add the HTTP and HTTPS ports in the firewall.

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

Step 4. Accessing Caddy web server.

Once successfully installed, now navigate to your browser and enter your server IP or domain name:

http://your-domain-name.com

Congratulations! You have successfully installed Caddy. Thanks for using this tutorial for installing the Caddy web server on your CentOS 8 system. For additional help or useful information, we recommend you to check the official Caddy website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!