systemd-timesyncd: Simple Time Sync with timedatectl

Accurate system time is foundational for logs, TLS, automation, and distributed systems. systemd-timesyncd provides lightweight SNTP-based synchronization that is enough for many hosts.

Table of Contents

This post covers setup, verification, configuration, and troubleshooting for timesyncd.

Core Concepts

Operational Guidance

Series Navigation

What timesyncd provides

systemd-timesyncd is an SNTP client built for straightforward time synchronization. It is lightweight and simple to operate, but not a full NTP server or advanced discipline daemon like chrony.

When timesyncd is usually enough:

  • General Linux servers and VMs with moderate accuracy requirements
  • Environments prioritizing minimal components and simple operations
  • Hosts that only need client-side synchronization

When to prefer chrony or ntpd:

  • Tight accuracy requirements under unstable network conditions
  • Complex enterprise NTP topologies or server-mode requirements
  • Advanced drift correction and statistics needs

Enable and verify time sync

Use timedatectl to enable NTP synchronization and confirm service state.

sudo timedatectl set-ntp true
systemctl status systemd-timesyncd.service
timedatectl status

set-ntp true enables the selected time sync mechanism on systemd-based systems and usually starts timesyncd unless another NTP stack is configured.

Configure time servers

Configuration file:

/etc/systemd/timesyncd.conf

Example:

[Time]
NTP=time.cloudflare.com time.google.com
FallbackNTP=pool.ntp.org
RootDistanceMaxSec=5

Apply changes:

sudo systemctl restart systemd-timesyncd

Choose time sources that align with organizational policy and geographic reliability.

Inspect sync health

Use these commands to inspect synchronization status and peer data.

timedatectl status
timedatectl show-timesync --all
timedatectl timesync-status

On older distributions, timesync-status may be unavailable, so rely on status, show-timesync, and journal logs.

Timezone vs clock synchronization

Timezone configuration and NTP synchronization solve different problems:

  • Time sync ensures the system clock value is accurate
  • Timezone controls how local time is displayed to users and logs

Set timezone independently:

timedatectl set-timezone America/New_York

Hardware clock note

The hardware clock setting can matter in dual-boot or virtualization scenarios.

timedatectl set-local-rtc 0

Use local RTC mode only when you have a clear compatibility requirement because UTC RTC usually avoids cross-platform drift issues.

Troubleshooting workflow

Reliable troubleshooting sequence:

  • Check service state and synchronization flags with timedatectl status
  • Review peer and offset details with show-timesync
  • Check logs with journalctl -u systemd-timesyncd -b
  • Verify firewall and outbound UDP 123 reachability

Helpful commands:

journalctl -u systemd-timesyncd -b -n 100
timedatectl show-timesync --all

Series navigation

Time synchronization rounds out the platform services side of systemd. The next post closes the series with production hardening and troubleshooting patterns.

Next in this series

Next, we cover resource controls, service hardening directives, and incident-driven debugging workflows.

systemd in Production: Resource Limits, Hardening, and Troubleshooting