In this article, we'll explain you how to install Caddy on AlmaLinux 8 using package. Caddy is most often used as an HTTPS. The Caddy web server is an open-source web server.
Written in Go, Caddy offers greater memory safety than servers written in C. A hardened TLS stack powered by the Go standard library serves a significant portion of all Internet traffic.
It is designed around simplicity and security that comes with a number of features that are useful for hosting websites. Caddy is both a flexible, efficient static file server and a powerful, scalable reverse proxy.
Prerequisites:
- A AlmaLinux installed [dedicated server](https://hostnextra.com/dedicated-server) or KVM VPS
- A root user access or normal user with the sudo privileges
- Configure a Domain name A record pointing to the server IP Address
Install Caddy on AlmaLinux
Step 1 - Update the server
Run following command to update the Ubuntu server:
sudo dnf update
Step 2 - Install Caddy web servers
Execute following set of commands, it will install and runs Caddy for you as a systemd service named caddy using our official caddy.service unit file.
sudo dnf install 'dnf-command(copr)'
sudo dnf copr enable @caddy/caddy
sudo dnf install caddy -y
Next, start and enable caddy.service using following command:
sudo systemctl start caddy && sudo systemctl enable caddy
Configure Firewall
Assuming that you are using firewalld
as your server’s firewall, run following command to add the HTTP and HTTPS port in the firewall.
sudo firewall-cmd --add-port={80,443}/tcp --permanent
sudo firewall-cmd --reload
Check the version using following command:
caddy -v
Output:
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=
Now, navigate to your browser and enter your server IP or domain name:
http://Server-IP
OR
http://example.com
That's it. We have seen how to install Caddy on AlmaLinux 8 using package.