Open In App

How to Install and Use Chrony in Linux?

chrony is a flexible Network Time Protocol implementation (NTP). It can sync the system clock with NTP servers, reference clocks (such as a GPS receiver), and manual input via wristwatch and keyboard. It can also act as an NTPv4 (RFC 5905) server and peer, allowing other computers on the network to receive timely updates.

A local server must use an NTP client to get the correct time from a remote NTP server. One such customer is Chrony. Chrony is an excellent option for this reason because it is designed to operate in a variety of situations, including unreliable and/or highly congested network connections, as well as other adverse conditions. At boot time, Chrony synchronizes the computer’s internal clock with higher Stratum NTP servers, a reference clock, or the computer’s real-time clock. Using a wristwatch and a keyboard, it can also be manually synchronized with the input. This is not the most reliable form of synchronization, and it is strongly discouraged.



On a LAN, the precision between two synchronized machines is usually within a few milliseconds. Chrony is divided into two systems: chronyc and chronyd.

The chrony.conf file specifies the time NTP server that chronyd tracks. The primary feature of the Chronyd system is to obtain accurate time from one of the major NTP server sources. If the server time is off, chronyd will adjust the device clock to compensate.



Chrony includes two programs:

How to Install Chrony in Linux:

Chrony may be installed by default on certain devices. And if the kit is missing, it is simple to install. Using the command below, use your default package manager utility on your respective Linux distributions.

# yum -y install chrony    [On CentOS/RHEL]
# apt install chrony       [On Debian/Ubuntu]
# dnf -y install chrony    [On Fedora 22+]

installing chrony

To check the status of chronyd use the following command:

# systemctl status chronyd      [On SystemD]
# /etc/init.d/chronyd status    [On Init]

Enable chrony daemon upon boot with the following command:

# systemctl enable chronyd       [On SystemD]
# chkconfig --add chronyd        [On Init]

To Check Chrony Synchronization in Linux:

We’ll use chrony’s command-line software, chronyc, to see whether it’s actually synchronized. It has a monitoring feature that will provide useful details.

# chronyc tracking

result of  Check Chrony Synchronization 

The listed files provide the following information:-

To check information about chrony’s sources:

# chronyc sources

Check Chrony Sources

Configure Chrony in Linux:

The configuration file of chrony is located at /etc/chrony.conf or /etc/chrony/chrony.conf and the sample configuration file may look something like this:

The above configuration provides the following information:

If you want to step the system clock immediately and ignoring any adjustments currently being in progress:

# chronyc makestep

If you decide to stop chrony, you can use the following commands:

# systemctl stop chrony          [On SystemD]
# /etc/init.d/chronyd stop       [On Init]

This was a demonstration of the chrony utility and how to use it on a Linux system.

Article Tags :