Updated: 17 October 2026 · Applies to: chrony 4.8 (AlmaLinux 10.2, Ubuntu 26.04), chrony 4.6 (Debian 13), systemd-timesyncd 255 (Ubuntu 24.04), ntpsec-ntpdate (Debian 13, Ubuntu); Windows Server according to Microsoft
To sync the time on Linux, run timedatectl. If it shows System clock synchronized: yes and NTP service: active, the server already keeps its clock in step with NTP time servers. If not, run sudo timedatectl set-ntp true. To update the time at once, run sudo chronyc makestep on servers with chrony (AlmaLinux, Rocky Linux, RHEL, Ubuntu 26.04) or sudo systemctl restart systemd-timesyncd on Ubuntu 24.04 and Debian 13.
Which time client does your server use?
NTP (Network Time Protocol, UDP port 123) is the protocol; a small client service talks to the time servers. What we found on current releases:
- chrony: AlmaLinux 10 and the other RHEL-based systems such as Rocky Linux (service
chronyd, default server2.almalinux.pool.ntp.orgon AlmaLinux) and Ubuntu 26.04 (servicechrony). Ubuntu 26.04 uses Ubuntu's own servers with NTS, which authenticates the time servers. - systemd-timesyncd: Ubuntu 24.04 (fallback server
ntp.ubuntu.com) and Debian 13, where it comes with the standard system utilities. It is a simple client that is enough for most servers. - ntpd and ntpdate from older guides: Ubuntu 26.04 has no
ntpdatepackage any more and AlmaLinux 10 has none in its repositories. See the one-off update below.
Run only one client. On Ubuntu and Debian, chrony and systemd-timesyncd conflict, so installing one removes the other; AlmaLinux's chronyd unit is marked as conflicting with ntpd and systemd-timesyncd.
1. Check the current state
$ timedatectl
Local time: Mon 2026-10-12 05:30:54 UTC
Universal time: Mon 2026-10-12 05:30:54 UTC
RTC time: n/a
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
Lab example from our AlmaLinux 10 test container. A container shows RTC time: n/a and an inactive NTP service because the host keeps its clock (see "Containers" below); a normal server shows the hardware clock time and NTP service: active. If the service is inactive on a server, switch it on with sudo timedatectl set-ntp true.
2. Sync time with chrony
- Install and start it if it is missing:
sudo dnf install chrony && sudo systemctl enable --now chronyd # AlmaLinux, Rocky Linux, RHEL sudo apt install chrony # Ubuntu, Debian
- See which time servers it uses (lab example, shortened, server addresses replaced):
$ chronyc sources MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ 203.0.113.10 2 6 17 19 -1367us[-2725us] +/- 105ms ^+ 203.0.113.20 2 6 17 19 +816us[ -542us] +/- 73ms ^* 203.0.113.40 2 6 17 18 +2305us[ +946us] +/- 70ms
^*is the server in use,^+are good servers combined with it, and^?means unusable (often unreachable). Reach377means the last 8 polls all got an answer; a freshly started chrony shows lower numbers. - See how far off the clock is:
$ chronyc tracking Stratum : 3 System time : 0.003032440 seconds slow of NTP time Last offset : -0.001358806 seconds Leap status : Normal
- Update the time now instead of slowly:
sudo chronyc makestep. Normally chrony corrects the clock gradually; the defaultmakestep 1.0 3line lets it jump only when the error is over 1 second during its first three updates after start. - To use other time servers: on AlmaLinux, Rocky Linux and RHEL, edit the
poolline in/etc/chrony.confand runsudo systemctl restart chronyd. On Ubuntu and Debian, add a file ending in.sourcesto/etc/chrony/sources.d/with a line such aspool 0.pool.ntp.org iburst, then runsudo chronyc reload sources(no restart needed). On Ubuntu 26.04 the default file there isubuntu-ntp-pools.sources, with lines likepool 1.ntp.ubuntu.com iburst maxsources 1 nts prefer.
3. Sync time with systemd-timesyncd
- Show the server in use and the offset:
timedatectl timesync-status(according to the systemd manual,timedatectl show-timesyncgives the same in machine-readable form). - To set your own time servers, create a drop-in file:
sudo mkdir -p /etc/systemd/timesyncd.conf.d sudo nano /etc/systemd/timesyncd.conf.d/servers.conf
with:[Time] NTP=0.pool.ntp.org 1.pool.ntp.org FallbackNTP=ntp.ubuntu.com
systemd-analyze cat-config systemd/timesyncd.confshows the result merged with the defaults. - Restart it so it contacts the servers again, then check:
sudo systemctl restart systemd-timesyncdandtimedatectl timesync-status.
4. One-off time update (instead of ntpdate)
- Check the offset without changing anything (according to the chrony manual,
-Qalso works without root):$ chronyd -Q 'pool pool.ntp.org iburst' 2026-10-12T05:31:13Z System clock wrong by -0.008092 seconds (ignored)
- Set the clock once and exit:
sudo chronyd -q 'pool pool.ntp.org iburst'. Use this when the chrony service is stopped; while it runs,sudo chronyc makestepdoes the job. - On Debian and Ubuntu, scripts that call
ntpdatework aftersudo apt install ntpsec-ntpdate.ntpdate -q pool.ntp.orgonly queries (address replaced):2026-10-12 05:45:24.964870 (+0000) -0.027575 +/- 0.099805 pool.ntp.org 203.0.113.50 s2 no-leap
sudo ntpdate pool.ntp.orgsets the clock.
5. The hardware clock (RTC)
Besides the system clock, a server has a battery-backed real-time clock (RTC) that keeps time while it is off. With NTP running you rarely need to touch it: chrony's rtcsync setting (on by default on AlmaLinux 10 and Ubuntu 26.04) lets the Linux kernel copy the system time to the RTC every 11 minutes. By hand:
sudo hwclock --show # read the RTC sudo hwclock --systohc # copy the system time to the RTC
Keep the RTC in UTC (timedatectl set-local-rtc 0); the systemd manual warns that an RTC in local time causes problems with time zone and daylight-saving changes. Inside a container there is no RTC: hwclock answered "Cannot access the Hardware Clock via any known method" in our test.
Containers: why time sync does not start
Setting the clock needs the CAP_SYS_TIME capability, which containers do not get. In our tests, AlmaLinux's chronyd unit reported ConditionCapability=CAP_SYS_TIME was not met, Ubuntu's systemd-timesyncd unit skips containers (ConditionVirtualization=!container), chronyd -q stopped with adjtimex(0x8001) failed : Operation not permitted and date -s with cannot set date: Operation not permitted. That is intended: a container shares the host's clock, so fix the time on the host and do not grant the container that capability.
Windows Server: sync time from the command line
According to Microsoft, w32tm is the preferred tool for the Windows Time service. In an administrator Command Prompt:
w32tm /config /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org" /syncfromflags:manual /update w32tm /resync w32tm /query /status
Common problems
- Sources show
^?: allow outgoing UDP port 123 in the firewall. NTS on Ubuntu 26.04 also needs outgoing TCP port 4460. - Time correct but the hour is wrong: NTP always keeps the clock in UTC; the time zone only changes how it is shown. Set it with
sudo timedatectl set-timezone Asia/Kolkata, or see set the date, time and time zone with timedatectl. - Two clients fighting: keep only one of chrony, systemd-timesyncd or ntpd.
- You want your own time server for other machines: see configure an NTP server and clients with chrony. To log chrony statistics, see enable chrony statistics logs.
Official documentation: chrony documentation, timesyncd.conf and Windows Time service tools (Microsoft).