How To Build Caddy From Source

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

Caddy is a fast, open-source and security-focused web server written in Go. Caddy includes modern features such as support for virtual hosts, minification of static files, and HTTP/2. Caddy is also the first web-server that can obtain and renew SSL/TLS certificates automatically using Let’s Encrypt.

Before you Begin

Install Go

  1. You need the latest version of Go installed on your Linode. Complete the steps in our guide on installing Go.

Install xcaddy

Install the latest version of xcaddy, a command line tool that downloads and builds Caddy and its plugins for you easily.

  1. Download and install xcaddy:

     sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
     curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-xcaddy.asc
     curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list
     sudo apt update
     sudo apt install xcaddy
    

Build Caddy

  1. Create a folder named caddy and go to the folder to install Caddy: mkdir ~/caddy cd ~/caddy
  • To build the latest version of Caddy without any plugins: xcaddy build

  • To install Caddy with plugins use the --with option. For example:

      xcaddy build \
        --with github.com/caddyserver/nginx-adapter \
        --with github.com/caddyserver/ntlm-transport@v0.1.1```
    
  1. Move the caddy executable from the caddy folder to /usr/bin to install:

     sudo mv caddy /usr/bin
    
  2. To verify the installation of caddy type: caddy version An output similar to the following appears:

     v2.4.4 h1:QBsN1jXEsCqRpKPBb8ebVnBNgPxwL50HINWWTuZ7evU=
    

Caddy is now installed on your Linode. Read our guide on Installing and Configuring Caddy to learn more about Caddy.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.