Windows Servers
BitLocker on Windows Server: Encrypting Drives on a VPS
By NileVPS Team · Published · 5 min read
اقرأ المقال بالعربيBitLocker is the full-volume encryption built into Windows. On laptops it is often switched on by default, but on Windows Server it is an optional feature, and using it on a virtual server raises questions that a desktop never does: there is usually no TPM chip, nobody is sitting at the keyboard during boot, and the disk lives in someone else's data centre. This guide explains what BitLocker protects against on a VPS, how to set it up with PowerShell, and how to avoid locking yourself out.
What BitLocker protects, and what it does not
BitLocker encrypts data at rest. If someone obtains a copy of the disk image, a detached volume or a snapshot, they cannot read the data without a key.
It does not protect a running, unlocked server. Once the volume is unlocked, anyone who logs in with valid credentials, or any malware running on the system, sees the data in plain form. Patching, strong passwords, firewall rules and backups still matter far more for day-to-day security. Think of BitLocker as one layer, useful mainly for sensitive data or for compliance requirements that demand encryption at rest.
The TPM question on a VPS
On physical machines BitLocker normally stores its key in a TPM (Trusted Platform Module), which releases it automatically at boot if the system has not been tampered with. Many virtual servers do not expose a virtual TPM. Check yours:
Get-TpmIf TpmPresent is False, you have two realistic options:
| Approach | How it works | Trade-off |
|---|---|---|
| Encrypt data volumes only | The OS drive stays unencrypted; a separate volume holding sensitive data is encrypted with a password | Simple, server boots normally; you unlock the data volume after each reboot |
| Encrypt the OS drive with a startup password | Requires a Group Policy change to allow BitLocker without TPM | The server stops at a pre-boot password prompt on every restart; you must type it in the provider's browser console |
For most VPS use cases the first approach is the practical one, so this guide focuses on it and then outlines the second.
Step 1: Install the BitLocker feature
BitLocker is not installed by default on Windows Server:
Install-WindowsFeature BitLocker -IncludeAllSubFeature -IncludeManagementTools -RestartThe server restarts. Afterwards, the manage-bde command and the BitLocker PowerShell module are available.
Step 2: Encrypt a data volume
Attach and format an extra volume first (for example as D:). Then enable BitLocker with a password protector:
$pw = Read-Host -AsSecureString -Prompt "BitLocker password"
Enable-BitLocker -MountPoint "D:" -EncryptionMethod XtsAes256 -UsedSpaceOnly -PasswordProtector -Password $pw-UsedSpaceOnly encrypts only the space currently in use, which is much faster on a new, mostly empty volume. Data written later is encrypted as it is written.
Now add a recovery password, a 48-digit key you can use if the main password is forgotten:
Add-BitLockerKeyProtector -MountPoint "D:" -RecoveryPasswordProtectorWatch progress with:
manage-bde -status D:
Get-BitLockerVolume -MountPoint "D:"Step 3: Save the recovery key somewhere else
Display the recovery password:
(Get-BitLockerVolume -MountPoint "D:").KeyProtector |
Where-Object KeyProtectorType -eq 'RecoveryPassword' |
Select-Object KeyProtectorId, RecoveryPasswordStore it in a password manager or another secure place outside this server. A recovery key saved only on the server's own disk is useless when you cannot get into that server. If the machine is joined to Active Directory and the relevant policy is configured, you can also back up the protector to AD with Backup-BitLockerKeyProtector.
Step 4: Unlocking after a reboot
Because the OS drive is not encrypted, Windows cannot unlock D: automatically (auto-unlock for data drives requires the OS drive itself to be BitLocker-protected). After each restart, unlock it:
Unlock-BitLocker -MountPoint "D:" -Password (Read-Host -AsSecureString)or with manage-bde -unlock D: -password. Plan for this: services whose data lives on D: will fail to start until the volume is unlocked, so set them to manual start or restart them after unlocking. Avoid scripts that store the password in plain text on the same server, because that defeats the purpose of encrypting.
Encrypting the OS drive without TPM
If you need the system drive encrypted too, enable the policy Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives > Require additional authentication at startup, and tick Allow BitLocker without a compatible TPM. Then:
$pw = Read-Host -AsSecureString
Enable-BitLocker -MountPoint "C:" -EncryptionMethod XtsAes256 -UsedSpaceOnly -PasswordProtector -Password $pw
Add-BitLockerKeyProtector -MountPoint "C:" -RecoveryPasswordProtectorBefore the first reboot, confirm that you can reach the server's console from your provider's panel, because Remote Desktop is not available at the pre-boot prompt. With the OS drive encrypted, data volumes can then use Enable-BitLockerAutoUnlock.
Snapshots, backups and resizing
- A snapshot of an encrypted volume stays encrypted. Restoring it requires the same password or recovery key, so keep old keys as long as you keep old snapshots.
- File-level backups taken from inside Windows contain decrypted data unless the backup tool encrypts them itself. Protect the backup destination accordingly; our guide to Windows Server backup covers the options.
- Extending a BitLocker volume works normally from Disk Management or
Resize-Partition. - To remove encryption, run
Disable-BitLocker -MountPoint "D:"and wait for decryption to finish.
If you want to try this safely first, deploy a test Windows VPS and practise the unlock routine before using it on a production server.
FAQ
Does BitLocker slow down a Windows Server VPS?
Modern CPUs accelerate AES encryption in hardware, so the overhead for typical server workloads is small. Initial encryption of a large, full volume takes time and causes extra disk activity, which is why -UsedSpaceOnly is helpful on new volumes.
What happens if I lose both the password and the recovery key?
The data on that volume is unrecoverable. Nobody, including your hosting provider, can decrypt it. Always store the recovery password outside the server before putting important data on the volume.
Can I use BitLocker on Windows Server without a TPM?
Yes. Data volumes can use a password protector without any policy change. The OS drive needs the "Allow BitLocker without a compatible TPM" policy and a startup password typed at every boot through the console.