DEV Community

Cover image for Certbot installation procedure for Windows
Subramanyam Rekhandar
Subramanyam Rekhandar

Posted on

Certbot installation procedure for Windows

Note::

Certbot is now officially available for Windows. If you find that Certbot is not the most suitable Let's Encrypt client application for your use case, there are many other clients written by other organizations and developers that you may be able to use to obtain a certificate from Let's Encrypt.

1.Important notes

This procedure follows the current Certbot implementation for Windows, in particular the fact that it installs as a system component, and requires administrative privileges. These instructions will be updated when a future version of Certbot switches to a different installation method. No installers for HTTP servers are supported for now (Certbot for Windows can currently obtain your certificate from Let's Encrypt, but not install it into your web server application).

2.Specific Windows system requirements and user knowledge requirements

1.The user needs to be familiar with the command-line interface
(CLI), because Certbot is a pure CLI program.
2.The user must use an account with administrative privileges to
install and run Certbot.
3.PowerShell and CMD.EXE are supported; both need to be started
with elevated privileges before invoking Certbot.
4.Path C:\Certbot must be writable by the current user.

3.Specific Windows limitations and configuration

1.All usual operations to create and manage an account, manage
existing certificates, or select the ACME server, are
supported.
2.Only standalone, manual and webroot authenticator plugins are
supported. DNS plugins will be available soon. This means that
Certbot for Windows is currently unable to automatically renew
wildcard certificates, since these require a DNS plugin in
order to be renewed without user intervention.
3.No installer plugins are supported. The Apache and Nginx plugins
will be available soon, and a plugin to install certificates
into IIS is under development.
4.Automated certificate renewals (using standalone and webroot
plugins) are supported.

4.Installation instructions (default)

1.Connect to the server.
2.Connect locally or remotely (using Remote Desktop) to the
server using an account that has administrative privileges for
thismachine.
3.Install Certbot.
4.Download the latest version of the Certbot installer for Windows
at https://dl.eff.org/certbot-beta-installer-win32.exe.
5.Run the installer and follow the wizard. The installer will
propose a default installation directory, C:\Program Files(x86),
that can be customized.)
6.To start a shell for Certbot, select the Start menu, enter cmd
(to run CMD.EXE) or powershell (to run PowerShell), and click on
“Run as administrator” in the contextual menu that shows up
above.
7.Run Certbot as a shell command.

To run a command on Certbot, enter the name certbot in the shell,
followed by the command and its parameters. For instance, to
display the inline help, run:

 ::C:\WINDOWS\system32> certbot --help.
Enter fullscreen mode Exit fullscreen mode

5.Choose how you’d like to run Certbot

  ::Are you ok with temporarily stopping your website?
Enter fullscreen mode Exit fullscreen mode

Yes, my web server is not currently running on this machine.

Stop your webserver, then run this command to get a certificate. Certbot will temporarily spin up a webserver on your machine.

::C:\WINDOWS\system32> certbot certonly --standalone.
Enter fullscreen mode Exit fullscreen mode

Important Note:

::To use the webroot plugin, your server must be configured to serve files from hidden directories. If /.well-known is treated specially by your webserver configuration, you might need to modify the configuration to ensure that files inside /.well-known/acme-challenge are served by the webserver.::
Enter fullscreen mode Exit fullscreen mode

6.Install your certificate

You'll need to install your new certificate in the configuration file or interface for your webserver. Certificates are located in

    ::C:\Certbot\live\[certificate_name].
Enter fullscreen mode Exit fullscreen mode

where [certificate_name] is the name of your certificate (usually the first domain if the --cert-name flag has not been used on the certonly command). Currently, Certbot for Windows cannot automate the installation step; future versions will be able to automate it for specific webserver applications.

7.Test automatic renewal

The Certbot installation on your system comes with a pre-installed Scheduled Task that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running the command

  ::C:\WINDOWS\system32> certbot renew --dry-run
Enter fullscreen mode Exit fullscreen mode

If you needed to stop your webserver to run Certbot (for example, if you used the standalone authenticator on a machine where port 80 is normally in use), you'll want to edit the built-in command to add the --pre-hook and --post-hook flags to stop and start your webserver automatically. For example, if your webserver is Apache 2.4, add the following to the certbot renew command.

  ::--pre-hook "net.exe stop Apache2.4" --post-hook "net.exe start Apache2.4"
Enter fullscreen mode Exit fullscreen mode




8.Confirm that Certbot worked

To confirm that your site is set up properly.

9.Note for Windows Apache or Nginx users

As described in section 5 above, Certbot for Windows currently cannot install the certificate in Apache or Nginx for you. As of the most recent release, you will have to edit your web server application’s configuration to install the certificate yourself after Certbot has obtained it. If this limitation is acceptable to you, please start from the beginning of this document to learn more about installing and using Certbot on Windows.

Top comments (3)

Collapse
 
tienpvse1 profile image
Phan Văn Tiến

Thanks sir, this post help me a lots !!!

Collapse
 
solomon_alemayehu_22657ac profile image
Solomon Alemayehu

dl.eff.org/certbot-beta-installer-....
unable to download it

Collapse
 
solomon_alemayehu_22657ac profile image
Solomon Alemayehu