This guide is written for Ubuntu 24.04. Other operating systems and distributions
may require different tools or steps — adapt accordingly.
- Clean machine — no OS installed yet. Full-disk encryption is set up during Ubuntu installation.
- Zylon already installed — encrypt a separate data partition without reinstalling.
Option 1: Clean Machine — Full-Disk Encryption During Installation
This is the recommended approach. Ubuntu’s installer can encrypt the entire disk using LUKS (Linux Unified Key Setup) with a single passphrase.1
Boot from Ubuntu 24.04 installer
Download the Ubuntu 24.04 Server ISO and boot your machine from it.
2
Proceed through installer until storage configuration
At the Storage configuration screen, select Custom storage layout
and then choose Use entire disk option.
3
Enable encryption
Check Encrypt the LVM group with LUKS. You will be prompted to set a passphrase.Choose a strong passphrase and store it securely — losing it means losing access to all data.
4
Complete installation
Finish the installer normally. On every boot, you will be prompted to enter
the passphrase before the system starts.
5
Install Zylon
Once Ubuntu is running, follow the standard Zylon installation guide.
Option 2: Zylon Already Installed — Encrypt a Data Partition
If Zylon is already running, a full reinstall is disruptive. Instead, you can create an encrypted partition for Zylon’s data directory (/var/zylon)
using LUKS and move the data into it.
Prerequisites
- A spare disk or unpartitioned space available on the server.
cryptsetupandrsyncinstalled:
1
Identify the target disk or partition
List available block devices to find your spare disk (e.g.
/dev/sdb).
The -e 7 flag excludes loop devices (snap packages) to reduce noise:2
Create and format the LUKS container
Replace You will be prompted to confirm (
/dev/sdb with your actual device. This will erase all data on it.YES) and set a passphrase.3
Open the encrypted container
/dev/mapper/zylon-data.4
Create a filesystem on the mapped device
5
Stop Zylon before migrating data
6
Mount the encrypted partition and migrate data
7
Replace the original data directory with the encrypted mount
8
Configure automatic mounting at boot
Add the LUKS device to Append a line to Then add the mount to
/etc/crypttab:/etc/crypttab (replace YOUR_UUID with the value above):/etc/fstab:Using
none as the key file means the passphrase will be prompted at every boot.
For headless servers, see the Ubuntu documentation on remote LUKS unlocking.9
Start Zylon and verify
Automated script (alternative)
The script below performs all the steps above interactively. It will ask for the target disk and the LUKS passphrase, then handle the rest. Save it asencrypt-zylon.sh and run with sudo bash encrypt-zylon.sh.
The passphrase will be prompted at every boot. For headless servers, see
the Ubuntu documentation on remote LUKS unlocking.