In this tutorial, we'll learn how to install and configure Timeshift on Ubuntu 24.04.
What is Timeshift?
Timeshift isn’t some magical time-travel gadget, but it’s the closest Ubuntu servers are getting without ripping a hole in the universe. It takes system snapshots so when we inevitably break something during an update or misconfigure a service at 3 AM, we can roll the server back to a working state instead of staring at a dead machine and reconsidering our life choices.
Timeshift creates restore points of our system files, configs, and packages. When chaos hits, we restore a previous snapshot and pretend everything was fine all along. This guide walks through installing and configuring Timeshift on Ubuntu 24.04 Server so our system has a safety net. It’s practical, clean, and saves us from turning small mistakes into full rebuilds.
Prerequisites
Before we begin, ensure we have the following:
- An Ubuntu 24.04 dedicate server or KVM VPS.
- Basic Linux Command Line Knowledge.
Install and Configure Timeshift on Ubuntu 24.04
1) What Timeshift actually protects
Timeshift captures system snapshots of our OS files: /, /usr, /etc, /var configs, and installed packages. It does not back up application data like databases by default. We’ll exclude volatile paths and keep snapshots lean for fast restore times.
2) Details
Run as a sudo-capable user
sudo -v
Confirm Ubuntu release
lsb_release -ds
Identify root filesystem (decides snapshot mode)
findmnt -no FSTYPE /
- If the output is btrfs, we use Timeshift’s BTRFS mode.
- If it’s ext4, xfs, or anything else, we use RSYNC mode.
3) Install Timeshift on Ubuntu 24.04
sudo apt update
sudo apt install -y timeshift
Timeshift is available as a .deb package in Noble’s repositories.
4) Pick a snapshot disk and prepare it
We keep snapshots off the root disk when possible. Use a separate block device or large partition.
# List disks and partitions
lsblk -f
# Example: create and mount a dedicated ext4 partition at /timeshift
# Replace /dev/sdb1 with the actual device
sudo mkfs.ext4 -L TIMESHF /dev/sdb1
sudo mkdir -p /timeshift
echo 'LABEL=TIMESHF /timeshift ext4 defaults,noatime 0 2' | sudo tee -a /etc/fstab
sudo mount -a
Timeshift will place its RSYNC snapshots under /timeshift/timeshift/snapshots (it handles the final pathing).
5) One-time initialization and settings (headless)
Generate a baseline config and confirm devices:
# List devices Timeshift can use
sudo timeshift --list-devices
# Print help and modes
sudo timeshift --help
- Create a minimal config by taking a first snapshot (we’ll refine shortly).
- For RSYNC mode (most servers on ext4/xfs)
Tell Timeshift to use RSYNC and the snapshot device. Use the device path shown by --list-devices (example: /dev/sdb1)
sudo timeshift --rsync --snapshot-device /dev/sdb1 --create --comments "Initial baseline" --tags B
For BTRFS mode (servers using btrfs on /)
# BTRFS requires that / is on btrfs with standard subvolumes
sudo timeshift --btrfs --create --comments "Initial baseline" --tags O
Snapshot tags we’ll use later for retention: H Hourly, D Daily, W Weekly, M Monthly, B Boot, O On-demand.
6) Exclude noisy paths to keep snapshots small
Timeshift reads filters from its config. We’ll add common server exclusions like container layers, caches, and mounts.
sudo nano /etc/timeshift.json
Add or adjust these keys if missing (Timeshift creates the file after first run). Example fragment:
{
"backup_device_uuid": "",
"parent_device_uuid": "",
"do_first_run": "false",
"btrfs_mode": "false",
"include_btrfs_home_for_restore": "false",
"tags": "O,D,W,M",
"exclude": [
"/var/lib/docker/*",
"/var/lib/containers/*",
"/var/cache/*",
"/var/tmp/*",
"/swapfile",
"/mnt/*",
"/media/*",
"/proc/*",
"/sys/*",
"/run/*"
]
}
- Set "btrfs_mode": "true" if we’re on btrfs.
- Keep "tags" to the schedules we intend to use.
Save and exit.
7) Create useful snapshot routines
We’ll set conservative retention with simple cron jobs that call Timeshift’s CLI. The CLI understands schedules via tags; cron provides the cadence.
7.1 Hourly snapshot (keep last few hours)
sudo tee /etc/cron.hourly/timeshift-hourly >/dev/null <<'EOF'
#!/bin/sh
/usr/bin/timeshift --create --tags H --scripted >/dev/null 2>&1
EOF
sudo chmod +x /etc/cron.hourly/timeshift-hourly
7.2 Daily snapshot
sudo tee /etc/cron.daily/timeshift-daily >/dev/null <<'EOF'
#!/bin/sh
/usr/bin/timeshift --create --tags D --scripted >/dev/null 2>&1
EOF
sudo chmod +x /etc/cron.daily/timeshift-daily
7.3 Weekly snapshot
sudo tee /etc/cron.weekly/timeshift-weekly >/dev/null <<'EOF'
#!/bin/sh
/usr/bin/timeshift --create --tags W --scripted >/dev/null 2>&1
EOF
sudo chmod +x /etc/cron.weekly/timeshift-weekly
--scripted suppresses prompts and is the supported way to run scheduled snapshots from the CLI.
Prefer cron for simple, always-on servers; systemd timers are fine too, but cron is a zero-dependency baseline that works everywhere.
8) Set retention limits
Timeshift rotates snapshots based on counts per tag in /etc/timeshift.json. Add or adjust:
{
"schedule_monthly": "true",
"count_monthly": "2",
"schedule_weekly": "true",
"count_weekly": "4",
"schedule_daily": "true",
"count_daily": "7",
"schedule_hourly": "true",
"count_hourly": "6",
"schedule_boot": "false",
"count_boot": "0"
}
Then enforce pruning:
sudo timeshift --check --scripted
9) On-demand snapshots before risky changes
We create an on-demand point before kernel updates, dist-upgrades, or config refactors:
sudo timeshift --create --comments "Pre-change: $(date +%F) hardening pass" --tags O
10) Verify snapshots and storage
# List snapshots with timestamps and tags
sudo timeshift --list
# Show where snapshots live
sudo timeshift --list-devices
# Check integrity and prune per retention rules
sudo timeshift --check --scripted
11) Restore scenarios
11.1 In-place restore on a bootable server
Pick a snapshot from --list, then:
# Interactive restore (select snapshot and target)
sudo timeshift --restore
Timeshift stops services as needed and reverts system files to the selected state. The server reboots when done.
11.2 Bare-metal restore from a live ISO
When the system can’t boot:
# Boot any Ubuntu 24.04 live ISO, open a shell, then:
sudo -i
# Identify and mount root and snapshot disk
lsblk -f
mount /dev/ubuntu-vg/ubuntu-lv /mnt # example LVM root
mount /dev/sdb1 /mnt2 # example snapshot partition
# Bind system dirs and chroot (optional, helps when restoring to /)
for d in /dev /dev/pts /proc /sys; do mount --bind $d /mnt$d; done
chroot /mnt
# Make sure timeshift is available in the rescue env
apt update && apt install -y timeshift
# Run restore; Timeshift will discover snapshots on the mounted device
timeshift --restore
If Timeshift can’t auto-detect, point it to the snapshot device:
timeshift --restore --snapshot-device /dev/sdb1
For RSYNC snapshots you’ll see them under /mnt2/timeshift/snapshots/.
12) Good hygiene for servers
- Keep snapshots off the root disk to avoid filling /.
- Exclude container layers, caches, and mounts as shown earlier.
- Pair Timeshift with regular data backups for databases and user data. Timeshift is rollback, not archival.
- Periodically test a restore on a VM clone. A rollback strategy we never test is a story we tell ourselves.
Troubleshooting tips
- Snapshots not created: ensure the snapshot disk is mounted and writable; check lsblk -f and mount. If the disk turned read-only due to errors, repair it before retrying.
- CLI is noninteractive in cron: always add --scripted.
- No space left: raise retention counts down or expand the snapshot partition; run sudo timeshift --check --scripted to prune.
We’ve now got dependable, testable system rollbacks on Ubuntu 24.04 using Timeshift with clean scheduling, lean exclusions, and clear restore paths. That’s how we keep our servers bold without being reckless.

