• Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / nginx server tutorials (installation, configuration, performance tuning, security) / letsencrypt install configure on ubuntu / debian nginx

letsencrypt install configure on ubuntu / debian nginx

 

Table of Contents

Toggle
  • #1 Installing Letsencrypt Certbot on ubuntu
  • #2. Installing Nginx Plugin for Letsencrypt certbot
  • #3 Configuring lets encrypt for ACME challenges (Imp)
    • #a. Create a Directory & a Letsencrypt conf file
    • #b.  Make a Directory for ACME Challenges by letsencrypt
    • #C Including Snippets.conf in  nginx.conf or Sererblock
  • #4 Automatically issuing Letsencrypt SSL Certificates with nginx Plugin
    • Renewing SSL Certificate
  • Renewing letsencrypt with cloudflare DNS
    • Migration of ssl Letsencrypt Certificates Won’t works
    • Uninstalling Deleting Letsencrypt ssl
  • Configuring with Cloudflare

#1 Installing Letsencrypt Certbot on ubuntu

 

#a.Updating existing Packages & Adding Repository

run this command

sudo apt-get update && sudo add-apt-repository ppa:certbot/certbot

 

#2. Installing Nginx Plugin for Letsencrypt certbot

run below command to update the newly added repository

sudo apt-get update

and this command to install ppa nginx

sudo apt-get install -y python-certbot-nginx

 

#3 Configuring lets encrypt for ACME challenges (Imp)

Many Ways to do this. but i used this method for issuing all domains in server.

#a. Create a Directory & a Letsencrypt conf file

if snippets Directory not exists create it by

mkdir  /etc/nginx/snippets/

nano /etc/nginx/snippets/letsencrypt.conf

location ^~ /.well-known/acme-challenge/ {
        default_type “text/plain”;
        root /var/www/letsencrypt;
}

#b.  Make a Directory for ACME Challenges by letsencrypt

1st step: run below command
mkdir /var/www/letsencrypt;
2nd step : add permissions to nginx user.
sudo chown www-data:www-data /var/www/letsencrypt

#C Including Snippets.conf in  nginx.conf or Sererblock

If you want to use the code  / ssl in one website use it directly on website block.
if multiple websites include in nginx.conf
include /etc/nginx/snippets/letsencrypt.conf;
So the small piece of included in conf file.

#4 Automatically issuing Letsencrypt SSL Certificates with nginx Plugin

 

a. Run Below COmmand It will list all all Domains Available in the Server

IMP auto

sudo certbot –nginx

sudo certbot --nginx

 

//auto configuration by letsencrypt to server block

sudo certbot –nginx certonly

// need to add config files manually

NOTE: turnoff cloudflare DNS while renewing or issuing certificate with dns

b. Select the Number of Domains  , multiple or single (Separated by comma or Space) then hit enter

 

Letsencrypt

automatically Adds SSL Configuration in to Website Server blocks.

 

Renewing SSL Certificate

renewal by default automatic

To renew all domains

sudo certbot renew

To view all domains for renewals

sudo certbot renew –dry-run

renew single Domain

certbot renew –cert-name Domain.com

 

Renewing letsencrypt with cloudflare DNS

 

Cloudflare should be turnoff yellow to grey or enable development mode.

 

Migration of ssl Letsencrypt Certificates Won’t works

i tried 2-3 times, by Copying /etc/letsencrypt/Live / Certificates

but it won’t works.

change email letsencrypt

certbot update_account –email yourname+1@example.com

 

Uninstalling Deleting Letsencrypt ssl

Manually by removing

 

or Cert bot command

 

after the command you have to manually remove the code in server block.

 

listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/rajuginni.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/rajuginni.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/rajuginni.com/fullchain.pem;

 

Configuring with Cloudflare

FIx error redirected many times
Cloudflare SSL  Full Strict
Change Domain url in database https not http.
In wordpress login to phpmyadmin update in url in wp-options table. or use wp-config.php
to define(‘FORCE_SSL_ADMIN’, true);

nginx server tutorials (installation, configuration, performance tuning, security)

  • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian wordpress
  • fix error 520 522 524 on cloudflare wordpress godaddy nginx etc
  • nginx fastcgi cache wordpress how to configure
  • install LEMP Stack on 22.04 LTS Nginx MySQL PHP fpm #wordpress #digital ocean
  • Apache vs nginx (connection handling, modules, memory usage)
  • Pagespeed module install, configure, monitor, errors ft nginx &apache
  • nginx errors (504,502, 413, unable to start, syntax errors)
  • nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
  • use nginx as reverse proxy and load balancer for apache wordpress
  • nginx rewrite rules with examples 301 redirection
  • nginx modules list (enable, disable, upgrade, install dynamic module)
  • php fpm pool manager configuration settings based on server spike high cpu wordpress
  • php fpm restart nginx ubuntu enable status page, monitor etc
  • what is TTFB & how to Reduce it (server response time) Google pagespeed
  • letsencrypt install configure on ubuntu / debian nginx
  • Top 10 tips to improve nginx server security
  • nginx performance tuning connections, buffers file descriptors
  • enable brotli compression nginx brotli vs gzip
  • nginx installation on ubuntu 20.04 LTS
  • monitor nginx request with nginx status amplify datadog new relic
  • SSL faster reduce TLS hand shake improve https performance
  • nginx rate limiting explained by location time specific url
  • datadog nginx integration installation process
  • newrelic nginx integration process and errors fix and metrics
  • php fpm seems busy fixed warning and max children reached to handle max connections / requests
  • Php fpm configuration for 1000 concurrent connections server busy max children reached
  • php fpm ondemand vs dynamic vs Static (the dynamic pool problem)
  • nginx upstream response is buffered to a temporary file
  • php fpm install ubuntu 20.04 nginx
  • install phpmyadmin ubuntu nginx 22.04
  • upgrade php fpm ubuntu nginx 7.4 to 8.2
  • nginx add last modified header (remove, php wordpress)
  • php fpm dynamic pool manager settings
  • nginx fastcgi cache purge
  • nginx open file limit connections ulimits sysctl
  • php fpm high cpu usage WordPress 4 solutions nay work for you
  • nginx buffer size for wordpress
  • Cloudflare error code 524 nginx a timeout error occured
  • server configuration for 1000 concurrent users

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy