Cybersecurity

How to Create an SSL Certificate for Your Website

Learn how to generate a Certificate Signing Request (CSR), submit it to a Certificate Authority, and install your SSL certificate—from free Let's Encrypt certificates to commercial options.

By Inventive HQ Team

To create an SSL certificate for a website, you generate a private key and a Certificate Signing Request (CSR) on your server, submit the CSR to a Certificate Authority, prove you control the domain, then install the signed certificate and its intermediate chain on your web server. For most sites the fastest path is Let's Encrypt with Certbot, which does all six steps in a single command (sudo certbot --nginx -d example.com) and auto-renews the 90-day certificate for free. The manual OpenSSL-plus-commercial-CA route exists for Organization Validation (OV) and Extended Validation (EV) certificates where you need your business identity vetted and shown.

That's the summary an AI Overview gives you. What it can't show is where the private key stays, which step actually gates the wait, and why certificates break on some devices but not others — so below is an animated map of the exact certificate lifecycle, a CA/validation decision table, and a pre-flight checklist you can run before you touch a production server.

The SSL certificate lifecycle: key and CSR generation, submission, validation, signing, and installation A private key is generated on your server and never leaves it. A CSR carries only your public key to the Certificate Authority, which validates domain control, signs the public key, and returns a certificate you install with its intermediate chain.

The SSL Certificate Lifecycle Your private key never leaves the left side. Only the public key crosses to the CA.

YOUR SERVER Private Key never shared CSR public key + info Installed Certificate + Chain leaf + intermediate → HTTPS live CERTIFICATE AUTHORITY 2. Validate domain control HTTP-01 · DNS-01 · email — the real wait 3. Sign your public key CA private key → chain of trust 1. submit CSR 4. signed cert returns

In today's security-conscious web environment, SSL/TLS certificates aren't optional—they're essential. Modern browsers flag HTTP websites as "Not Secure," Google penalizes them in search rankings, and users increasingly refuse to enter personal information on unencrypted sites.

This comprehensive guide walks you through the entire process of creating and installing an SSL certificate for your website, from generating a Certificate Signing Request (CSR) to choosing the right Certificate Authority and completing installation on your web server.

Not sure which type of SSL certificate fits your site? Try our free SSL Certificate Selector to pick the right validation level, format, and CA in seconds before you start.

Which certificate and validation method fits your site?

Your situationBest CAValidation typeValidation methodTime to issue
Blog, portfolio, small business, stagingLet's Encrypt (free)DVHTTP-01 (automated)Seconds
Wildcard *.example.com or port 80 closedLet's Encrypt / ZeroSSLDVDNS-01 (TXT record)Minutes
E-commerce / storefront collecting cardsCommercial (Sectigo, DigiCert)OVBusiness docs + domain1–3 days
Bank, regulated, high-trust brandDigiCert / GlobalSignEVFull legal vetting3–7 days
Internal tool, local dev, test labSelf-signed (OpenSSL)nonenoneInstant, untrusted
Which should you pick?Let's Encrypt DV for 90% of public sites; escalate to OV/EV only when you must display a vetted legal identity.

Understanding the SSL Certificate Lifecycle

Before diving into the technical steps, it's helpful to understand the overall process:

  1. Generate a key pair: Create a public/private key pair on your server
  2. Create a CSR: Generate a Certificate Signing Request containing your public key and identifying information
  3. Submit to a CA: Send the CSR to a Certificate Authority (Let's Encrypt, DigiCert, Sectigo, etc.)
  4. Domain validation: Prove you control the domain through email, DNS, or HTTP verification
  5. Receive certificate: The CA signs your public key and returns a certificate
  6. Install certificate: Configure your web server to use the certificate and private key
  7. Configure HTTPS: Update your website to use HTTPS and redirect HTTP traffic

Let's explore each step in detail.

Step 1: Choose a Certificate Authority

Your first decision is which Certificate Authority (CA) will sign your certificate. This isn't a purely technical decision—different CAs offer different levels of validation, support, warranties, and trust.

Free Options:

Let's Encrypt is the most popular free CA, providing automated certificate issuance and renewal. Certificates are valid for 90 days and include Domain Validation (DV) only. Let's Encrypt is perfect for:

  • Personal websites and blogs
  • Development and staging environments
  • Small business websites
  • Open source projects

ZeroSSL is another free CA offering longer validity periods (90 days) with a simpler interface than Let's Encrypt. Good for users who want free certificates without command-line automation.

Commercial Options:

DigiCert is the premium CA choice, offering Organization Validation (OV) and Extended Validation (EV) certificates with warranties up to $2 million. DigiCert provides:

  • Multi-year certificates (1-2 years)
  • Phone support and account management
  • Insurance warranties for liability
  • Recognized by 99.9% of browsers

Sectigo (formerly Comodo) offers affordable commercial certificates with OV and EV options. Good middle-ground between free and premium CAs.

GlobalSign provides enterprise-focused certificates with specialized options for code signing, document signing, and IoT devices.

Validation Levels:

Domain Validation (DV): Verifies you control the domain. Issued in minutes. Shows padlock icon only. Used by Let's Encrypt and entry-level commercial certificates.

Organization Validation (OV): Verifies domain control plus organization identity (legal business name, address). Takes 1-3 days. Shows organization name when clicking the padlock.

Extended Validation (EV): Highest validation level with thorough business vetting. Takes 3-7 days. Shows organization name prominently in browser address bar on some browsers.

Recommendation: For most websites, Let's Encrypt (free) or a commercial DV certificate provides adequate security. OV/EV certificates are useful for e-commerce sites, financial institutions, or when building customer trust is paramount.

Step 2: Generate a Private Key and CSR

A Certificate Signing Request (CSR) contains your public key and identifying information that the CA will sign. But first, you need a private key.

Using OpenSSL (Linux/macOS):

For RSA-2048 (widely compatible):

openssl genrsa -out private.key 2048
openssl req -new -key private.key -out request.csr

For RSA-4096 (more secure, slightly slower):

openssl genrsa -out private.key 4096
openssl req -new -key private.key -out request.csr

For ECDSA P-256 (modern, efficient):

openssl ecparam -genkey -name prime256v1 -out private.key
openssl req -new -key private.key -out request.csr

What Information to Include:

When generating a CSR, you'll be prompted for several fields:

  • Common Name (CN): Your domain name (e.g., www.example.com or example.com)
  • Organization (O): Your legal company name (required for OV/EV, optional for DV)
  • Organizational Unit (OU): Department name like "IT" or "Web Services" (optional)
  • City/Locality (L): City where your organization is located
  • State/Province (ST): Full state name, not abbreviation
  • Country (C): Two-letter country code (e.g., US, GB, CA)
  • Email Address: Contact email (optional)

Critical: The Common Name (CN) must match the domain exactly. For www.example.com, use that; for example.com, use that. Many CAs offer multi-domain certificates that work for both.

Subject Alternative Names (SANs):

Modern certificates use SANs to secure multiple domains/subdomains:

  • example.com
  • www.example.com
  • mail.example.com
  • app.example.com

Most commercial CAs allow 3-5 SANs by default. Let's Encrypt supports up to 100 SANs per certificate.

Using Web-Based Tools:

If you prefer a graphical interface, you can use web-based CSR generators. These tools run entirely in your browser for security, generating the private key and CSR locally without uploading any data to a server.

After generation, save both files securely:

  • private.key - Never share this file
  • request.csr - Submit this to the CA
Advertisement

Step 3: Submit Your CSR to the Certificate Authority

The submission process varies by CA, but generally follows this pattern:

For Let's Encrypt (using Certbot):

Certbot automates the entire process, generating keys, CSRs, handling validation, and installing certificates:

# Install Certbot
sudo apt install certbot python3-certbot-nginx  # For Nginx
sudo apt install certbot python3-certbot-apache  # For Apache

# Generate and install certificate
sudo certbot --nginx -d example.com -d www.example.com
# or
sudo certbot --apache -d example.com -d www.example.com

Certbot handles everything automatically, including domain validation and web server configuration.

For Commercial CAs:

  1. Create an account on the CA's website
  2. Choose certificate type (DV/OV/EV, single domain/wildcard/multi-domain)
  3. Paste your CSR into the order form
  4. Complete validation (see next step)
  5. Receive certificate via email or download from account dashboard

What the CA Does:

When you submit a CSR, the CA:

  • Extracts your public key and domain information
  • Verifies you control the domain (validation process)
  • Signs your public key with their private key
  • Creates a certificate containing your public key + their signature
  • Returns the certificate to you

The CA's signature is what makes your certificate trusted. Browsers come pre-installed with trusted root CA certificates, creating a "chain of trust."

Step 4: Complete Domain Validation

Before issuing a certificate, the CA must verify you control the domain. There are three common validation methods:

HTTP Validation (HTTP-01 Challenge):

The CA provides a random token that you must serve at a specific URL:

http://example.com/.well-known/acme-challenge/[random-token]

Upload the token file to your web server at that path. The CA retrieves it to verify control. This method:

  • Works for single domains only (not wildcards)
  • Requires port 80 to be open and accessible
  • Is fully automated with Certbot

DNS Validation (DNS-01 Challenge):

The CA provides a random value that you add as a TXT record to your DNS zone:

_acme-challenge.example.com. TXT "random-validation-string"

Add this record in your DNS provider's control panel. The CA queries DNS to verify. This method:

  • Works for wildcard certificates (*.example.com)
  • Works when port 80/443 isn't accessible
  • Can be automated with DNS provider APIs
  • Takes longer due to DNS propagation delays

Email Validation:

The CA sends a validation email to one of these addresses:

  • admin@example.com
  • administrator@example.com
  • webmaster@example.com
  • hostmaster@example.com
  • postmaster@example.com

Click the link in the email to validate. This method:

  • Is simple and requires no technical setup
  • Works when you don't have server access yet
  • Is not available for Let's Encrypt

Organization Validation (OV) and Extended Validation (EV):

These require additional verification beyond domain control:

  • Business registration documents
  • Phone verification with the organization
  • Dun & Bradstreet or other business database verification
  • Legal opinion letters (for EV)

The process takes 1-7 days depending on validation level and how quickly you provide documents.

Step 5: Download and Install Your Certificate

Once validation is complete, the CA provides your signed certificate.

What You'll Receive:

  • Server Certificate: Your signed certificate (e.g., certificate.crt)
  • Intermediate Certificate(s): CA's intermediate certificate(s) (e.g., intermediate.crt)
  • Root Certificate: CA's root certificate (usually not needed—browsers have it)

Certificate Chain:

Browsers need to see the complete chain from your certificate up to a trusted root:

Your Certificate
  ↓ (signed by)
Intermediate Certificate
  ↓ (signed by)
Root Certificate (in browser's trust store)

Most CAs provide a "certificate bundle" or "full chain" file containing your certificate and all intermediates.

Installing on Apache (Linux):

  1. Copy files to your server:
sudo cp certificate.crt /etc/ssl/certs/
sudo cp private.key /etc/ssl/private/
sudo cp intermediate.crt /etc/ssl/certs/
  1. Set proper permissions:
sudo chmod 600 /etc/ssl/private/private.key
sudo chmod 644 /etc/ssl/certs/certificate.crt
  1. Configure Apache virtual host:
<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/certificate.crt
    SSLCertificateKeyFile /etc/ssl/private/private.key
    SSLCertificateChainFile /etc/ssl/certs/intermediate.crt

    # Other configuration...
</VirtualHost>
  1. Restart Apache:
sudo systemctl restart apache2

Installing on Nginx (Linux):

  1. Concatenate certificate and chain:
cat certificate.crt intermediate.crt > fullchain.pem
  1. Copy files:
sudo cp fullchain.pem /etc/nginx/ssl/
sudo cp private.key /etc/nginx/ssl/
sudo chmod 600 /etc/nginx/ssl/private.key
  1. Configure Nginx server block:
server {
    listen 443 ssl;
    server_name example.com www.example.com;

    ssl_certificate /etc/nginx/ssl/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/private.key;

    # Other configuration...
}
  1. Restart Nginx:
sudo systemctl restart nginx

Installing on Windows IIS:

  1. Convert to PFX format (if not already):

    • Use a certificate tool to combine certificate + private key + chain into a .pfx file
    • Protect with a strong password
  2. Import certificate:

    • Open IIS Manager
    • Select server name → Server Certificates
    • Right-click → Import
    • Browse to .pfx file, enter password
  3. Bind to website:

    • Select your website → Bindings
    • Add new binding: Type = https, Port = 443
    • Select your SSL certificate
    • Click OK

Installing on Cloud Platforms:

AWS (Certificate Manager):

aws acm import-certificate \
  --certificate fileb://certificate.crt \
  --certificate-chain fileb://intermediate.crt \
  --private-key fileb://private.key

Google Cloud:

gcloud compute ssl-certificates create example-cert \
  --certificate=certificate.crt \
  --private-key=private.key

Azure (App Service): Upload .pfx file through Azure Portal → App Service → TLS/SSL settings → Private Key Certificates.

Step 6: Configure HTTPS and Security Headers

Installing the certificate is only the beginning. You need to configure your server for optimal security:

Redirect HTTP to HTTPS:

All HTTP traffic should redirect to HTTPS to ensure encrypted connections.

Apache:

<VirtualHost *:80>
    ServerName example.com
    Redirect permanent / https://example.com/
</VirtualHost>

Nginx:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://$server_name$request_uri;
}

Enable HSTS (HTTP Strict Transport Security):

HSTS tells browsers to always use HTTPS, preventing man-in-the-middle attacks:

Apache:

Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"

Nginx:

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

Modern TLS Configuration:

Use only TLS 1.2 and 1.3, disable older versions:

Apache:

SSLProtocol -all +TLSv1.2 +TLSv1.3
SSLCipherSuite TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-RSA-AES128-GCM-SHA256

Nginx:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;

Step 7: Test and Monitor

After installation, thorough testing is essential:

SSL Labs Test: Visit SSL Labs Server Test and enter your domain. Aim for an A+ rating.

Browser Testing: Test in Chrome, Firefox, Safari, and Edge. Verify:

  • Green padlock appears
  • Certificate details show correct domain
  • No mixed content warnings

Certificate Monitoring: Set up monitoring to alert you before expiration:

  • Let's Encrypt: 90-day validity, auto-renewal at 60 days
  • Commercial: 1-2 year validity, renewal 30 days before expiration

Common Issues:

Mixed Content: Some resources (images, scripts, CSS) load over HTTP. Update all URLs to HTTPS or use protocol-relative URLs (//example.com/script.js).

Incomplete Chain: Missing intermediate certificate causes errors in some browsers. Always include the full chain.

Certificate Name Mismatch: Certificate CN doesn't match the domain in the URL. Ensure SANs cover all domains/subdomains.

Pre-Deployment Checklist

Run this before you point production traffic at the new certificate. Each item maps to a real failure mode that causes outages or trust warnings:

  • Private key stayed on the server — it was never emailed, pasted into a web form, or committed to git. If it left the box, revoke and reissue.
  • Key type is RSA-2048 or ECDSA P-256 — not a self-signed leftover, not RSA-1024.
  • CSR Common Name and SANs cover every hostname you actually serve (example.com and www.example.com at minimum).
  • Full chain is installed — leaf plus intermediate, not just the leaf. Verify with openssl s_client -connect example.com:443 -servername example.com and confirm the chain resolves to a trusted root.
  • HTTP → HTTPS redirect (301) is in place so no request stays plaintext.
  • HSTS header set with a max-age you can honor before adding preload.
  • TLS 1.2 and 1.3 only — TLS 1.0/1.1 and SSLv3 disabled.
  • No mixed content — every image, script, and stylesheet loads over HTTPS.
  • Renewal is automated or calendaredsudo certbot renew --dry-run passes, or you have a 30-day-before alert for a commercial cert.
  • SSL Labs scan returns A or A+ after the change is live.

Conclusion

Creating an SSL certificate for your website involves generating a CSR, submitting it to a Certificate Authority, completing domain validation, and installing the signed certificate on your web server. While the process has multiple steps, tools like Let's Encrypt and Certbot have automated much of the complexity.

Key Takeaways:

  • Choose the right CA for your needs (Let's Encrypt for free/automated, commercial for OV/EV)
  • Generate a strong key pair (RSA-2048 minimum, RSA-4096 or ECDSA P-256 preferred)
  • Include all necessary domains in SANs
  • Always install the complete certificate chain
  • Configure HTTPS redirects and security headers
  • Monitor for expiration and renew on time

Ready to generate your Certificate Signing Request? Use our Certificate CSR Generator & Format Converter tool for secure, client-side CSR generation and certificate format conversion.

Frequently Asked Questions

How do I create an SSL certificate for free?

Use Let's Encrypt with Certbot. Install it (sudo apt install certbot), run sudo certbot --nginx -d example.com -d www.example.com, and Certbot generates the private key, builds the CSR, completes the HTTP-01 domain validation, installs the certificate, and configures your web server automatically. Certificates are valid for 90 days and Certbot's systemd timer renews them at the 60-day mark, so you never touch it again.

What is the difference between a CSR and an SSL certificate?

A CSR (Certificate Signing Request) is what you send to a CA; the certificate is what you get back. The CSR contains your public key plus identifying details (Common Name, organization, country) and is signed with your private key to prove you hold it. The CA validates you, then signs your public key with its own key to produce the certificate. The private key never leaves your server and is never part of the CSR.

Can I make my own SSL certificate?

You can generate a self-signed certificate with OpenSSL (openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes), and it will encrypt traffic exactly like a paid one. But no browser trusts it, so visitors see a "Your connection is not private" warning. Self-signed certs are fine for local development, internal tools, or testing, never for a public production website.

How long does it take to get an SSL certificate?

A Domain Validation (DV) certificate from Let's Encrypt or a commercial CA is issued in seconds to minutes once validation passes. Organization Validation (OV) takes 1-3 business days because the CA verifies your company's legal identity. Extended Validation (EV) takes 3-7 days due to thorough business vetting. The validation step, not the signing, is what determines the wait.

What key type and size should I use, RSA or ECDSA?

RSA-2048 is the safe universal default and every client supports it. ECDSA P-256 offers equivalent security with smaller keys and faster handshakes, ideal for high-traffic sites, and is supported by all modern browsers. RSA-4096 is more future-proof but noticeably slower on every TLS handshake. For most sites, RSA-2048 or ECDSA P-256 are the right choices; skip RSA-4096 unless a compliance requirement forces it.

What is domain validation and which method should I use?

Domain validation proves you control the domain before the CA issues the certificate. HTTP-01 serves a token file at /.well-known/acme-challenge/ and is the simplest for a single domain on a reachable server. DNS-01 adds a TXT record at _acme-challenge and is required for wildcard certificates or when port 80 is closed. Email validation sends a link to admin@ or webmaster@ and is used mainly by commercial CAs, never by Let's Encrypt.

Do I need the intermediate certificate too?

Yes. Browsers only trust root CAs directly, so your server must present the full chain: your leaf certificate plus every intermediate that links it back to the trusted root. Omitting the intermediate is the most common cause of "certificate not trusted" errors that appear on some devices but not others. On Nginx concatenate them into a fullchain.pem; on Apache use SSLCertificateChainFile.

How do I renew an SSL certificate before it expires?

Let's Encrypt certificates auto-renew via Certbot's timer at 60 days; test it with sudo certbot renew --dry-run. Commercial certificates valid for one year must be re-issued manually, ideally 30 days before expiry, usually by submitting a fresh CSR. Set expiry monitoring and alerts regardless of CA, because an expired certificate takes your whole site offline with a hard browser error the moment it lapses.

SSLTLSHTTPScertificatesCSRLet's EncryptCertificate Authorityweb security