How to get free ssl certficate in Ubuntu

How to get free ssl certficate in Ubuntu

1: Update your package list:

sudo apt update

2: Install Certbot and the Certbot plugin for your web server. If you’re using Apache, run:

sudo apt install certbot python3-certbot-apache

3: If you’re using Nginx, run:

sudo apt install certbot python3-certbot-nginx

4: Obtain an SSL Certificate

For Apache:

sudo certbot --apache

For Nginx

udo certbot --nginx

Follow the prompts to complete the installation. Certbot will automatically configure your web server to use the new certificate. (the prompt will ask you to input your domain names)

After installation, you can verify that the SSL certificate is working by visiting your website using https://. You should see a padlock icon in the address bar, indicating that the connection is secure.

5:Set Up Automatic Renewal

In general, The ssl certificate will expire in 3 month, you can set up the certficate auto update schedule with following command:

sudo certbot renew --dry-run

If there are no errors, the automatic renewal is set up correctly.

Certbot sets up a systemd timer to handle renewals automatically. You can check its status with:

sudo systemctl status certbot.timer

6: Update WordPress Settings

  • Log in to your WordPress admin dashboard.
  • Go to Settings > General.
  • Update the WordPress Address (URL) and Site Address (URL) to use https:// instead of http://.
  • Save the changes.


Leave a Reply

Your email address will not be published. Required fields are marked *