• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Install Caddy Web Server By Docker On Rocky Linux 8.6

  • 00:38 cat /etc/os-release
  • 00:54 vim index.html
  • 01:25 docker pull caddy
  • 02:05 docker run --name webserver -p 80:80 -v $PWD/index.html:/usr/share/caddy/index.html -v caddy_data:/data caddy
{{postValue.id}}

To Install Caddy Web Server By Docker On Rocky Linux 8.6

Introduction:

Caddy is a Go language-based open-source, extensile, platform-independent web server. It is the only web server that uses HTTPS by default. It is both a tool for helping with tedious tasks and a way to organize multiple parts into a simplified system.

Installation Procedure:

Step 1: Check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release 
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.6 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSI

Step 2: Create a Web content by using the below command

[root@linuxhelp ~]# vim index.html
<h1 style="background-color:DodgerBlue;">Welcome To Linuxhelp </h1>
<p style="background-color:Tomato;"> Installation of  Caddy Web Server by Docker on Rocky Linux 8.6 </p>

Step 3: Pull the Caddy Image from Docker Hub by using the below command

[root@linuxhelp ~]# docker pull caddy 
Using default tag: latest
latest: Pulling from library/caddy
530afca65e2e: Pull complete 
4ba0a25d6623: Pull complete 
7a501877fabb: Pull complete 
d2c62335257e: Pull complete 
4e4608ab095f: Pull complete 
Digest: sha256:f51603577fef8abe01dfda4b5ef85b3acf2844a6b3d0db873f5119f57db5de57
Status: Downloaded newer image for caddy:latest
docker.io/library/caddy:latest

Step 4: Run the Container with name “webserver” with mapping the Port 80 to the host and defining volume for web content and data directory by using the below command

[root@linuxhelp ~]# docker run --name webserver -p 80:80 -v $PWD/index.html:/usr/share/caddy/index.html -v caddy_data:/data caddy
{"level":"info","ts":1658780754.78602,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1658780754.816135,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"warn","ts":1658780754.8164184,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
{"level":"info","ts":1658780754.8175206,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1658780754.8175352,"msg":"serving initial configuration"}
{"level":"info","ts":1658780754.817722,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00019b340"}
{"level":"info","ts":1658780754.8177469,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
{"level":"info","ts":1658780754.81776,"logger":"tls","msg":"finished cleaning storage units"}

Step 5: Ping the Host system’s IP address on Browser as shown in the below image

snap1

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Install Caddy Web Server by Docker on Rocky Linux 8.6 . Your feedback is much welcome.

Tags:
albiejames
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is Caddy Webserver?

A

Caddy 2 is an enterprise-ready, open-source web server written in Go with automatic HTTPS.

Q

How does a Caddy server work?

A

Image result for caddy server.Caddy is the only web server that automatically and by default uses HTTPS.

Q

What special features of Caddy?

A

Caddy automatically obtains and renews TLS certificates for your website.

Q

Who uses the Caddy server?

A

Caddy Server is typically used by businesses with 1-10 employees and 1M-10M in revenue.

Q

Does Caddy need port 80?

A

Yes, port 80 must be externally accessible.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.