--- title: "Install" --- # Install Caddy is available for every platform as a [static binary](https://github.com/caddyserver/caddy/releases) (it has no dependencies). You can also [build from source](#build-from-source) to customize your build. ## Official packages We maintain [official distributions](https://github.com/caddyserver/dist) for the following platforms: - **Docker** [docker pull caddy](https://hub.docker.com/_/caddy) - **Fedora, RedHat, CentOS** Read how to [install the Caddy COPR](https://copr.fedorainfracloud.org/coprs/g/caddy/caddy/). - **DigitalOcean** [Create a Caddy droplet](https://marketplace.digitalocean.com/apps/caddy) and get started in 90 seconds. ## Linux service Requirements: - `caddy` binary that you downloaded or built from source - `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`:
groupadd --system caddy
Create a user named `caddy`, with a writeable home folder:
useradd --system \
--gid caddy \
--create-home \
--home-dir /var/lib/caddy \
--shell /usr/sbin/nologin \
--comment "Caddy web server" \
caddy
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 with 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!
To start the service for the first time, do 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
## Build from source
Requirements:
- [Go](https://golang.org/dl) 1.14 or newer
- [Go modules](https://github.com/golang/go/wiki/Modules) enabled
Download the source code:
git clone "https://github.com/caddyserver/caddy.git"
Build:
cd caddy/cmd/caddy/
go build
### With plugins
Using [xcaddy](https://github.com/caddyserver/xcaddy), you can compile Caddy with extra plugins, for example:
xcaddy build v2.0.0-rc.3 \
--with github.com/caddyserver/nginx-adapter
--with github.com/caddyserver/ntlm-transport@v0.1.0