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 server 2.almalinux.pool.ntp.org on AlmaLinux) and Ubuntu 26.04 (service chrony). 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 ntpdate package 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

  1. 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
  2. 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). Reach 377 means the last 8 polls all got an answer; a freshly started chrony shows lower numbers.
  3. 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
  4. Update the time now instead of slowly: sudo chronyc makestep. Normally chrony corrects the clock gradually; the default makestep 1.0 3 line lets it jump only when the error is over 1 second during its first three updates after start.
  5. To use other time servers: on AlmaLinux, Rocky Linux and RHEL, edit the pool line in /etc/chrony.conf and run sudo systemctl restart chronyd. On Ubuntu and Debian, add a file ending in .sources to /etc/chrony/sources.d/ with a line such as pool 0.pool.ntp.org iburst, then run sudo chronyc reload sources (no restart needed). On Ubuntu 26.04 the default file there is ubuntu-ntp-pools.sources, with lines like pool 1.ntp.ubuntu.com iburst maxsources 1 nts prefer.

3. Sync time with systemd-timesyncd

  1. Show the server in use and the offset: timedatectl timesync-status (according to the systemd manual, timedatectl show-timesync gives the same in machine-readable form).
  2. 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.conf shows the result merged with the defaults.
  3. Restart it so it contacts the servers again, then check: sudo systemctl restart systemd-timesyncd and timedatectl timesync-status.

4. One-off time update (instead of ntpdate)

  • Check the offset without changing anything (according to the chrony manual, -Q also 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 makestep does the job.
  • On Debian and Ubuntu, scripts that call ntpdate work after sudo apt install ntpsec-ntpdate. ntpdate -q pool.ntp.org only 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.org sets 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

Official documentation: chrony documentation, timesyncd.conf and Windows Time service tools (Microsoft).

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket