@marcel91200 / caddy Mirror · read-only
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 10, 23:45 UTC

master
md 225 lines 12.4 KB
Rendered Raw
1 <p align="center">
2 <a href="https://caddyserver.com">
3 <picture>
4 <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/1d6be89c-df8a-438c-b01d-cef6bf56440a">
5 <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/3a5b7419-6925-48f6-ae75-d231f4a4f0c2">
6 <img src="https://github.com/user-attachments/assets/3a5b7419-6925-48f6-ae75-d231f4a4f0c2" alt="Caddy" width="550">
7 </picture>
8 </a>
9 <br>
10 <h3 align="center">a <a href="https://zerossl.com"><img src="https://user-images.githubusercontent.com/55066419/208327323-2770dc16-ec09-43a0-9035-c5b872c2ad7f.svg" height="28" style="vertical-align: -7.7px" valign="middle"></a> project</h3>
11 </p>
12 <hr>
13 <h3 align="center">Every site on HTTPS</h3>
14 <p align="center">Caddy is an extensible server platform that uses TLS by default.</p>
15 <p align="center">
16 <a href="https://github.com/caddyserver/caddy/releases">Releases</a> ·
17 <a href="https://caddyserver.com/docs/">Documentation</a> ·
18 <a href="https://caddy.community">Get Help</a>
19 </p>
20 <p align="center">
21 <a href="https://github.com/caddyserver/caddy/actions/workflows/ci.yml"><img src="https://github.com/caddyserver/caddy/actions/workflows/ci.yml/badge.svg"></a>
22 &nbsp;
23 <a href="https://www.bestpractices.dev/projects/7141"><img src="https://www.bestpractices.dev/projects/7141/badge"></a>
24 &nbsp;
25 <a href="https://pkg.go.dev/github.com/caddyserver/caddy/v2"><img src="https://img.shields.io/badge/godoc-reference-%23007d9c.svg"></a>
26 &nbsp;
27 <a href="https://x.com/caddyserver" title="@caddyserver on Twitter"><img src="https://img.shields.io/twitter/follow/caddyserver" alt="@caddyserver on Twitter"></a>
28 &nbsp;
29 <a href="https://caddy.community" title="Caddy Forum"><img src="https://img.shields.io/badge/community-forum-ff69b4.svg" alt="Caddy Forum"></a>
30 <br>
31 <a href="https://sourcegraph.com/github.com/caddyserver/caddy?badge" title="Caddy on Sourcegraph"><img src="https://sourcegraph.com/github.com/caddyserver/caddy/-/badge.svg" alt="Caddy on Sourcegraph"></a>
32 &nbsp;
33 <a href="https://cloudsmith.io/~caddy/repos/"><img src="https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith" alt="Cloudsmith"></a>
34 </p>
35 <p align="center">
36 <b>Powered by</b>
37 <br>
38 <a href="https://github.com/caddyserver/certmagic">
39 <picture>
40 <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/55066419/206946718-740b6371-3df3-4d72-a822-47e4c48af999.png">
41 <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/1128849/49704830-49d37200-fbd5-11e8-8385-767e0cd033c3.png">
42 <img src="https://user-images.githubusercontent.com/1128849/49704830-49d37200-fbd5-11e8-8385-767e0cd033c3.png" alt="CertMagic" width="250">
43 </picture>
44 </a>
45 </p>
46
47 <!-- Warp sponsorship requests this section -->
48 <div align="center" markdown="1">
49 <hr>
50 <sup>Special thanks to:</sup>
51 <br>
52 <a href="https://go.warp.dev/caddy">
53 <img alt="Warp sponsorship" width="400" src="https://github.com/user-attachments/assets/c8efffde-18c7-4af4-83ed-b1aba2dda394">
54 </a>
55
56 ### [Warp, built for coding with multiple AI agents](https://go.warp.dev/caddy)
57 [Available for MacOS, Linux, & Windows](https://go.warp.dev/caddy)<br>
58 </div>
59
60 <hr>
61
62 ### Menu
63
64 - [Features](#features)
65 - [Install](#install)
66 - [Build from source](#build-from-source)
67 - [For development](#for-development)
68 - [With version information and/or plugins](#with-version-information-andor-plugins)
69 - [Quick start](#quick-start)
70 - [Overview](#overview)
71 - [Full documentation](#full-documentation)
72 - [Getting help](#getting-help)
73 - [About](#about)
74
75
76 ## [Features](https://caddyserver.com/features)
77
78 - **Easy configuration** with the [Caddyfile](https://caddyserver.com/docs/caddyfile)
79 - **Powerful configuration** with its [native JSON config](https://caddyserver.com/docs/json/)
80 - **Dynamic configuration** with the [JSON API](https://caddyserver.com/docs/api)
81 - [**Config adapters**](https://caddyserver.com/docs/config-adapters) if you don't like JSON
82 - **Automatic HTTPS** by default
83 - [ZeroSSL](https://zerossl.com) and [Let's Encrypt](https://letsencrypt.org) for public names
84 - Fully-managed local CA for internal names & IPs
85 - Can coordinate with other Caddy instances in a cluster
86 - Multi-issuer fallback
87 - Encrypted ClientHello (ECH) support
88 - **Stays up when other servers go down** due to TLS/OCSP/certificate-related issues
89 - **Production-ready** after serving trillions of requests and managing millions of TLS certificates
90 - **Scales to hundreds of thousands of sites** as proven in production
91 - **HTTP/1.1, HTTP/2, and HTTP/3** all supported by default
92 - **Highly extensible** [modular architecture](https://caddyserver.com/docs/architecture) lets Caddy do anything without bloat
93 - **Runs anywhere** with **no external dependencies** (not even libc)
94 - Written in Go, a language with higher **memory safety guarantees** than other servers
95 - Actually **fun to use**
96 - So much more to [discover](https://caddyserver.com/features)
97
98 ## Install
99
100 The simplest, cross-platform way to get started is to download Caddy from [GitHub Releases](https://github.com/caddyserver/caddy/releases) and place the executable file in your PATH.
101
102 See [our online documentation](https://caddyserver.com/docs/install) for other install instructions.
103
104 ## Build from source
105
106 Requirements:
107
108 - [Go 1.26.0 or newer](https://golang.org/dl/)
109
110 ### For development
111
112 _**Note:** These steps [will not embed proper version information](https://github.com/golang/go/issues/29228). For that, please follow the instructions in the next section._
113
114 ```bash
115 $ git clone "https://github.com/caddyserver/caddy.git"
116 $ cd caddy/cmd/caddy/
117 $ go build
118 ```
119
120 When you run Caddy, it may try to bind to low ports unless otherwise specified in your config. If your OS requires elevated privileges for this, you will need to give your new binary permission to do so. On Linux, this can be done easily with: `sudo setcap cap_net_bind_service=+ep ./caddy`
121
122 If you prefer to use `go run` which only creates temporary binaries, you can still do this with the included `setcap.sh` like so:
123
124 ```bash
125 $ go run -exec ./setcap.sh main.go
126 ```
127
128 If you don't want to type your password for `setcap`, use `sudo visudo` to edit your sudoers file and allow your user account to run that command without a password, for example:
129
130 ```
131 username ALL=(ALL:ALL) NOPASSWD: /usr/sbin/setcap
132 ```
133
134 replacing `username` with your actual username. Please be careful and only do this if you know what you are doing! We are only qualified to document how to use Caddy, not Go tooling or your computer, and we are providing these instructions for convenience only; please learn how to use your own computer at your own risk and make any needful adjustments.
135
136 Then you can run the tests in all modules or a specific one:
137
138 ```bash
139 $ go test ./...
140 $ go test ./modules/caddyhttp/tracing/
141 ```
142
143 ### With version information and/or plugins
144
145 Using [our builder tool, `xcaddy`](https://github.com/caddyserver/xcaddy)...
146
147 ```bash
148 $ xcaddy build
149 ```
150
151 ...the following steps are automated:
152
153 1. Create a new folder: `mkdir caddy`
154 2. Change into it: `cd caddy`
155 3. Copy [Caddy's main.go](https://github.com/caddyserver/caddy/blob/master/cmd/caddy/main.go) into the empty folder. Add imports for any custom plugins you want to add.
156 4. Initialize a Go module: `go mod init caddy`
157 5. (Optional) Pin Caddy version: `go get github.com/caddyserver/caddy/v2@version` replacing `version` with a git tag, commit, or branch name.
158 6. (Optional) Add plugins by adding their import: `_ "import/path/here"`
159 7. Compile: `go build -tags=nobadger,nomysql,nopgx`
160
161
162
163
164 ## Quick start
165
166 The [Caddy website](https://caddyserver.com/docs/) has documentation that includes tutorials, quick-start guides, reference, and more.
167
168 **We recommend that all users -- regardless of experience level -- do our [Getting Started](https://caddyserver.com/docs/getting-started) guide to become familiar with using Caddy.**
169
170 If you've only got a minute, [the website has several quick-start tutorials](https://caddyserver.com/docs/quick-starts) to choose from! However, after finishing a quick-start tutorial, please read more documentation to understand how the software works. 🙂
171
172
173
174
175 ## Overview
176
177 Caddy is most often used as an HTTPS server, but it is suitable for any long-running Go program. First and foremost, it is a platform to run Go applications. Caddy "apps" are just Go programs that are implemented as Caddy modules. Two apps -- `tls` and `http` -- ship standard with Caddy.
178
179 Caddy apps instantly benefit from [automated documentation](https://caddyserver.com/docs/json/), graceful on-line [config changes via API](https://caddyserver.com/docs/api), and unification with other Caddy apps.
180
181 Although [JSON](https://caddyserver.com/docs/json/) is Caddy's native config language, Caddy can accept input from [config adapters](https://caddyserver.com/docs/config-adapters) which can essentially convert any config format of your choice into JSON: Caddyfile, JSON 5, YAML, TOML, NGINX config, and more.
182
183 The primary way to configure Caddy is through [its API](https://caddyserver.com/docs/api), but if you prefer config files, the [command-line interface](https://caddyserver.com/docs/command-line) supports those too.
184
185 Caddy exposes an unprecedented level of control compared to any web server in existence. In Caddy, you are usually setting the actual values of the initialized types in memory that power everything from your HTTP handlers and TLS handshakes to your storage medium. Caddy is also ridiculously extensible, with a powerful plugin system that makes vast improvements over other web servers.
186
187 To wield the power of this design, you need to know how the config document is structured. Please see [our documentation site](https://caddyserver.com/docs/) for details about [Caddy's config structure](https://caddyserver.com/docs/json/).
188
189 Nearly all of Caddy's configuration is contained in a single config document, rather than being scattered across CLI flags and env variables and a configuration file as with other web servers. This makes managing your server config more straightforward and reduces hidden variables/factors.
190
191
192 ## Full documentation
193
194 Our website has complete documentation:
195
196 **https://caddyserver.com/docs/**
197
198 The docs are also open source. You can contribute to them here: https://github.com/caddyserver/website
199
200
201
202 ## Getting help
203
204 - We advise companies using Caddy to secure a support contract through [Ardan Labs](https://www.ardanlabs.com) before help is needed.
205
206 - A [sponsorship](https://github.com/sponsors/mholt) goes a long way! We can offer private help to sponsors. If Caddy is benefitting your company, please consider a sponsorship. This not only helps fund full-time work to ensure the longevity of the project, it provides your company the resources, support, and discounts you need; along with being a great look for your company to your customers and potential customers!
207
208 - Individuals can exchange help for free on our community forum at https://caddy.community. Remember that people give help out of their spare time and good will. The best way to get help is to give it first!
209
210 Please use our [issue tracker](https://github.com/caddyserver/caddy/issues) only for bug reports and feature requests, i.e. actionable development items (support questions will usually be referred to the forums).
211
212
213
214 ## About
215
216 Matthew Holt began developing Caddy in 2014 while studying computer science at Brigham Young University. (The name "Caddy" was chosen because this software helps with the tedious, mundane tasks of serving the Web, and is also a single place for multiple things to be organized together.) It soon became the first web server to use HTTPS automatically and by default, and now has hundreds of contributors and has served trillions of HTTPS requests.
217
218 **The name "Caddy" is trademarked.** The name of the software is "Caddy", not "Caddy Server" or "CaddyServer". Please call it "Caddy" or, if you wish to clarify, "the Caddy web server". Caddy is a registered trademark of Stack Holdings GmbH.
219
220 - _Project on X: [@caddyserver](https://x.com/caddyserver)_
221 - _Author on X: [@mholt6](https://x.com/mholt6)_
222
223 Caddy is a project of [ZeroSSL](https://zerossl.com), an HID Global company.
224
225 Debian package repository hosting is graciously provided by [Cloudsmith](https://cloudsmith.com). Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.