Time Sync (Chrony)
Accurate system time is essential for log correlation, TLS certificate validation, database consistency, and distributed systems. On fresh Ubuntu 26.04 installs, Chrony is the default network time synchronization daemon.
Chrony vs. systemd-timesyncd
Ubuntu ships two time-sync implementations. Understanding how they relate avoids mistakes:
| Feature | systemd-timesyncd | Chrony |
|---|---|---|
| Role | Lightweight SNTP client | Full-featured NTP client/server |
| 26.04 default | Fallback for upgrades/minimal systems | Default on new installs |
| Acts as an NTP server | No | Yes (can serve time to other hosts) |
| Intermittent connectivity / VM clock drift | Average | Better |
| Management command | timedatectl | chronyc |
The two cannot run at the same time. Installing Chrony automatically disables systemd-timesyncd. At that point timedatectl set-ntp true/false no longer controls actual sync — use chronyc and systemctl ... chrony instead.
Check current sync status
# Overall time status
timedatectl
# Confirm which service is handling sync
systemctl status chrony
# If Chrony is not installed and timesyncd is in use
timedatectl show-timesyncInstall and enable
# A fresh 26.04 install usually has Chrony pre-installed and enabled
sudo apt update
sudo apt install chrony
# Enable and start immediately
sudo systemctl enable --now chronyConfigure upstream time sources
The main config file is /etc/chrony/chrony.conf:
sudo nano /etc/chrony/chrony.confCommon configuration:
# Use the Ubuntu NTP pool (default)
pool ntp.ubuntu.com iburst maxsources 4
# Record the offset of the system clock vs. the hardware clock to speed up future sync
driftfile /var/lib/chrony/chrony.drift
# Step the clock in one go when the initial offset is large (first 3 updates)
makestep 1.0 3Restart the service after editing:
sudo systemctl restart chronyCommon chronyc commands
# View time sources and their status
chronyc sources -v
# View sync statistics (offset, jitter)
chronyc tracking
# View per-source measurement statistics
chronyc sourcestats
# Force an immediate step toward the server
sudo chronyc makestep
# Check whether the clock is synchronized
chronyc tracking | grep "Leap status"Running Chrony as an NTP server
To serve time to other hosts on your LAN, allow the client subnet in chrony.conf:
# Allow LAN clients to query this host's time
allow 192.168.1.0/24sudo systemctl restart chrony
# Open the NTP firewall port (UDP 123)
sudo ufw allow 123/udpVirtual machines and laptops that suspend for long periods are prone to clock drift. Chrony’s makestep and drift-file mechanisms correct large offsets faster, making it a better fit for these scenarios than timesyncd.