Encrypt the disk of the models
Encrypting the disk of a local LLM is done with the operating system's native tool: FileVault on macOS, BitLocker on Windows Pro, and LUKS on Linux. But what you need to protect is not primarily the model weights, which are public; it's your conversations, document index, logs, and swap file. So encrypt the disk that contains them, and back up the recovery key somewhere other than the machine.
A computer running a local LLM keeps plaintext traces: conversation history, your document index database, and temporary files. Lose the computer, and everything becomes readable by connecting the drive elsewhere. This guide explains what to encrypt, how to enable FileVault, BitLocker, or LUKS, how to move Ollama models to an encrypted volume, and the key-handling mistakes that void the protection.
#What disk encryption protects—and what it does not
Encryption at rest makes disk contents unreadable without the key: someone who steals the laptop, removes the SSD or seizes a powered-off workstation can recover only unusable data. That's the scenario it addresses, and it doesn't cover others: a powered-on, unlocked workstation, malware running under your session, or a weak password remain avenues of access. From a regulatory standpoint, Article 32 of the GDPR cites pseudonymization and encryption of personal data among the technical measures the controller must consider based on risk; it does not prescribe a specific tool, and the requirement depends on the context (healthcare, finance).
| Situation | Protected? | Note |
|---|---|---|
| Laptop stolen or lost, powered off | Yes | The typical case—the one we size for |
| Drive removed and connected to another machine | Yes | Without the key, the content is unreadable |
| Computer powered on, session open, screen unlocked | No | The disk is unlocked: lock the session |
| Malware in your session | No | It reads data the way you do |
| Backup to an unencrypted drive | No | Copying voids the source’s protection |
| Lost recovery key | Data loss | There is no backdoor |
#What needs to be encrypted: the weights are not the secret
Deploy local AI at work: privacy, compliance, multi-user architecture, costs, the one-page memo for leadership.
- Lifetime online access
- PDF + files
- Lifetime updates
Models downloaded from Ollama or Hugging Face are public: an open-weight model's weights are not confidential unless you fine-tuned the model on private data. What is confidential is everything its use produces. Encrypting only the model directory therefore leaves the essential data exposed.
- Conversation history
- The Ollama terminal records input history in the .ollama directory of your profile (the Ollama code constructs the .ollama/history path); web interfaces such as Open WebUI keep their conversations in their own database.
- Document index
- A ChromaDB, Qdrant, or Weaviate database contains your document passages in readable form: it’s a duplicate of your files.
- Source documents and exports
- The PDFs placed in the RAG folder, the transcripts, and the saved outputs.
- Swap and hibernation file
- When memory is full, the system writes pages to disk: they may contain excerpts from your conversations. Arch Linux documentation notes that encrypted swap, reset at every startup, provides better protection because it prevents sensitive fragments from remaining unwritten over time.
- Logs and temporary copies
- Server logs, cache files, and editors that create copies.
Two strategies follow from this. The simplest and safest is to encrypt the entire system drive, covering everything in one operation. The second, when you cannot modify the system, is to encrypt a dedicated volume containing the data (indexes, documents, fine-tuned models) and move the folders that hold them there.
#macOS: FileVault
On a Mac with an Apple chip or a T2 security chip, Apple's documentation states that data is encrypted automatically: enabling FileVault adds another layer by making data access contingent on entering the login password. On an Intel Mac without a T2 chip, you must enable FileVault to encrypt data. The technical documentation describes FileVault as using the AES-XTS algorithm to protect entire volumes, relying on the hardware AES engine and the Secure Enclave in newer Macs.
- 01Open settingsApple menu, System Settings, Privacy & Security, then FileVault.
- 02Enable FileVaultClick Activate; macOS offers two recovery methods.
- 03Choose the retrieval methodAn iCloud account is convenient, with no separate key to keep track of; the recovery key is a string of characters that you should write down and store somewhere other than on the Mac. For sensitive data, prefer the recovery key.
- 04Let the Mac workEncryption continues in the background; you can keep using the machine.
#Windows: BitLocker and device encryption
BitLocker is Windows' volume-encryption feature. According to Microsoft's documentation, it can be enabled on Windows Pro, Enterprise, Pro Education/SE, and Education. Windows Home does not provide access to it, but it does support device encryption, which automatically enables BitLocker on eligible machines; since Windows 11 24H2, the hardware requirements have been reduced, making more machines eligible.
A pitfall to know: automatic device encryption is enabled only after signing in with a Microsoft account or a work account, and the recovery key is then saved to that account (it can be found at aka.ms/myrecoverykey). With a local account, it isn’t enabled automatically, but you can enable BitLocker manually on an edition that supports it. For highly sensitive data, consciously decide where the key resides: an online account is convenient if the device is lost, but the key is no longer exclusively yours.
- 01Open BitLockerSearch for “Manage BitLocker” in the Start menu (Pro editions and above).
- 02Enable on the system driveChoose TPM-based unlocking; add a PIN at startup to protect against direct booting of a stolen machine.
- 03Save the recovery keySave it in a vault, or print it; avoid leaving it only on the machine.
- 04Choose the scopeOn a new PC, encrypting the used space is sufficient; on a PC that has already been used, prefer full-disk encryption, which also covers free space where old data may remain.
#Linux: LUKS for the entire disk
LUKS is the disk encryption standard on Linux, managed by the cryptsetup tool. According to its manual page, the default format is LUKS2. The simplest approach is to choose it during installation: Ubuntu, Fedora, and others offer an “encrypt the new installation” checkbox that asks for a password. The entire system disk, including the swap file, is then protected. You can check afterward with cryptsetup status on the name of the open volume, or with lsblk -f, which indicates the crypto_LUKS type.
#Linux: encrypt only a data drive and place Ollama on it
The common case is an unencrypted system with a second SSD reserved for AI data. Encrypt this second drive with LUKS, then move the models and index directories there. The Ollama documentation states that the model location is configured with the OLLAMA_MODELS variable and that, with the standard Linux installer, the ollama user must have read and write access to the selected directory.
The RequiresMountsFor line tells systemd that the service must not start until the volume is mounted: without it, Ollama may start before unlocking, create an empty folder on the unencrypted disk, and redownload the models there. After making the change, run sudo systemctl restart ollama.
#Password or key file: the system-disk file trap
There are two approaches to opening the volume at startup. With a password, the system asks for it at every boot (a crypttab entry with the “none” key). With a key file, opening is automatic, but everything depends on where the file is stored. Placing the key in /root/ on an unencrypted system almost completely defeats the protection: anyone who steals the machine can read the key file on the system disk and then open the volume. A key file makes sense only if the disk containing it is itself encrypted. On a server without a screen, the usual compromise is an encrypted system unlocked remotely, or manual unlocking after every reboot.
Encryption adds computational overhead to every read and write. For an LLM, weights are read mainly when the model loads: the effect is most noticeable in load time, not in generated tokens. Measure your processor's encryption throughput with cryptsetup benchmark, and compare a model's load time before and after; don't rely on a general figure.
#NAS and backups: don't undo encryption
- NAS
- Make sure shared folders containing models or backups are encrypted, and know where the key resides. A NAS that unlocks its volume automatically at startup protects against theft of the disk alone, but not theft of the entire device.
- Backup drive
- An unencrypted USB backup drive defeats workstation encryption: encrypt it with the same tool, or use backup software that encrypts before writing.
- Cloud backup
- Make sure encryption happens on your side, using a key that only you possess; otherwise, the provider could technically read your files.
- Recovery key
- Always separate the key from the backup it protects: two distinct locations.
| Machine | Tool | Key consideration |
|---|---|---|
| MacBook or Mac mini with an Apple chip | FileVault (data already encrypted by the chip) | Retrieve by key rather than via iCloud if the data is sensitive |
| Windows Pro or Enterprise PC | BitLocker with TPM and PIN | Where is the recovery key stored? |
| Windows Home PC | Device encryption, or VeraCrypt | Key linked to the Microsoft account |
| Linux PC or server, system drive | LUKS during installation | Header saved; password at startup |
| Linux, unencrypted system, second drive | LUKS on the second drive | No key file on an unencrypted system |
| NAS | NAS volume or encrypted folder | Manual unlock after reboot |
#Frequently asked questions about model disk encryption
Should you encrypt the Ollama model folder?+
Does FileVault slow down a local LLM?+
Is BitLocker available on Windows Home?+
What happens if I lose the recovery key?+
Can a LUKS volume be opened automatically at startup?+
Is disk encryption enough for GDPR?+
- Privacy checklist
- Air-gap the machine
- Local AI in the enterprise: GDPR, sovereignty, and deployment
- Legal advisor: analyze a contract without leaks
- Share Ollama on your local network
- Source: Apple, FileVault
- Source: Microsoft, BitLocker
- Source: cryptsetup manual page
- Source: Ollama FAQ, model location
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.