Setting up your own certificate authority (CA) on Windows
How do I set up my own CA on Windows?
On Windows Server, the CA is a server role: Active Directory Certificate Services (AD CS). According to Microsoft Learn, it is used to issue and manage certificates of a public key infrastructure (PKI). The installation guide lists Windows Server 2025, 2022, 2019 and 2016.
The way there has five parts:
- Choose the CA type: enterprise or standalone, root or subordinate.
- Install the role and configure the CA.
- Set the CRL and AIA paths.
- Distribute the root certificate to the clients.
- Request certificates.
For how a PKI with several tiers is built, see Building a PKI. The terms are explained in What is a PKI? and What is a certificate authority (CA)?.
What are the prerequisites?
For the example in the Microsoft guide, an enterprise root CA:
- The account is a member of Enterprise Admins and of the root domain’s Domain Admins.
- The computer is named, has a static IP address and has joined the domain.
- Active Directory Domain Services (AD DS) is installed in the domain.
A standalone CA does not require a domain. According to the PowerShell reference, the computer can be in a workgroup or in a domain. In a workgroup an account in the Administrators group is enough, in a domain it takes Domain Admins.
Enterprise or standalone, root or subordinate?
The PowerShell cmdlet knows four types: EnterpriseRootCA, EnterpriseSubordinateCA, StandaloneRootCA and StandaloneSubordinateCA. The Server Manager wizard offers the same choice on the pages “Setup Type” (Enterprise or Standalone) and “Specify the type of the CA” (Root CA or Subordinate CA).
An enterprise CA belongs in the domain: the computer must be joined to an AD DS domain, and the account needs Enterprise Admin rights. In return, only an enterprise CA issues certificates based on certificate templates. The templates are stored in AD DS and apply to every CA in the forest.
A subordinate CA gets its certificate from a parent CA, which you name with -ParentCA. Its validity period is set by the parent CA. The Microsoft guide installs an enterprise root CA and mentions adding enterprise subordinate CAs later as a way to expand.
How do I install the role with Server Manager?
The click paths and commands come from the Microsoft documentation and have not been run on a test server. According to the Microsoft guide, you proceed like this:
- Log on as a member of Enterprise Admins and the root domain’s Domain Admins.
- In Server Manager, select “Manage” and then “Add Roles and Features”.
- At “Select Installation Type”, keep “Role-Based or feature-based installation” selected, and choose the local computer from the server pool.
- At “Select Server Roles”, select the role “Active Directory Certificate Services”. If the wizard asks for required features, select “Add Features”.
- Click “Next” through “Select features” and the information page of the role.
- Under “Confirm installation selections”, select “Install”, and do not close the wizard during installation.
When the installation is complete, the configuration follows. The German version of the Microsoft guide translates the labels, for example “Rollen und Features hinzufügen”.
How do I configure the CA in the wizard?
After the installation, select “Configure Active Directory Certificate Services on the destination server”. The configuration wizard walks through these pages:
- “Role Services”: “Certification Authority”.
- “Setup Type”: “Enterprise CA”.
- “Specify the type of the CA”: “Root CA”.
- “Specify the type of the private key”: “Create a new private key”.
- “Cryptography for CA”: Microsoft recommends keeping the defaults for the provider (CSP) “RSA#Microsoft Software Key Storage Provider” and the hash algorithm (SHA2). For the key length, the guide recommends the default of 2048. According to the guide, longer keys can affect server performance and may not work with legacy applications.
- “CA Name”: keep the suggested name or choose your own. You cannot change the name after the installation.
- “Validity Period”: the guide recommends the default of five years.
- “CA Database”: set the folders for the certificate database and its log. If they differ from the defaults, access control lists (ACLs) must keep unauthorized users and computers away from the database and log files.
- “Confirmation”: select “Configure” and close with “Close”.
How does the installation work with PowerShell?
For an enterprise root CA, Microsoft Learn gives two commands:
Install-WindowsFeature -Name ADCS-Cert-Authority -IncludeManagementTools
Install-AdcsCertificationAuthority -CAType EnterpriseRootCA
For a standalone root CA with default settings, the cmdlet reference shows this command:
Install-AdcsCertificationAuthority -CAType StandaloneRootCa
-IncludeManagementTools is required if the “Certification Authority” and “Certificate Templates” consoles are to be installed too.
Which parameters cover the settings from the wizard?
Among others, the reference describes these parameters of Install-AdcsCertificationAuthority:
-CACommonName: the common name of the CA.-CryptoProviderName: the provider (CSP or KSP) that generates or stores the CA’s private key.-KeyLength: the bit length of the new CA key.-HashAlgorithmName: the signature hash algorithm.-ValidityPeriodand-ValidityPeriodUnits: the validity of the CA certificate; do not specify them for a subordinate CA.-DatabaseDirectoryand-LogDirectory: folders of the database and its log.-ParentCA: the configuration string of the parent CA.-WhatIf: shows what would happen without running the cmdlet.
What do I set after the installation?
Next, the Microsoft guide sets the CRL Distribution Point (CDP) and Authority Information Access (AIA). The CDP names places where users can obtain the certificate revocation list (CRL), the AIA places for the CA’s certificate. Both can be entered into issued certificates. The account needs Domain Admins for this.
Which web server does the guide assume?
In the guide, the CA publishes the CRL on a second server on which you install the role “Web Server (IIS)”. The guide sets this server up before the CA: according to its table of contents, installing the web server and a DNS alias come before the CA installation, and copying the CA certificate and CRL follows after the CDP and AIA settings.
The web server provides a location where the CA’s CRL is published and which all computers on the network can reach; the CA certificate goes there too. In the guide the alias is pki, and the server gets a shared folder pki and a virtual directory pki with anonymous access. The addresses in the following steps run through that directory, which you create first. Without it, nothing can be retrieved at these addresses.
Microsoft warns: if you jump ahead and deploy the CA without the preparatory steps, the deployment will fail. The steps for the web server are in the Microsoft guide on server certificates.
How do I enter the CDP and AIA?
The guide’s example names are corp-CA1-CA and pki.corp.contoso.com; replace them with your own:
- In Server Manager, select “Tools” and “Certification Authority”.
- Right-click the CA, open “Properties”, and then the “Extensions” tab.
- Set “Select extension” to “CRL Distribution Point (CDP)”. The guide removes the three existing entries that begin with
file://,http://andldap:///. - Add the address of the CRL on the web server and tick “Include in CRLs” and “Include in the CDP extension of issued certificates”.
- Add the file path the CA writes the CRL to, and tick “Publish CRLs to this location” and “Publish Delta CRLs to this location”.
- Set “Select extension” to “Authority Information Access (AIA)”, remove the three existing entries, add the address of the CA certificate and tick “Include in the AIA of issued certificates”.
- Answer the prompt to restart AD CS with “No”; the guide restarts the service later.
The addresses in the guide look like this:
http://pki.corp.contoso.com/pki/<CaName><CRLNameSuffix><DeltaCRLAllowed>.crl
file://\\pki.corp.contoso.com\pki\<CaName><CRLNameSuffix><DeltaCRLAllowed>.crl
http://pki.corp.contoso.com/pki/<ServerDNSName>_<CaName><CertificateName>.crt
How do I distribute the root certificate to the clients?
The Microsoft guide to server certificates, which works with an enterprise root CA, lists as an advantage of autoenrollment that all computers in the domain receive the CA certificate, and that it sits in the “Trusted Root Certification Authorities” store of every domain member. They therefore trust the certificates of your CA.
You can also distribute the certificate by Group Policy, following a Microsoft guide that uses it to distribute SSL certificates of federation and web servers:
- On a domain controller, open Group Policy Management and pick an existing Group Policy Object (GPO) or create a new one.
- Link the GPO to the domain, site or organizational unit that holds the user and computer accounts.
- Right-click it, select “Edit”, and open
Computer Configuration\Policies\Windows Settings\Security Settings\Public Key Policies. - Right-click “Trusted Root Certification Authorities”, select “Import” and follow the import wizard.
For devices outside the domain, see self-signed certificate in certificate chain: the root CA is unknown to the client.
How do I request a certificate from the new CA?
An example on Microsoft Learn requests a domain controller certificate from an enterprise CA and carries out the steps on the domain controller. It requires an enterprise CA with published certificate templates:
- On the domain controller, press Windows key + R, type
certlm.mscand press Enter. - Open “Personal”, right-click “Certificates” and select “All Tasks” and “Request New Certificate”.
- In the wizard, select “Next”, then “Active Directory Enrollment Policy” and “Next”.
- Tick the “Domain Controller” template and select “Enroll”.
Other purposes have other templates. Microsoft describes “Web Server”, for example, as a template that proves the identity of a web server, and “Smartcard Logon” as a template for signing in with a smart card. New templates are created by modifying a copy of an existing one.
Can I do it in the browser?
Yes, with the Web Enrollment role service: according to Microsoft Learn, it lets users connect to a CA with a web browser to request certificates and retrieve CRLs. The reference gives these commands for installing it. If a CA is installed locally, you do not specify -CAConfig, according to the reference.
Import-Module ServerManager
Add-WindowsFeature Adcs-Web-Enrollment
Install-AdcsWebEnrollment -CAConfig "<CAComputerName>\<CACommonName>"
For a request as a file, Microsoft Learn gives certreq -new request.inf request.req. With an enterprise CA, you submit the file through the CA’s web interface or through the “Certification Authority” console.
How do I sort the CA’s certificate files?
The PKI Toolkit takes certificate files in any order and outputs the correctly ordered chain as fullchain.pem, entirely in the browser, without upload. Missing intermediates are detected, and the AIA URL for fetching them is named.
Sources
- Microsoft Learn: Install the Certification Authority on Windows Server, retrieved on 19 November 2026 (also the German version)
- Microsoft Learn: What is Active Directory Certificate Services?, retrieved on 19 November 2026
- Microsoft Learn: Install-AdcsCertificationAuthority, retrieved on 19 November 2026
- Microsoft Learn: Install-AdcsWebEnrollment, retrieved on 19 November 2026
- Microsoft Learn: Configure the CDP and AIA Extensions on CA1, retrieved on 19 November 2026
- Microsoft Learn: Deploy Server Certificates for 802.1X Wired and Wireless Deployments, retrieved on 19 November 2026
- Microsoft Learn: Install the Web Server WEB1, retrieved on 19 November 2026
- Microsoft Learn: Create an alias (CNAME) record in DNS for WEB1, retrieved on 19 November 2026
- Microsoft Learn: Configure WEB1 to distribute certificate revocation lists (CRLs), retrieved on 19 November 2026
- Microsoft Learn: Copy the CA certificate and CRL to the virtual directory, retrieved on 19 November 2026
- Microsoft Learn: Table of contents of the guide (toc.json), retrieved on 19 November 2026
- Microsoft Learn: Distribute Certificates to Client Computers By Using Group Policy, retrieved on 19 November 2026
- Microsoft Learn: Certificate templates, retrieved on 19 November 2026
- Microsoft Learn: Configure certificates for LDAP over SSL in Active Directory Domain Services, retrieved on 19 November 2026
- Microsoft Learn: Migrate a Certification Authority in Windows Server, retrieved on 19 November 2026