Table of Contents
This tip is about the how to configure and install Caddy web server on AlmaLinux 8. So read this free guide, How to configure and install Caddy web server on AlmaLinux 8 step by step. If you have query related to same article you may contact us.
How to configure and install Caddy web server on AlmaLinux 8 – Guide
In that tutorial we will show you how to install Caddy on AlmaLinux 8. For those of you who didn’t know, Caddy is a powerful, open source, enterprise-grade web server with automatic HTTPS written in Go. It’s a lightweight, commercially supported web server that you can purchase and renew automatically SSL / TLS certificates with Let’s Encrypt. This guides assumes you have at least a basic working knowledge of Linux, how to use the Shell and most importantly you are hosting your website on your own VPS.
Installation is very simple and assumes you are running under the root account. Otherwise, you may need to add ‘sudo’ to the commands to gain root privileges. I will show you step by step the installation of the Caddy web server on an AlmaLinux 8. You can follow the same instructions for CentOS and Rocky Linux.
Install Caddy web server on RockyLinux 8 / AlmaLinux 8 / CentOS 8
Installing Caddy’s web server is very easy, but first we have to update the operating system.
After that, we can install Caddy by enabling a special repository with these two commands.
Now you can install Caddy by running
You can check the installed version with the command:
Configuring Caddy Web Server
Normally you have a Firewall running, so you need to enable ports 80 and 443 on it. Now, at the system level, you can do this using these commands:
And to apply the changes, restart the firewall
After that, you must enable and start the Caddy service
Then you can check the status of the service. Now, open a browser you trust and go to http: your-server. So Caddy’s web server is up and running.
Creating a new website on Caddy’s web server
This step is the equivalent of a VirtualHost on Apache or a ServerBlock on Nginx. So, create the directory dedicated to your website.
In my case, I called it osradar.test, but you can call it whatever you want. Also, create a dedicated log directory.
Make user caddy the owner of both folders.
Now create an index.html file in your new sites directory.
And add some code. Save your changes and close the editor. Now in Caddy’s main configuration file. Save Changes. Validate the configuration file
If the screen output results in a warning, you can fix it by running
To apply the changes, restart the Caddy service.
Final note
I hope you like the guide How to configure and install Caddy web server on AlmaLinux 8. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.