Learn how to effortlessly install Caddy Web Server on Rocky Linux 9 with our step-by-step guide. Enhance your web hosting experience with Caddy’s modern features and robust performance capabilities. #centlinux #linux #webserver
Table of Contents
What is Caddy Server?
Caddy is an open-source web server and reverse proxy server written in the Go programming language. It’s known for its simplicity, speed, and its ability to automatically configure and manage SSL certificates for secure HTTPS connections. Caddy is designed to be easy to use, making it accessible to both beginners and experienced developers. It’s often used for hosting websites, APIs, and web applications, and it’s particularly popular in the DevOps and cloud-native communities for its lightweight and efficient design.

Features in Caddy Web Server
Caddy is known for its simplicity and powerful features, making it a popular choice for web server and reverse proxy needs. Some of its notable features include:
Automatic HTTPS: Caddy is renowned for its seamless integration with Let’s Encrypt, allowing it to automatically obtain and manage SSL certificates for secure HTTPS connections. This is a standout feature that simplifies the process of securing websites.
HTTP/2 Support: Caddy supports HTTP/2, the latest version of the HTTP protocol. This enables faster and more efficient communication between the web server and clients.
Virtual Hosting: It allows you to host multiple websites or domains on a single instance of Caddy. This is crucial for individuals or organizations managing multiple web properties.
Reverse Proxy: Caddy can be configured as a reverse proxy, enabling it to forward requests to other servers or services. This is useful for load balancing, caching, and handling complex routing scenarios.
FastCGI Support: It can handle FastCGI requests, making it compatible with applications and frameworks that rely on this protocol.
Static File Serving: Caddy is efficient at serving static files, making it a suitable choice for hosting simple websites or web applications.
Easy Configuration (Caddyfile): Caddy uses a Caddyfile configuration format that is known for its simplicity and readability. This format makes it easy for both beginners and experienced users to set up and manage the server.
Modular Architecture: Caddy’s design is modular, allowing users to enable or disable features based on their specific requirements. It also supports the use of plugins to extend its functionality.
Middleware Support: Caddy supports various middleware modules, which can be used to add functionality like rewriting URLs, applying access controls, and more.
Metrics and Monitoring: It provides basic metrics about request/response rates and latencies, which can be useful for monitoring server performance.
IPv6 Support: Caddy is compatible with IPv6, ensuring that it can handle traffic from devices and networks using this newer internet protocol.
Graceful Restart and Zero Downtime: Caddy allows for graceful restarts, meaning it can reload configurations and apply changes without interrupting ongoing requests.
Web-based Administration Interface (Caddy API): Caddy provides a simple web-based interface for monitoring server status, reloading configurations, and more.
JSON Configuration Option: While the Caddyfile format is preferred for its readability, Caddy also allows advanced users to configure it using JSON.
These features collectively make Caddy a powerful and user-friendly choice for web server needs, particularly for those looking for a streamlined experience with robust security features.
Read Also: How to install Caddy Server on CentOS 7
If you’re serious about mastering web hosting and server management, the Apache Web Server by Vipin Gupta online course is a perfect choice. This beginner-friendly yet comprehensive training will guide you through Apache installation, configuration, optimization, and troubleshooting—all the essential skills you need to confidently manage real-world server environments. Whether you’re a student, system administrator, or developer, this course will give you practical knowledge that you can immediately apply in your projects or career. Enroll now through my affiliate link and start building your expertise in one of the world’s most popular web servers. (Disclaimer: This post contains affiliate links. If you purchase through these links, I may earn a small commission at no extra cost to you.)
Caddy vs Apache
Caddy and Apache are both web servers, but they have significant differences. Here’s a comparison:
Ease of Configuration
Caddy: Known for its simplicity and user-friendly configuration. It uses a Caddyfile format that is easy to understand and requires minimal setup for basic use. Automatic SSL certificate management is a key feature.
Apache: Known for its powerful but sometimes complex configuration files, which use a syntax that might be less intuitive for beginners.
Automatic HTTPS
Caddy: It’s a standout feature. Caddy automatically configures and manages SSL certificates using Let’s Encrypt, providing secure HTTPS connections by default.
Apache: While it supports HTTPS, setting up and managing SSL certificates usually requires additional steps and tools.
Performance
Caddy: Written in Go, it’s known for its speed and efficiency, making it suitable for high-performance use cases. It’s particularly adept at serving static files.
Apache: It’s powerful and feature-rich but can be slightly slower compared to Caddy, especially when serving static content.
Modules and Extensions
Caddy: Offers a modular architecture, allowing users to enable or disable features as needed. There’s an active community creating various plugins.
Apache: Known for its extensive module system. There’s a vast library of modules available for various functionalities, giving it a high level of flexibility.
Community and Ecosystem
Caddy: While growing, it has a smaller community compared to Apache. This means that the available resources, tutorials, and third-party integrations may be more limited.
Apache: One of the oldest and most widely used web servers. It has a massive community with a wealth of documentation, tutorials, and support forums.
Use Cases
Caddy: Particularly popular in situations where ease of use, automatic HTTPS, and quick deployment are crucial. It’s often used for static sites, APIs, and microservices.
Apache: Widely used across various types of web applications and is well-suited for complex setups and environments with a diverse range of requirements.
Operating System Support
Caddy: Supports a variety of operating systems, including Linux, macOS, Windows, and BSD variants.
Apache: Compatible with an even broader range of operating systems, including many UNIX and UNIX-like systems.
Ultimately, the choice between Caddy and Apache will depend on your specific requirements, familiarity with the servers, and the type of projects you’re working on. Caddy’s simplicity and built-in features make it a strong choice for many modern web development needs, while Apache’s extensive feature set and widespread use continue to make it a staple in the web server landscape.
Read Also: Install MinIO Object Storage on Rocky Linux 8
Environment Specification
We are using a minimal Rocky Linux 9 virtual machine with following specifications.
- CPU – 3.4 Ghz (2 cores)
- Memory – 4 GB
- Storage – 40 GB
- Operating System – Rocky Linux release 9.2 (Blue Onyx)
- Hostname – caddy-01.centlinux.com
- IP Address – 192.168.18.83/24
If you’re eager to keep experimenting beyond this tutorial, setting up a reliable lab environment is the best next step. For hands-on practice, a Mini PC is a cost-effective choice to build your own Linux home lab, perfect for testing Caddy and other server software without impacting your main system. [Shop for a Mini PC at Amazon]
On the other hand, if you prefer a ready-to-scale cloud solution, a Bluehost VPS provides the flexibility and performance needed to deploy web servers like Caddy in a real production-like environment. [Get a Linux VPS from Bluehost]
Both options give you the freedom to explore Linux, web hosting, and DevOps workflows with confidence. (Disclaimer: Some of the links above are affiliate links, meaning I may earn a small commission at no extra cost to you. This helps support the blog and allows me to continue creating detailed Linux tutorials.)
Mac Book Pro Charger – 118W USB C Charger Fast Charger Compatible with MacBook pro/Air, M1 M2 M3 M4, ipad Pro, Samsung Galaxy and More, Include Charge Cable
$25.99 (as of October 1, 2025 05:56 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Initial Configurations
Login to your Rocky Linux server as root user by means of a ssh client.
Set a hostname and Local DNS resolution for your Linux machine.
hostnamectl set-hostname caddy-01.centlinux.com
echo "192.168.18.83 caddy-01 caddy-01.centlinux.com" >> /etc/hosts
Execute following command at Linux bash, to update software packages in your operating system.
dnf update -y
If the above command updates your Linux Kernel, then you should reboot before installing Caddy web server.
reboot
After reboot, check the Linux OS and Linux Kernel versions.
cat /etc/os-release
uname -r
Output:
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
5.14.0-284.30.1.el9_2.x86_64
Install Caddy Web Server on Linux
Execute following command to install COPR plugin for dnf command.
dnf install -y 'dnf-command(copr)'
Enable Caddy repository by using following command.
dnf copr enable @caddy/caddy
Output:
Enabling a Copr repository. Please note that this repository is not part
of the main distribution, and quality may vary.
The Fedora Project does not exercise any power over the contents of
this repository beyond the rules outlined in the Copr FAQ at
<https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>,
and packages are not held to any quality or security level.
Please do not file bug reports about these packages in Fedora
Bugzilla. In case of problems, contact the owner of this repository.
Do you really want to enable copr.fedorainfracloud.org/@caddy/caddy? [y/N]: y
Repository successfully enabled.
Now, you can install Caddy server on Linux.
dnf install -y caddy
After successful installation, disable the Caddy repository.
dnf copr disable @caddy/caddy
Output:
Repository successfully disabled.
Verify the version of Caddy server.
caddy version
Output:
v2.7.4 h1:J8nisjdOxnYHXlorUKXY75Gr6iBfudfoGhrJ8t7/flI=
You can check, we have installed caddy 2.7, which is the latest version of caddy web server at the time of this writing.
Enable and start Caddy server.
systemctl enable --now caddy
Output:
Created symlink /etc/systemd/system/multi-user.target.wants/caddy.service → /usr/lib/systemd/system/caddy.service.
Plus Chat
$0.00 (as of September 30, 2025 18:22 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Configure Linux Firewall
Like Apache, Nginx or any other web server, Caddy Server also user default service ports i.e.
- Port 80 for http
- Port 443 for https
Therefore, you must allow these ports in your Linux firewall, to make your websites accessible from the network.
firewall-cmd --permanent --add-service={http,https}
firewall-cmd --reload
Accessing Caddy Web Service
Open URL http://caddy-01.centlinux.com
in a web browser.

Video to install Caddy Web Server on Linux
Read Also: How to configure FastCGI Server on CentOS 7
Final Thoughts
As you conclude the process to install Caddy Web Server on Rocky Linux 9, you’ve embarked on a journey toward enhancing your web hosting capabilities. Caddy’s user-friendly interface, modern features, and robust performance make it a valuable asset for any website or application.
By following the steps outlined in this guide, you’ve gained the knowledge and skills to deploy Caddy effectively on your Rocky Linux server, empowering you to deliver faster, more secure, and more reliable web services to your users. Now, armed with Caddy’s capabilities, you’re ready to take your web hosting experience to the next level and achieve your online objectives with confidence.
Looking for a Linux server expert? I provide top-tier administration, performance tuning, and security solutions for your Linux systems. Explore my Freelancer profile for details!
Frequently Asked Questions (FAQs)
1. Can I use Caddy as a reverse proxy for other applications on Rocky Linux 9?
Yes, Caddy supports reverse proxying out of the box and can easily route traffic to backend services like Node.js or Docker containers.
2. Does Caddy automatically renew SSL certificates on Rocky Linux 9?
Yes, Caddy handles automatic HTTPS and renews SSL certificates via Let’s Encrypt without manual intervention.
3. How do I check Caddy’s status and logs on Rocky Linux 9?
You can check the service status with sudo systemctl status caddy
and view logs using sudo journalctl -u caddy
.
4. Is it possible to use custom plugins with Caddy on Rocky Linux 9?
Yes, you can build Caddy from source with custom plugins, but this requires extra steps beyond the standard installation.
5. Can Caddy run alongside Apache or Nginx on Rocky Linux 9?
Yes, Caddy can run alongside other web servers provided they listen on different ports or IP addresses to avoid conflicts.
Leave a Reply
Please log in to post a comment.