Install Chrony

sudo apt update sudo apt install chrony


Configure Chrony

The config file is:

/etc/chrony/chrony.conf


Basic things you might want to set:


NTP servers:
You can replace the default pool servers with your preferred NTP servers.

# Example: server time.google.com iburst server time.cloudflare.com iburst server 0.pool.ntp.org iburst server 1.pool.ntp.org iburst


Allow clients to sync with your machine (if acting as a server):

# Allow clients from local network to query time allow 192.168.1.0/24


If you want your machine to serve as a clock without network access:

local stratum 10


Log settings:

Chrony can log stats:

log measurements statistics tracking logdir /var/log/chrony

Restart Chrony

After editing /etc/chrony/chrony.conf:

sudo systemctl restart chrony

 

Enable it to start on boot:

sudo systemctl enable chrony 


Interact with Chrony

Chrony has a command-line tool:

chronyc

 

Once in the interactive shell, you can run commands like:

Example:

chronyc tracking chronyc sources chronyc sourcestats


You can also run chronyc commands directly:

chronyc tracking


Example: See Synchronization Status

chronyc tracking Reference ID : 8.8.8.8 (time.google.com) Stratum : 2 Ref time (UTC) : Tue Apr 29 20:10:12 2025 System time : 0.000045678 seconds fast of NTP time Last offset : +0.000034567 seconds RMS offset : 0.000045678 seconds Frequency : 1.234 ppm fast


Force Immediate Sync (Useful for Fresh Setups)

sudo chronyc makestep

This forces the system clock to immediately jump to the correct time instead of slewing it gradually (normally, NTP likes to gradually adjust).


Bonus: If you are firewalling, make sure UDP 123 is allowed

Chrony (and NTP in general) uses UDP port 123.

Example with firewalld:

sudo firewall-cmd --add-service=ntp --permanent sudo firewall-cmd --reload

 

Quick Troubleshooting:

Check if chrony is running:

sudo systemctl status chrony


Check logs:

journalctl -u chrony

If time isn't syncing, sources will show why.