Skip to Content
DocsServerTime Sync (Chrony)

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:

Featuresystemd-timesyncdChrony
RoleLightweight SNTP clientFull-featured NTP client/server
26.04 defaultFallback for upgrades/minimal systemsDefault on new installs
Acts as an NTP serverNoYes (can serve time to other hosts)
Intermittent connectivity / VM clock driftAverageBetter
Management commandtimedatectlchronyc
Note

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-timesync

Install 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 chrony

Configure upstream time sources

The main config file is /etc/chrony/chrony.conf:

sudo nano /etc/chrony/chrony.conf

Common 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 3

Restart the service after editing:

sudo systemctl restart chrony

Common 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/24
sudo systemctl restart chrony # Open the NTP firewall port (UDP 123) sudo ufw allow 123/udp
Tip

Virtual 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.

Last updated on