DEV Community

Artur Yolchyan
Artur Yolchyan

Posted on

How to Install SSL Certificate on WordPress on Ubuntu Server?

Alt Text

In the current days, most modern websites have SSL certificates installed. So, let's look at how we can install an SSL certificate with WordPress.

First things first, it depends on your WordPress hosting provider how you can set up an SSL certificate. Some hosting providers will setup an SSL certificate automatically for you. So, sometimes you don't need to have any technical knowledge.

So, now let's look at the ways to install an SSL certificate on WordPress when you manage your own servers.

Prerequisites to install SSL

First of all, you should have an access to your server where you want to install an SSL certificate. You will usually need SSH access to perform the installation.

Another thing is to make sure, your server IP address provided by your hosting provider is added to your domain as an A record.

The best way to install an SSL certificate for WordPress is by certbot. Certbot can power your WordPress website with a Let's Encrypt SSL certificate for free!

So, if you get the SSH access and mapped your domain with the IP Address we are ready to go.

Install Certificate

  1. First thing, SSH to your server.
  2. Execute this command: apt-get install software-properties-common python-software-properties
  3. Execute this command: add-apt-repository ppa:certbot/certbot
  4. Execute this command: apt-get update
  5. Execute this command: apt-get install python-certbot-apache
  6. Execute this command certbot --apache -d change-this-to-your
  7. Should you popped up with Y/N, enter Y and press enter to continue.
  8. When it will ask if it should redirect http traffic to https, enter Y and press enter to continue.

You're done with setting up an SSL certificate for your WordPress website. Please not, you might need to renew this certificate every three months.

Discussion (0)