How to Install Caddy Web Server on Debian 13

Caddy is a powerful, user-friendly web server known for its ease of use, automatic HTTPS, and simple configuration. It's a great choice for developers looking to quickly and securely deploy web applications.

Prerequisites

  • A Debian 13 VPS

Update the System

Before beginning any installation, it's a good practice to update your system's package index and upgrade the installed packages to the latest versions. This ensures you have the most recent updates and security patches.

apt update && apt upgrade -y

Install Dependencies

Before installing Caddy, we need to install some necessary dependencies that help in managing packages and secure communications. Run the following command to install these dependencies:

apt install gnupg curl apt-transport-https debian-keyring debian-archive-keyring -y

Add the Caddy Repository

Import the Caddy GPG Key

To ensure the integrity and authenticity of the Caddy packages, add the official GPG key:

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

Add the Caddy Repository to Your Sources List

Next, add the Caddy repository to your list of package sources so that you can install Caddy directly from it:

wget -qO - https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt | tee /etc/apt/sources.list.d/caddy.list

Output:

root@vps:~# wget -qO - https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt | tee /etc/apt/sources.list.d/caddy.list
# Source: Caddy
# Site: https://github.com/caddyserver/caddy
# Repository: Caddy / stable
# Description: Fast, multi-platform web server with automatic HTTPS

deb [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main

deb-src [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main

Update the Package Index

After adding the repository, refresh the package index to include the new Caddy repository:

apt update

Output:

root@vps:~# apt update
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://deb.debian.org/debian trixie-updates InRelease
Hit:3 http://security.debian.org/debian-security trixie-security InRelease
Get:4 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease [14.8 kB]
Get:5 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version/main amd64 Packages [4,329 B]
Fetched 19.1 kB in 1s (28.0 kB/s)
All packages are up to date.

Install Caddy

With the repository added and the package index updated, install Caddy using the following command:

apt install caddy -y

Output:

root@vps:~# apt install caddy -y
Installing:
  caddy

Summary:
  Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0
  Download size: 16.0 MB
  Space needed: 44.5 MB / 23.3 GB available

Get:1 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version/main amd64 caddy amd64 2.10.2 [16.0 MB]
Fetched 16.0 MB in 1s (16.7 MB/s)
Selecting previously unselected package caddy.
(Reading database ... 38557 files and directories currently installed.)
Preparing to unpack .../caddy_2.10.2_amd64.deb ...
Unpacking caddy (2.10.2) ...
Setting up caddy (2.10.2) ...
Created symlink '/etc/systemd/system/multi-user.target.wants/caddy.service' → '/usr/lib/systemd/system/caddy.service'.
Processing triggers for man-db (2.13.1-1) ...

Verify Caddy Installation

Caddy starts automatically after installation. To check its status and ensure it’s running properly, use:

systemctl status caddy

Output:

root@vps:~# systemctl status caddy
● caddy.service - Caddy
     Loaded: loaded (/usr/lib/systemd/system/caddy.service; enabled; preset: en>
     Active: active (running) since Tue 2025-09-16 17:53:13 UTC; 2min 10s ago
 Invocation: 4b684faf47344181a83684feded4c547
       Docs: https://caddyserver.com/docs/
   Main PID: 4876 (caddy)
      Tasks: 8 (limit: 7052)
     Memory: 14.5M (peak: 15.2M)
        CPU: 251ms
     CGroup: /system.slice/caddy.service
             └─4876 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

Access the Caddy Web Interface

To confirm that Caddy is running, open your web browser and navigate to:

http://YOUR_SERVER_IP_ADDRESS

If Caddy is running correctly, you should see the Caddy welcome page like below:

images

Done, this guide has covered the essential steps to get Caddy up and running, from updating your system to accessing the Caddy web interface. Enjoy the powerful features of Caddy for your web server needs!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS