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, https://5.252.155.155:2087
  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.
ls
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).

-----BEGIN CERTIFICATE REQUEST-----
MIIC5jCCAc4CAQAwgaAxCzAJBgNVBAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDAS
BgNVBAcMC1BhbmFtYSBDaXR5MRIwEAYDVQQKDAl5b2hvc3RvcmcxFDASBgNVBAsM
C1dlYiBIb3N0aW5nMR0wGwYDVQQDDBRidXlkb21haW53aXRoYnRjLmNvbTEhMB8G
CSqGSIb3DQEJARYSc3VwcG9ydEB5b2hvc3Qub3JnMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEA5e0Y0+t7r/hHOwK9Xx+B25GV+ynsLvQZlZ3MNUhqqqGw
p1f1evqnt9QMYx+KeW35r1FoaikkyIsdKUL7TJJ/IiSL5c8UXYX0rEheM0ViXmHM
eMCacvfLzQQHF3nPCHVnGLk/vGqCl+vqf7fSuFD65YbgM10KX17znT7i3bW78i0z
RGv+gRTEeHoAjfu6VWcKmiBgZCBGTDrloZXSrS59ZpMBYsTl01p3cltnBONz+wTT
qguF+1eO1VHIoQoQUq11tUjlNTIVBdZfnxSSB98TM0UkOTGkATDRsLxwc/3u7D3O
hBSt7QZ2bryFh9I1T+paBUpiO+wUV9/8/tQR8NXJ3QIDAQABoAAwDQYJKoZIhvcN
AQELBQADggEBAMiebRwFyTUbw68CyR6grJhCCa0CGw5q5wU/xrnbPufFFtldNS00
KpM+TztfWKFEpoZ8dTiEyT7XpyC4HAKvnolALLxPSxUxQqZWCuPwkrh0/+seSpPy
jviVJhaWJ0WavXX7+DAL/UqqCUwsdRIKzBDG7xRUf5JU+0iRxWLBh7z/SVevaEvx
2nkSz7nPf5sNPeJA+ejn1/vaLJ56z7nd70/+A+ODo1fKmbZ4/o8gBivK+afWnyj9
k97u7MjFErlQLBfrVNwczABsr4Xp4B836+AC/0w7RQiG+HOfHGd6fJN9dks+N5Q+
bitistoLCnD+v7cCoQHcggaQHElWTsH71KU=
-----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.