How To Install caddy on Debian 12

Learn how to install caddy on Debian 12 with this tutorial. caddy is Fast, lightweight web server with automatic HTTPS

Introduction

In this tutorial we learn how to install caddy on Debian 12.

What is caddy

caddy is:

Caddy is a multi purpose web server written in Go.

Features:

  • Easy configuration
  • Automatic HTTPS by default
    • ZeroSSL and Let’s Encrypt for public names
    • Fully-managed local CA for internal names & IPs
    • Can coordinate with other Caddy instances in a cluster
    • Multi-issuer fallback
  • HTTP/1.1, HTTP/2, and experimental HTTP/3 support

There are three methods to install caddy on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install caddy Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install caddy using apt-get by running the following command:

sudo apt-get -y install caddy

Install caddy Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install caddy using apt by running the following command:

sudo apt -y install caddy

Install caddy Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install caddy using aptitude by running the following command:

sudo aptitude -y install caddy

How To Uninstall caddy on Debian 12

To uninstall only the caddy package we can use the following command:

sudo apt-get remove caddy

Uninstall caddy And Its Dependencies

To uninstall caddy and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove caddy

Remove caddy Configurations and Data

To remove caddy configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge caddy

Remove caddy configuration, data, and all of its dependencies

We can use the following command to remove caddy configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge caddy

Dependencies

caddy have the following dependencies:

References

Summary

In this tutorial we learn how to install caddy package on Debian 12 using different package management tools: apt, apt-get and aptitude.