--- title: "Install" --- # Install This page describes various methods for installing Caddy on your system. **Official:** - [Static binaries](#static-binaries) - [Debian, Ubuntu, Raspbian](#debian-ubuntu-raspbian) - [Fedora, RedHat, CentOS](#fedora-redhat-centos) - [Docker](#docker) - [DigitalOcean](#digitalocean) - [Linux service](#linux-service) **Community-maintained:** - [Homebrew](#homebrew) - [Webi](#webi) - [Chocolatey](#chocolatey) ## Static binaries Simply downloading a Caddy binary does not install it as a service, but can be useful in dev or when upgrading an existing installation. - [**View releases on GitHub**](https://github.com/caddyserver/caddy/releases) (expand "Assets") - [**Use our download page**](/download) ## Debian, Ubuntu, Raspbian
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
    | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
sudo apt update
sudo apt install caddy
Installing this package automatically starts and runs Caddy for you as a systemd service named `caddy` using our official [caddy.service](https://github.com/caddyserver/dist/blob/master/init/caddy.service) unit file. ## Fedora, RedHat, CentOS Fedora or RHEL/CentOS 8:
dnf install 'dnf-command(copr)'
dnf copr enable @caddy/caddy
dnf install caddy
RHEL/CentOS 7:
yum install yum-plugin-copr
yum copr enable @caddy/caddy
yum install caddy
[**View the Caddy COPR**](https://copr.fedorainfracloud.org/coprs/g/caddy/caddy/) ## Docker
docker pull caddy
[**View on Docker Hub**](https://hub.docker.com/_/caddy) ## DigitalOcean [**Deploy a Caddy droplet on DigitalOcean**](https://marketplace.digitalocean.com/apps/caddy) ## Linux service Manually install Caddy as a service on Linux with these instructions. **Requirements:** - `caddy` binary that you [downloaded](/download) or [built from source](/docs/build) - `systemctl --version` 232 or newer - `sudo` privileges Move the caddy binary into your `$PATH`, for example:
sudo mv caddy /usr/bin/
Test that it worked:
caddy version
Create a group named `caddy`:
sudo groupadd --system caddy
Create a user named `caddy`, with a writeable home folder:
sudo useradd --system \
    --gid caddy \
    --create-home \
    --home-dir /var/lib/caddy \
    --shell /usr/sbin/nologin \
    --comment "Caddy web server" \
    caddy
If using a config file, be sure it is readable by the `caddy` user you just created. Next, [choose a systemd service file](https://github.com/caddyserver/dist/blob/master/init) based on your use case: - [**`caddy.service`**](https://github.com/caddyserver/dist/blob/master/init/caddy.service) if you configure Caddy with a file. - [**`caddy-api.service`**](https://github.com/caddyserver/dist/blob/master/init/caddy-api.service) if you configure Caddy solely through its API. They are very similar but have minor differences in the ExecStart and ExecReload commands to accommodate your workflow. Customize the file accordingly. **Double-check the `ExecStart` and `ExecReload` directives.** Make sure the binary's location and command line arguments are correct for your installation! For example: if using a config file, change your `--config` path if it is different from our example. The usual place to save the service file is: `/etc/systemd/system/caddy.service` After saving your service file, you can start the service for the first time with the usual systemctl dance:
sudo systemctl daemon-reload
sudo systemctl enable caddy
sudo systemctl start caddy
Verify that it is running:
systemctl status caddy
When running with our official service file, Caddy's output will be redirected to `journalctl`:
journalctl -u caddy
If using a config file, you can gracefully apply any changes:
sudo systemctl reload caddy
You can stop the service with:
sudo systemctl stop caddy
## Homebrew _Note: This is a community-maintained installation method._
brew install caddy
[**View the Homebrew formula**](https://formulae.brew.sh/formula/caddy) ## Webi _Note: This is a community-maintained installation method._ Linux and macOS:
curl -sS https://webinstall.dev/caddy | bash
Windows:
curl.exe -A MS https://webinstall.dev/caddy | powershell
You may need to adjust the Windows firewall rules to allow non-localhost incoming connections. [**View on Webi**](https://webinstall.dev/caddy) ## Chocolatey _Note: This is a community-maintained installation method._
choco install caddy
[**View the Chocolatey package**](https://chocolatey.org/packages/caddy)