Caddy – A Lightweight HTTP/2 Web Server to Deploy and Test Websites Easily

A web server is a Server side application designed to process HTTP requests between client and server. HTTP is the basic and very widely used network protocol. We all would be familiar with Apache...

Spread the love

A web server is a Server side application designed to process HTTP requests between client and server. HTTP is the basic and very widely used network protocol. We all would be familiar with Apache HTTP Server.

Apache HTTP Server played an important role in designing what web is today. It alone has a market share of 38%. Microsoft IIS comes second in the list having a market share of 34%. Nginx and Google’s GWS comes at number 3 and 4 having a market share of 15% and 2% respectively.

Last day I came across a web server named Caddy. When I tried to inquire it’s features and deployed it to testing, I must say it is amazing. A web server which is portable and do not need any configuration file. I though it is a very cool project and wanted to share it with you. Here we have given Caddy a try!

What is Caddy?

Caddy is an alternative web server easy to configure and use. Matt Holt – The Project leader of Caddy claims that Caddy is a general-purpose web server, claims to be designed for human and it is probably the only of its kind.

Features of Caddy

  1. Speedy HTTP requests using HTTP/2.
  2. Capable Web Server with least configuration and hassle free deployment.
  3. TLS encryption ensure, encryption between communicating applications and user over Internet. You may use your own keys and certificates.
  4. Easy to deploy/use. Just one single file and no dependency on any platform.
  5. No installation required.
  6. Portable Executables.
  7. Run on multiple CPUs/Cores.
  8. Advanced WebSockets technology – interactive communication session between browser and server.
  9. Server Markdown documents on the fly.
  10. Full support for latest IPv6.
  11. Creates log in custom format.
  12. Serve FastCGI, Reverse Proxy, Rewrite and Redirects, Clean URL, Gzip compression, Directory Browsing, Virtual Hosts and Headers.
  13. Available for All known Platform – Windows, Linux, BSD, Mac, Android.

What make caddy Different?

  1. Caddy aims at serving web as it should be in the year 2017 and not traditional style.
  2. It is designed not only to serve HTTP request but also human.
  3. Loaded with Latest features – HTTP/2, IPv6, Markdown, WebSockets, FastCGI, templates and other out-of-box features.
  4. Run the executables without the need of Installing it.
  5. Detailed documentation with least technical description.
  6. Developed keeping in mind the need and ease of Designers, Developers and Bloggers.
  7. Support Virtual Host – Define as many sites as you want.
  8. Suited for you – no matter if your site is static or dynamic. If you are human it is for you.
  9. You focus on what to achieve and not how to achieve.
  10. Availability of support for most number of platforms – Windows, Linux, Mac, Android, BSD.
  11. Usually, you have one Caddy file per site.
  12. Set up in less than 1 minute, even if you are not that much computer friendly.
Testing Environment


I will be testing it on CentOS server, as well as Debian Server. For both the server I am going to use 64 bit executables.

Operating Systems: CentOS 7 and Debian 8 Jessie
Caddy Version: 0.5.1 - 64-bit

Installation of Caddy Server in Linux

No matter you are on what platform and which kind of architecture your are using, caddy provides ready to use executable packages, which can be downloaded from the official caddy download page.

Alternatively, you can use following command to download and install into a folder caddy and change current working directory to caddy and list the contents of the directory.

$ mkdir caddy
$ cd caddy
$ sudo curl https://getcaddy.com | bash

Now create any html page (you may create your own) and save the page under caddy folder. Now fire the caddy executable and point your browser to localhost at port 2015/index.html and you should be able to see your page.

$ caddy

If the html page is saved as index.html you don’t need to tell your browser to look for the file name as index.html is the primary file, which will be looked automatically.

Caddy Web Server

Caddy Web Server

The default port caddy uses is 2015. You may kill the process ‘caddy‘ once it is done or you may like to run another instance of caddy in the same login session.

$ pkill caddy

Conclusion

If you are newbies and want to setup a webserver without getting your hands dirty with configuration, this tool is for you. Even if you are an experienced user whose need is instant and simple web server Caddy is worth a try. With a little configuration you may also set folder permission, control authentication, error pages, Gzip, HTTP redirect and others, if you need to setup a more complex and advanced webserver.

Don’t take Caddy as a replacement of Apache or Nginx. Caddy is not designed to handle high traffic production environment. It is designed for quick web server setup when you concern is speed and reliability.

References

Complete user Guide / Full Documentation of Caddy Web Server

We have brought this documentation which aims at quick review and installation instructions with images where ever necessary. If you come across any pros/cons of the project or any suggestion, you may give it to us in our comment section.

For me this project is too young still works flawlessly and seems powerful and promising. The biggest plus point I see is caddy don’t need to carry its configuration file everywhere. It aims at providing the best of nginx, lighthttpd, vagrant and websocketd. That’s all from my side. Keep connected to Tecmint. Kudos

Facebook Comments
Spread the love

Posted by News Monkey