Setting Up a Chrony Time Server on Linux for Accurate Time Synchronization

Configuring a Chrony time server on Linux ensures precise and consistent time synchronization across networked systems. As a modern alternative to NTP, Chrony is efficient in handling variable network conditions and provides high accuracy. Below is a comprehensive guide to deploying Chrony as a time server.

  1. Install Chrony

Begin by installing Chrony using your distribution's package manager. On Debian-based systems such as Ubuntu, run:

sudo apt update
sudo apt install chrony

For RHEL-based distributions like CentOS or AlmaLinux, use:

sudo dnf install chrony

  1. Configure the Chrony Server

Edit the main configuration file located at /etc/chrony/chrony.conf:

sudo nano /etc/chrony/chrony.conf

To set up this machine as a local time server, modify the file with the following settings:

# Disable public NTP pool servers (optional)
# Comment out or remove default pool entries like:
# pool 2.debian.pool.ntp.org iburst

# Use local system clock as a reference (useful when no external sync is available)
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 10

# Allow clients within the subnet to synchronize
allow 192.168.1.0/24

# Optional: Enable logging for monitoring
log measurements statistics tracking

The server 127.127.1.0 line configures the local clock as a fallback time source, while fudge assigns it a higher stratum value to indicate lower precision. Adjust the allow directive to match your network range.

  1. Start and Enable the Chrony Service

After configuration, start the service and enable it to launch at boot:

sudo systemctl start chronyd
sudo systemctl enable chronyd

  1. Check Server Status

Use chronyc, the command-line tool for interacting with Chrony, to verify operation:

chronyc tracking

A successful setup will show output including the current reference ID and stratum level. If the reference is LOCL, it indicates the local clock is being used.

You can also list all configured sources:

chronyc sources -v

  1. Configure Chrony Clients

On client machines, edit their /etc/chrony/chrony.conf file and add a server entry pointing to you're Chrony server’s IP address:

server 192.168.1.100 iburst

Replace 192.168.1.100 with the actual IP of your Chrony server. Then restart the Chrony daemon on the client:

sudo systemctl restart chronyd

  1. Verify Client Synchronization

On each client, check synchronization status using:

chronyc tracking

If the output shows the correct reference ID and stratum corresponding to your server, synchronization is working properly.

Optional: Secure Communication

To enhance security, consider enabling authentication between clients and server using symmetric keys. Generate a key and distribute it securely, then specify it in both server and cliant configurations using the keyfile and authrequired directives.

With this setup, your network maintains accurate and reliable timekeeping, esential for logging, authentication, and distributed applications.

Tags: chrony NTP Time Synchronization Linux server systemd

Posted on Mon, 21 Sep 2026 16:32:06 +0000 by ok