How To Install Caddy Web Server on Ubuntu 16.04 LTS

r00t August 28, 2017

Install Caddy Web Server on Ubuntu 16.04 LTS

In this tutorial we will show you how to install Caddy Web Server on Ubuntu 16.04 LTS. For those of you who didn’t know, For those of you who didn’t know, Caddy is a modern, general-purpose, multi-platform web server which supports Virtual hosting, HTTP/2, IPv6, Markdown, WebSockets, FastCGI, automatic HTTPS via Let’s Encrypt, templates and more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Caddy Web Server on a Ubuntu 16.04 Xenial Xerus server.

Install Caddy Web Server on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Caddy Web Server.

Install Caddy is quick and easy with run the following command:

Once the installation is completed, we need to add the cap_net_bind_servicecapability to the Caddy binary:

Step 3. Setting Up Necessary Directories.

Next, create the directories where we will store the Caddy configuration file Caddyfile and SSL certificates:

Step 4. Installing Caddy as a System Service.

We also need to create a new SystemD configuration script:

Add following line:

Execute the following commands to enable Caddy to run on boot:

Step 5. Creating Test Web Page and a Caddyfile.

For testing purposes, we will create a test HTML file:

Next, add our domain to the Caddy configuration file:

Add following line:

Save the file and exit the editor. To apply the changes, restart Caddy:

Now, with a web browser, just go to, and you will see our test page!

Congratulation’s! You have successfully installed Caddy. Thanks for using this tutorial for installing Caddy web server in Ubuntu 16.04 Xenial Xerus system. For additional help or useful information, we recommend you to check the official Caddy web server web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!



Leave a Comment