Operations 9 min read

How to Set Up Chrony for Precise Time Sync on Rocky Linux Servers

This guide walks through installing, configuring, and verifying Chrony on two Rocky Linux 8.9 servers, showing how to sync with public NTP sources and between servers, including firewall settings and detailed output interpretation.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Set Up Chrony for Precise Time Sync on Rocky Linux Servers

Chrony Overview

Chrony is an open‑source NTP client/server designed for Unix‑like systems (Linux, BSD, macOS) that provides high‑precision time synchronization with low latency, CPU, and memory usage. It consists of two programs: chronyd (the daemon that adjusts the system clock) and chronyc (the command‑line client for monitoring and configuration).

Test Environment

Two Rocky Linux 8.9 servers (Server1 172.16.0.134/24 and Server2 172.16.0.150/24) are connected to the same network (Net1) with NAT enabled, allowing Internet access.

Installing Chrony

[root@Server1 ~]# rpm -qa | grep chrony
chrony-4.2-1.el8.rocky.1.0.x86_64

Chrony is pre‑installed on Rocky Linux 8.9; the command above confirms the package.

Configuring Server1 to Use Public NTP Sources

# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# pool 2.rocky.pool.ntp.org iburst   # comment this line
Server ntp.aliyun.com iburst          # Alibaba Cloud NTP
Server time1.cloud.tencent.com iburst # Tencent Cloud NTP

After editing, restart and enable the daemon:

# systemctl restart chronyd
# systemctl enable chronyd
# systemctl is-active chronyd   # should output "active"

Verify synchronization status:

# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88                2   6    37    63    +49u s[+2956u s] +/- 23ms
^- 106.55.184.199              2   6   127    60    +1891u s[+1891u s] +/- 47ms

The output symbols are explained in the following block:

M : mode ("^" server, "=" peer, "#" local clock) S : state ("*" current best, "+" acceptable, "-" rejected, "?" unreachable, "x" false, "~" variable) Other columns show name/IP, stratum, poll interval, reachability, last receipt, and offset details.

Configuring Server2 to Sync from Server1

Edit /etc/chrony.conf on Server2 to point to Server1’s IP:

# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# pool 2.rocky.pool.ntp.org iburst   # comment this line
Server 172.16.0.134 iburst          # Server1 as NTP source

Restart and enable the daemon on Server2:

# systemctl restart chronyd
# systemctl enable chronyd

Open the NTP service in the firewall on Server1 (required for Server2 to reach it):

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

Verification

Run chronyc sources on both servers to confirm that Server2 reports Server1 as its source and that Server1 continues to sync with the public NTP servers.

Key Takeaways

Chrony provides fast, low‑overhead time synchronization suitable for modern Linux distributions.

Configuration is done via /etc/chrony.conf, where public NTP pools or private servers can be specified.

Use chronyc sources and chronyc tracking to monitor synchronization health.

Remember to allow NTP traffic through the firewall when using private NTP sources.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

linuxNTPtime synchronizationRocky LinuxchronyChronycChronyd
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.