1. Linux

How to generate CSR in cPanel and Ubuntu 20.04?

When you are looking to get an SSL certificate, you will be asked for a CSR (certificate signing request) during the order. In this article we will show you how to generate CSR in cPanel and also no control panel Ubuntu OS. Let’s go!

What is CSR?

CSR is an encoded request to the certificate authority. It contains your public key and some required information for the creation of SSL, like domain name, company name etc.

How to create CSR in cPanel?

  1. Login to WHM. By default WHM is located at port 2087. For example,
  2. On the left hand menu find “SSL/TLS
  3. Generate an SSL Certificate and Signing Request. Yes, a self-signed SSL will be generated along with CSR. You will not be able to use this SSL on your website, since your visitors will receive security warning.

    Fill in the required fields with your company information, like it’s shown on the pictures below.

  4. Passphrase is not required. Once you filled all the required info, press “Create“.
  5. You will be directed to the page containing all 3 components – private key, signing request (CSR) and self-signed certificate.
  6. Copy the content of Signing Request and send it to your SSL vendor.

How to generate CSR in Ubuntu 20.04 (22.04)

Although we will use command line, the process is simple even for not tech-savvy people.

  1. Login to your server via SSH
  2. Enter the command below. Replace mydomain with your domain name.
    openssl req -new -newkey rsa:2048 -nodes -keyout mydomain.key -out mydomain.csr
  3. You will be presented with some questions to answer. The process is pretty self-explanatory.
  4. Country name. 2 letter country code (for example, Panama – PA)
    State or province name.
    Locality name. City for your company registration (in full)
    Organization name. Name of your company (without any dots)
    Organizational Unit Name. You can enter the name of your department, like “Hosting Support”
    Common name. Your domain name (ex. buydomainwithbtc.com)
    Email Address.

  5. CSR generation has been completed.

Location of CSR in Ubuntu 20.04/22.04

CSR will be created and put in the directory from where you initiated the command. After you completed the previous steps, simply enter.
You will see both .csr and .key files.

To copy, open it with any editor, like nano.

nano mydomain.csr

Make sure to copy it with both starting and ending lines (Begin certificate request/End certificate request).


If you are a yohost.org customer, you can also ask our support team to help you generate CSR. We will help to do it even if your website is not hosted with us.