Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zoonderkins/f815394a498aeb71da2d8d5558ab2160 to your computer and use it in GitHub Desktop.
Save zoonderkins/f815394a498aeb71da2d8d5558ab2160 to your computer and use it in GitHub Desktop.
Fresh caddy install on debian with xcaddy + webdav module

Install Caddy

apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

One line install WebDav

caddy add-package github.com/mholt/caddy-webdav

Install golang

rm -rf /usr/local/go
GOVERSION="1.21.4"
wget "https://golang.org/dl/go${GOVERSION}.linux-amd64.tar.gz" -4
tar -C /usr/local -xvf "go${GOVERSION}.linux-amd64.tar.gz"
rm "go${GOVERSION}.linux-amd64.tar.gz"

cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF

source ~/.bashrc

Xcaddy + Webdav

go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
xcaddy build --with github.com/mholt/caddy-WebDAV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment