How to Generate a CSR for Your SSL Certificate (Linux and Windows)

Generating a CSR for an SSL certificate

How to Generate a CSR for Your SSL Certificate (Linux and Windows)

Create a CSR and private key on Linux or Windows Server, paste it into your SSL order and pick the right domain validation method.

A CSR (certificate signing request) is a small block of encoded text that holds your domain name, your organization details and a public key. You generate a CSR on your own server, paste it into your SSL order, and DigiCert uses it to issue your certificate. The matching private key never leaves your server.

This guide is for Cloud VPS Hosts customers who ordered a RapidSSL, GeoTrust or DigiCert certificate for a website running on a VPS or dedicated server. By the end you will have a CSR ready to paste into your order and a private key saved where your web server can use it.

What do you need before you generate a CSR?

You need command line or desktop access to the server that will host the website, and the exact domain name the certificate will protect.

  • SSH access as root or a sudo user for Linux servers. If you have not set this up yet, see Setting up an SSH key.
  • An RDP session with administrator rights for Windows servers. Our guide on RDP on a Windows VPS covers connecting.
  • The domain name exactly as visitors will type it, for example www.example.com or example.com. For a Wildcard certificate, use *.example.com.
  • For OV and EV certificates, your organization’s legal name, city, state or region and country, written exactly as they appear in official registration records. DigiCert checks these details.

Which details go into a CSR?

Every CSR contains the same handful of fields. The Common Name is the one that matters most, because the certificate is issued for that name.

Field What to enter Example
Common Name (CN) The domain the certificate will protect www.example.com
Organization (O) Your legal business name. For DV certificates any name, or your own name, is fine. Example Ltd
Organizational Unit (OU) Leave blank. Public CAs no longer include this field in certificates. (blank)
City or Locality (L) City where the organization is registered Berlin
State or Province (ST) Full name, not an abbreviation Berlin
Country (C) Two-letter ISO country code DE
Key size RSA 2048 bits or higher 2048

How do you generate a CSR on Linux with OpenSSL?

On Ubuntu, Debian, AlmaLinux and most other distributions, one OpenSSL command creates both the private key and the CSR. OpenSSL is installed by default on our Linux images.

1. Create a folder for the key

Keep the private key in a folder only root can read:

sudo mkdir -p /etc/ssl/private
sudo chmod 700 /etc/ssl/private
cd /etc/ssl/private

2. Run the OpenSSL command

Replace example.com with your own domain in both file names:

sudo openssl req -new -newkey rsa:2048 -nodes \
  -keyout example.com.key \
  -out example.com.csr

OpenSSL then asks for each field from the table above. Type the values and press Enter after each one. When it asks for “A challenge password” and “An optional company name”, press Enter to leave them empty.

If you prefer to skip the prompts, you can pass every field in one line:

sudo openssl req -new -newkey rsa:2048 -nodes \
  -keyout example.com.key -out example.com.csr \
  -subj "/C=DE/ST=Berlin/L=Berlin/O=Example Ltd/CN=www.example.com"

3. Protect the private key

sudo chmod 600 /etc/ssl/private/example.com.key

Do not email this file, paste it anywhere or share it with anyone, including our support team. Anyone who has it can impersonate your site.

4. Display the CSR

sudo cat /etc/ssl/private/example.com.csr

Copy everything from -----BEGIN CERTIFICATE REQUEST----- to -----END CERTIFICATE REQUEST-----, including those two lines.

5. Check the CSR before you submit it

A typo in the domain means a certificate for the wrong name, so check the content first:

openssl req -in /etc/ssl/private/example.com.csr -noout -text | grep Subject:

The output should show your Common Name and organization details exactly as you intended.

How do you generate a CSR on Windows Server with IIS?

On a Windows VPS running IIS, create the CSR in IIS Manager. Windows then keeps the private key in its certificate store, and you never handle a key file yourself.

  1. Open Server Manager, then Tools > Internet Information Services (IIS) Manager.
  2. In the left pane, click the server name. In the middle pane, double-click Server Certificates.
  3. In the right Actions pane, click Create Certificate Request.
  4. Fill in the Distinguished Name Properties. “Common name” is your domain, for example www.example.com. Use the full name of your state or province. Click Next.
  5. Leave the cryptographic service provider as Microsoft RSA SChannel Cryptographic Provider and set the bit length to 2048. Click Next.
  6. Choose a file name such as C:\ssl\example.com.csr and click Finish.
  7. Open the file in Notepad and copy the full text, including the BEGIN and END lines.

Generate the request on the same server where you will install the certificate. The pending request, and its private key, live in that server’s certificate store. The IIS installation guide picks up from here.

Where do you paste the CSR in your order?

Paste the CSR into the SSL configuration form in the Cloud VPS Hosts client area, then choose how you want to prove you control the domain.

After payment, you receive an email with a link to configure your certificate. You can also reach the same form from the client area.

  1. Click the link in the email, or log in to the client area, open Services > My Services and select your SSL certificate.
  2. Paste the full CSR and select your web server type.
  3. Enter the administrative contact details.
  4. Choose a validation method, then submit.

Which domain validation method should you choose?

Pick DNS validation if you manage your DNS records. Pick HTTP file validation if the domain already points to your server and serves a website on port 80. Pick email if you can receive mail at an admin address on the domain.

Method What you do Best when
DNS Add a TXT or CNAME record that DigiCert gives you You control the domain’s DNS, and the site may not be live yet
HTTP file Upload a small text file to /.well-known/pki-validation/ on your site The domain already points to your server and port 80 is open
Email Click a link sent to an address such as admin@ or webmaster@ your domain You can receive mail on the domain

DV certificates are usually issued within minutes of successful validation. OV certificates take one to three days, and EV certificates typically one to three days, because DigiCert also verifies your organization.

Next step: install the certificate

Once DigiCert issues your certificate, install it with the guide for your web server:

Still choosing a certificate? Compare DV, OV, EV and Wildcard SSL certificates in our store.

Frequently asked questions

Can I reuse the same CSR when I renew or reissue my certificate?

You can, but generating a new key and CSR each time is safer. A fresh key limits the damage if an old one was ever exposed. It takes under a minute with the commands above.

What happens if I lose my private key?

The certificate cannot be installed without the key that matches it. Generate a new key and CSR, open your certificate in the client area and select Reissue Certificate. Reissues are free for the life of your certificate.

Should I use www.example.com or example.com as the Common Name?

Use the version your visitors use most. For single-domain RapidSSL, GeoTrust and DigiCert certificates, DigiCert normally covers both the www and non-www versions when you order one of them. Check the issued certificate’s Subject Alternative Names to confirm.

Do I need a dedicated IP address for SSL?

No. Modern servers use SNI (Server Name Indication), so several SSL sites can share one IP address on the same server.

How long is my certificate valid?

Since March 15, 2026, public SSL certificates can be valid for a maximum of 200 days, and DigiCert issues them for up to 199 days. If you bought one or more years, you reissue the certificate before it expires and install the new one. Reissues are included in your subscription.

Post Your Comment

Knowledgebase
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.