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:

Installation

To install Caddy on Windows 10, follow the following steps:

  1. Open PowerShell by searching for it in the start menu or by pressing Windows Key + X and selecting PowerShell from the context menu.

  2. 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.zip
    

    This command will download the latest stable release of Caddy for Windows 10.

  3. Extract the downloaded caddy.zip file. Navigate to the folder where you saved the caddy.zip file and extract it using the built-in Windows Zip extractor or any third-party software.

  4. After extracting the caddy.zip file, you can see the caddy.exe file in the extracted folder.

  5. To run Caddy, open a PowerShell window, and navigate to the extracted folder using the cd command:

    cd path/to/extracted/folder
    
  6. Finally, run the Caddy web server by running the following command:

    ./caddy.exe run
    
  7. You 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.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!