---
tags:
  - Server
title : Caddy
description : Caddy
date : 2025-01-01
author : Nikola Petrov
---

https://caddyserver.com/docs/

### Install
```
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
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
```

### Change privilege to access port 80 and 443
```
sudo setcap cap_net_bind_service=+ep $(which caddy)
```

### Caddyfile

/etc/caddy/Caddyfile

```
petrovv.com {
	reverse_proxy * 0.0.0.0:4080
}
lang.petrovv.com {
	reverse_proxy * 0.0.0.0:8010
}
vault.petrovv.com {
	reverse_proxy * 0.0.0.0:6080
}
git.petrovv.com {
	reverse_proxy * 0.0.0.0:3000
}
game.petrovv.com {
	reverse_proxy * 0.0.0.0:8080
}
rss.petrovv.com {
	reverse_proxy * 0.0.0.0:8082
}
files.petrovv.com {
	root * /srv
	file_server browse
}
```


### comands

```
caddy start
caddy stop
caddy reload
```




