MC-BARS.COMDomains · SSL · HTTPS · Guides

MC-BARS.COM / Articles / How to Install a Free Let’s Encrypt SSL Certificate

How to Install a Free Let’s Encrypt SSL Certificate

Home / Articles / How to Install a Free Let’s Encrypt SSL Certificate
Practical Guide · SSL / TLS

How to Install a Free Let’s Encrypt SSL Certificate

A step-by-step guide to issuing and installing Let’s Encrypt on Nginx and Apache, configuring HTTPS, automatic renewal, and troubleshooting errors.

Prepared for MC-BARS.COM · Updated: November 5, 2026 · Main text length: 12,911 characters
Illustration for the article about SSL and HTTPS

Important note: Server configurations and certificate issuance rules change over time. Before modifying a live website, check the official documentation and save a backup.

1. What Let’s Encrypt Is and Who It’s For

Let’s Encrypt is a public certificate authority that issues free certificates for secure TLS connections. Its goal is to make HTTPS available without manual document exchange or a complex issuance process. The ACME protocol is used for automation: a client on the server proves control over the domain and obtains a certificate.

For a small website, blog, online store, or corporate portal, a free DV certificate is usually suitable if there are no special requirements for verifying a legal entity. However, having a certificate does not replace server configuration or software updates. Let’s Encrypt verifies control over a name, but does not guarantee that the website owner is trustworthy.

The guide below is intended for servers managed by an administrator. On ordinary shared hosting, it is often enough to enable SSL in the control panel. Section names and available methods may vary, so when using REG.RU, Beget, or another provider, consult its current documentation.

2. What to Check Before Installation

The first requirement is that the domain name must point to the correct server. A and AAAA records must be checked separately: if the IPv6 record points to an old server, domain validation may fail. The second requirement is that the chosen validation method is available. HTTP-01 usually requires access to the website on port 80, even if the main site already works over HTTPS.

You need permission to modify the web server configuration or access to the hosting control panel. Before making changes, it is a good idea to save the current configuration files and make sure a backup exists. For a live website, it is important to know who manages the reverse proxy, CDN, and DNS: the certificate may need to be installed somewhere other than where the application code is hosted.

List the names that need a certificate in advance: example.ru, www.example.ru, and any required subdomains. Each name must pass the applicable validation. Do not automatically add test or forgotten subdomains—DNS errors and unavailable virtual hosts can prevent issuance.

Let’s Encrypt Certificate Issuance and Renewal Steps
Certificate issuance: DNS, proof of control, installation, and renewal.

3. How Domain Validation Works

With the HTTP-01 method, the ACME client places a special response on the web server at a path such as /.well-known/acme-challenge/. The certificate authority accesses the domain and checks this response. If requests reach the wrong server, are blocked by security measures, or are redirected incorrectly, validation will fail.

The DNS-01 method uses a temporary TXT record in DNS. It is especially useful for Wildcard certificates and infrastructure where the web server is not accessible from the outside. Automating DNS-01 often requires the DNS provider’s API. Restrict the permissions for this token and store it as a secret, since DNS access can affect the domain’s security.

The TLS-ALPN-01 method performs validation using a special TLS response on port 443 and is not supported by all tools and configurations. HTTP-01 is more convenient for most simple servers, while DNS-01 is better for wildcard certificates and some complex infrastructure. The choice depends on the actual network setup, not just personal preference.

4. Installing Certbot on Ubuntu and Debian

Certbot is one of the widely used ACME clients. The installation method depends on the operating system version and update policy. The official Certbot documentation provides current instructions for specific environments; in some cases, the Snap package is used. Do not copy commands from an old article without checking compatibility.

Before running it, make sure the server has internet access, the domain resolves correctly, and the web server is already handling HTTP requests. Checking the client version helps determine whether it supports the required plugins. Run commands with sudo only after understanding their purpose, since they can change the system configuration.

If the site is on managed hosting without SSH access, you do not need to install Certbot manually. It is much safer to use the provider’s built-in tool. Configuring multiple independent renewal mechanisms at the same time can cause conflicts and unpredictable certificate replacement.

5. Issuing a Certificate for Nginx

When using Nginx, first check that the configuration is valid and the server handles the required domain name. The nginx -t command checks the syntax and helps detect errors before reloading. If there are multiple virtual hosts, make sure that server_name matches the requested name.

In a typical setup, Certbot with the Nginx plugin can validate the domain, request a certificate, and offer to modify the HTTPS configuration. Example command: sudo certbot --nginx -d example.ru -d www.example.ru. Here, example.ru is a sample address that must be replaced with the actual domain. The command will fail if DNS or server accessibility is configured incorrectly.

After issuance, check which server block handles HTTPS, which certificate is being used, and whether HTTP is redirected. Do not blindly copy someone else’s configuration file: proxy, caching, PHP, and static resource settings vary between sites. If an error occurs, restore the saved configuration and investigate the cause.

Nginx example (replace the domain)
sudo nginx -t
sudo certbot --nginx -d example.ru -d www.example.ru

6. Issuing a Certificate for Apache

Apache usually uses virtual hosts with ServerName and ServerAlias directives. Before running the client, it is a good idea to run apachectl configtest and check that the required domain actually opens over HTTP. A configuration error can prevent automatic issuance and even stop the server from reloading.

For a typical setup with a supported plugin, use the command sudo certbot --apache -d example.ru -d www.example.ru. This is an example, not a universal recipe: on some systems, the plugin must be installed separately, and for complex configurations it is safer to use webroot or configure the certificate manually.

After installation, check the virtual host on port 443, the domain name match, the presence of the full chain, and the redirect. If you use a load balancer or CDN, the certificate may be required at multiple points in the infrastructure. Opening the home page does not guarantee that other addresses and subdomains work correctly.

Apache example (replace the domain)
sudo apachectl configtest
sudo certbot --apache -d example.ru -d www.example.ru

7. How to Install a Certificate Manually

If the automatic plugin is not suitable, an ACME client can obtain a certificate without changing the web server configuration. In that case, the administrator specifies the paths to the full chain file and private key manually. A typical Certbot setup uses the files fullchain.pem and privkey.pem, but the exact paths depend on the installation and client used.

The private key must be accessible only to the necessary system processes. Do not place it in the public website directory, send it to support chat, or add it to a repository. The web server must have permission to read the key through a properly configured startup mechanism, not by removing all access restrictions.

After changing the configuration, check the syntax and safely reload the service. Then verify that the server is actually serving the new certificate, rather than an old one from another virtual host. If you use multiple nodes and a load balancer, the update must reach every node that serves visitors.

8. Configuring an HTTP-to-HTTPS Redirect

After installing the certificate, decide which address will be primary: with or without www. Most standard websites use a permanent redirect from HTTP to HTTPS, as well as a single canonical domain version. This avoids creating multiple copies of the same page and helps visitors reach the secure address.

The redirect should preserve the path and any required query parameters, if that is consistent with the application’s logic. Do not create chains of multiple redirects or a loop where the CDN sends the request to HTTP and the server redirects it back to HTTPS indefinitely. Before enabling strict policies, test forms, user accounts, APIs, and admin sections.

Then check canonical, internal links, sitemap.xml, robots.txt, and resource URLs. Scripts and styles that are still loaded over HTTP can cause mixed content. Such links often remain in old templates, CMS settings, user content, and third-party widget integrations.

9. Automatic Renewal and Verification

Let’s Encrypt certificates are designed for regular renewal, so automation is part of the installation, not an optional extra. Depending on the installation method, Certbot creates a systemd timer or another scheduled task. Check the actual schedule and execution results, not just whether the program is installed.

The sudo certbot renew --dry-run command lets you test the renewal process without a regular production certificate issuance. It is especially useful after changing DNS, the web server, or the domain validation method. Keep in mind the limitations of the test environment and the specifics of the plugin in use, so a successful dry run does not replace monitoring the real certificate.

If the certificate renews but the web server continues using the old version, a suitable deploy-hook may be needed to reload the configuration. Configure it according to the service’s specifics. Good practice includes separate notifications for renewal failures and external monitoring of the certificate’s expiration date.

Testing the Renewal Process
sudo certbot renew --dry-run

10. How to Diagnose Issuance Errors

A DNS error message usually means that the domain does not resolve or points to the wrong place. Check A, AAAA, and CNAME records, as well as the time it takes for changes to propagate. If HTTP-01 validation fails, check that port 80 is accessible, review firewall rules and proxy operation, and make sure the test path can be opened from the internet.

A rate limit error means that the certificate authority has temporarily limited certain operations. Do not repeatedly retry production requests. First fix the cause, then use the test environment if possible. Errors involving an incorrect chain or a name mismatch should be diagnosed separately from issuance errors: a certificate may have been obtained but installed incorrectly.

It is helpful to read the exact output from the ACME client and the system logs. When asking for help, you can provide the error text, domain name, and redacted configuration excerpts, but do not publish private keys, DNS API tokens, passwords, or other secrets.

11. Wildcard Certificate via DNS-01

A certificate for *.example.ru is convenient when you need to serve many subdomains at the same level. The DNS-01 validation method is used to issue it through Let’s Encrypt. Note that the *.example.ru record does not automatically cover example.ru or nested second-level names, so plan the set of SANs in advance.

Adding TXT records manually is possible for a one-time issuance, but it is inconvenient for regular renewal. Automation uses a DNS plugin or another ACME client that supports the DNS provider’s API. Before issuing an API token, check whether it can be restricted to a specific zone and the minimum set of operations.

If several services use the same wildcard certificate and private key, compromising any one node increases the risk to the whole group. In some cases, issuing separate certificates for different applications is safer. The choice depends on the infrastructure, access requirements, and ability to automate renewals reliably.

12. Verifying the Installation

Start by opening the site in several browsers and on a mobile device. Make sure the address matches the certificate and no untrusted connection warning appears. Then check pages with forms, login, payments, images, and third-party scripts. An error on only one page often indicates mixed content or incorrect links.

You should also run an external check of the TLS configuration and see which protocol versions the server supports. Avoid enabling obsolete protocols for questionable compatibility benefits. For most public websites, refer to current Mozilla recommendations and the documentation for the web server in use.

The final step is to check redirects, renewal, and monitoring. It is helpful to record the verification date, issuance method, list of domains, and a link to the internal recovery instructions. This helps keep HTTPS working not only on the day of installation, but also after server updates and administrator changes.

13. Frequently Asked Questions

Can Let’s Encrypt be used on a commercial website? Yes, provided the issuance requirements are met and TLS is configured correctly. Do I need to buy a separate certificate for www? No, both names can be included in one certificate. Why isn’t a certificate issued immediately after registering a domain? DNS may not yet point to the server, or domain control validation may be failing.

Can I install a certificate without access to the server? On managed hosting, the control panel is often sufficient. If the server belongs to another organization, coordinate the installation with its administrator. What happens when the certificate expires? Browsers will start showing warnings, so renewal should be checked in advance.

Which method should I choose—HTTP-01 or DNS-01? HTTP-01 is often convenient for a regular web server that is accessible from the internet. DNS-01 is suitable for wildcard certificates and some closed infrastructures. In both cases, protect keys and credentials, and verify successful issuance not only from the client’s message but also by checking the actual HTTPS connection.

Additional guides

Other articles can help you verify certificate installation and understand HTTPS configuration.

DV, OV and EV · SSL on WordPress · SSL on Beget

IP Geolocation by DB-IP