How to Install Caddy on Windows 10?
Caddy is a web server that is simple, fast, and secure. In this tutorial, we will guide you on how to install Caddy on Windows 10.
Prerequisites
Before proceeding with the installation, you must ensure that your system has:
- Windows 10 (64-bit)
- PowerShell 7.1+
Installation
To install Caddy on Windows 10, follow the following steps:
Open PowerShell by searching for it in the start menu or by pressing
Windows Key + Xand selecting PowerShell from the context menu.Type the following command in the PowerShell window:
iwr https://dl.cloudsmith.io/public/caddy/stable/windows/amd64/caddy_2.4.5_windows_amd64.zip -OutFile caddy.zipThis command will download the latest stable release of Caddy for Windows 10.
Extract the downloaded
caddy.zipfile. Navigate to the folder where you saved thecaddy.zipfile and extract it using the built-in Windows Zip extractor or any third-party software.After extracting the
caddy.zipfile, you can see thecaddy.exefile in the extracted folder.To run Caddy, open a PowerShell window, and navigate to the extracted folder using the
cdcommand:cd path/to/extracted/folderFinally, run the Caddy web server by running the following command:
./caddy.exe runYou should see the following output in the PowerShell window:
{"level":"info","ts":1626781326.4057703,"msg":"using provided configuration","config_file":"/mnt/d/code/caddy/Caddyfile","config_adapter":"caddyfile"} {"level":"info","ts":1626781326.4107702,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"],"auth":{"type":"none"}} {"level":"info","ts":1626781326.4127703,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443} {"level":"info","ts":1626781326.4127703,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"} {"level":"info","ts":1626781326.4147704,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["localhost"]} {"level":"warn","ts":1626781326.4157708,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [::1]: lookup _tcp.localhost: no such service instance"} {"level":"info","ts":1626781326.4207714,"logger":"tls.obtain","msg":"acquiring lock","identifier":"localhost"} {"level":"info","ts":1626781326.6228366,"logger":"tls.obtain","msg":"lock acquired","identifier":"localhost"} {"level":"info","ts":1626781326.6248317,"logger":"tls.obtain","msg":"managed certificate","identifier":"localhost","subjects":["localhost"],"issuer_key":"[REDACTED]","rsa_key_size":2048,"ecdsa_curve":"P-256"} {"level":"info","ts":1626781327.161223,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv1"} {"level":"info","ts":1626781327.161223,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["{redacted]"]} {"level":"warn","ts":1626781327.161223,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [REDACTED]: lookup [REDACTED]: no such host"} {"level":"info","ts":1626781327.1622245,"logger":"tls.obtain","msg":"acquiring lock","identifier":"[REDACTED]"} {"level":"info","ts":1626781327.2486267,"logger":"tls.obtain","msg":"lock acquired","identifier":"[REDACTED]"} {"level":"info","ts":1626781327.2506216,"logger":"tls.obtain","msg":"managed certificate","identifier":"[REDACTED]","subjects":["[REDACTED]"],"issuer_key":"[REDACTED]","rsa_key_size":2048,"ecdsa_curve":"P-256"}This output means that the Caddy server is running successfully.
Conclusion
Congratulations! You have installed Caddy on your Windows 10 machine. You can now use Caddy to serve your websites or web applications. If you encounter any issues, feel free to consult the official Caddy documentation.