Docs / Server Management / How to Set Up NTP Time Synchronization

How to Set Up NTP Time Synchronization

By Admin · Mar 2, 2026 · Updated Apr 23, 2026 · 37 views · 3 min read

How to Set Up NTP Time Synchronization

Accurate time synchronization is critical for server operations. TLS certificates, log correlation, cron jobs, database replication, and authentication protocols all depend on precise system time. An out-of-sync clock can cause certificate validation failures, missed scheduled tasks, and inconsistent log timestamps. This guide covers setting up reliable NTP (Network Time Protocol) synchronization on your Breeze instance.

Understanding Time Synchronization

NTP is a protocol that synchronizes system clocks over a network with millisecond-level accuracy. Your Breeze communicates with upstream NTP servers to determine the correct time and gradually adjusts its local clock to match. Modern Linux distributions use either systemd-timesyncd (a lightweight NTP client) or chrony (a full-featured NTP implementation).

Checking Current Time Status

Before configuring NTP, check your current synchronization status:

# Check system time and timezone
timedatectl

# View NTP synchronization details
timedatectl timesync-status

# Check if timesyncd or chrony is active
systemctl status systemd-timesyncd
systemctl status chronyd

Setting the Correct Timezone

Ensure your server uses the correct timezone:

# List available timezones
timedatectl list-timezones

# Set your timezone (example: US Eastern)
sudo timedatectl set-timezone America/New_York

# Or use UTC for servers (recommended)
sudo timedatectl set-timezone UTC

Using UTC on servers is a best practice because it avoids daylight saving time shifts and simplifies log correlation across geographically distributed systems.

Option 1: Using systemd-timesyncd

This is the default NTP client on most Ubuntu and Debian installations. It is lightweight and suitable for basic time synchronization:

# Edit the configuration
sudo nano /etc/systemd/timesyncd.conf

[Time]
NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
FallbackNTP=ntp.ubuntu.com

# Restart the service
sudo systemctl restart systemd-timesyncd

# Verify synchronization
timedatectl show-timesync --all

Option 2: Using Chrony (Recommended)

Chrony is more accurate, handles intermittent connectivity better, and can act as both an NTP client and server:

# Install chrony
sudo apt install -y chrony    # Ubuntu/Debian
sudo dnf install -y chrony    # AlmaLinux/Rocky

# Enable and start
sudo systemctl enable chronyd
sudo systemctl start chronyd

Configuring Chrony

Edit /etc/chrony/chrony.conf (or /etc/chrony.conf on RHEL-based systems):

# Use pool servers
pool 0.pool.ntp.org iburst
pool 1.pool.ntp.org iburst
pool 2.pool.ntp.org iburst
pool 3.pool.ntp.org iburst

# Record the rate at which the system clock gains/losses time
driftfile /var/lib/chrony/drift

# Allow stepping the clock on first sync
makestep 1.0 3

# Enable kernel synchronization of the hardware clock
rtcsync

# Log statistics
logdir /var/log/chrony

Verifying Chrony Synchronization

# Check synchronization sources
chronyc sources -v

# View tracking statistics
chronyc tracking

# Check server activity
chronyc activity

Serving NTP to Other Breezes

If you run multiple Breeze instances, designate one as a local NTP server to reduce external traffic:

# Add to chrony.conf on the NTP server
allow 10.0.0.0/8

# On client Breezes, point to the local NTP server
server 10.0.1.1 iburst

Monitoring and Alerts

  • Set up a cron job to check time offset: chronyc tracking | grep "System time"
  • Alert if the offset exceeds 100 milliseconds
  • Monitor NTP port 123/UDP in your firewall logs for unexpected traffic
  • Review /var/log/chrony/ logs periodically for synchronization issues

Was this article helpful?