Log inSign up

Pick a time zone and keep the server clock accurate

List zones with timedatectl list-timezones and apply one with sudo timedatectl set-timezone UTC (or a city such as Europe/Berlin). Ubuntu and Debian keep time with systemd-timesyncd, Rocky Linux and AlmaLinux with chronyd; timedatectl should show System clock synchronized: yes and NTP service: active. For tighter accuracy, check the offset with chronyc tracking.

Topic: Server basics · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9, AlmaLinux 9 · Updated 2026-12-03

Why does the server clock matter so much?

A correct clock is a quiet requirement for almost everything on a server. TLS certificates are checked against the current time, two factor codes are only valid for a short window, cron jobs fire by the clock, distributed databases compare timestamps, and a Bitcoin or Lightning node rejects peers whose time differs too much. Logs from several servers can only be lined up if they agree on the time.

Two separate settings are involved. The time zone only changes how times are displayed and when local cron schedules fire; the kernel always counts in UTC internally. Time synchronization keeps that internal count accurate by asking NTP servers over UDP port 123. This guide covers both.

How do I see the current settings?

One command shows the local time, UTC, the zone and the sync state:

timedatectl

Typical output on a healthy server includes these lines:

               Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

If System clock synchronized says no a few minutes after boot, jump to the troubleshooting section. RTC in local TZ: no is correct for a Linux server; it means the virtual hardware clock also runs in UTC.

Should a server use UTC or a local time zone?

UTC is the safer default for servers. It never jumps for daylight saving time, so a cron job scheduled for 02:30 runs exactly once every night, and logs from servers in different cities line up without conversion. Use a local zone when people read the logs directly and want local times, or when an application has no time zone setting of its own and must act on local business hours.

A middle path works well: keep the system on UTC and set the zone per user or per application. A user can add export TZ=Europe/Berlin to ~/.bashrc, and most languages and databases accept a zone setting of their own. Since our servers run in 32 cities, a fleet on UTC also avoids surprises when you deploy the same setup on another continent.

How do I change the time zone?

Find the exact zone name, then apply it. Names follow the Region/City pattern from the IANA database:

timedatectl list-timezones | grep -i -E 'berlin|singapore|new_york'
sudo timedatectl set-timezone Europe/Berlin
timedatectl | grep 'Time zone'
date

To return to UTC run sudo timedatectl set-timezone Etc/UTC. The command updates the /etc/localtime link; on Debian family systems the tzdata package also keeps /etc/timezone in step. Keep the zone data current through normal updates, since governments change daylight saving rules from time to time.

Restart services that cache the zone at start, for example cron (cron on Ubuntu and Debian, crond on Rocky and Alma) and long running application servers:

sudo systemctl restart cron     # Ubuntu, Debian
sudo systemctl restart crond    # Rocky, Alma

How is time synchronization set up on Ubuntu and Debian?

Ubuntu 24.04, Ubuntu 22.04 and the Debian images use systemd-timesyncd, a small SNTP client that is fine for most servers. Check it and see which server it talks to:

systemctl status systemd-timesyncd --no-pager
timedatectl timesync-status

To use specific NTP servers, put them in a drop-in file rather than editing the main configuration:

sudo mkdir -p /etc/systemd/timesyncd.conf.d
printf '[Time]\nNTP=0.pool.ntp.org 1.pool.ntp.org\nFallbackNTP=2.pool.ntp.org\n' | sudo tee /etc/systemd/timesyncd.conf.d/ntp.conf
sudo systemctl restart systemd-timesyncd
timedatectl timesync-status

If sync was switched off, turn it back on with sudo timedatectl set-ntp true. Should systemd-timesyncd be missing on a minimal Debian install, add it with sudo apt install systemd-timesyncd.

When should I switch to chrony on Ubuntu or Debian?

Choose chrony when you need tighter accuracy, a server that keeps disciplining the clock smoothly, or when the machine should serve time to other hosts. It is a full NTP implementation and the default on the RHEL family. Installing it on Ubuntu or Debian replaces systemd-timesyncd automatically, because the two packages conflict:

sudo apt install chrony
systemctl status chrony --no-pager
chronyc tracking

The configuration file is /etc/chrony/chrony.conf on Debian family systems. Only one sync client should run at a time; two clients fighting over the clock is a common source of drift.

How is chrony configured on Rocky Linux and AlmaLinux?

Rocky Linux 9 and AlmaLinux 9 run chronyd out of the box, configured in /etc/chrony.conf. The file contains a pool line with a public pool name; you can replace or add servers there:

grep -E '^(pool|server)' /etc/chrony.conf
sudo systemctl enable --now chronyd
chronyc sources -v
chronyc tracking

After editing the file, restart with sudo systemctl restart chronyd. In chronyc sources, the line marked with ^* is the source currently selected. In chronyc tracking, System time shows how far the clock is from true time, normally a few milliseconds or less. To force an immediate correction after a large jump, run sudo chronyc makestep.

What if the clock still does not sync?

Work from the network outwards. NTP uses outgoing UDP port 123; a default deny for incoming traffic does not block it, but a strict outgoing policy would. Check the firewall and reach a pool server directly:

sudo ufw status verbose          # Ubuntu, Debian
sudo firewall-cmd --list-all     # Rocky, Alma
chronyc -N sources               # if chrony is in use
journalctl -u systemd-timesyncd -n 20 --no-pager

Other usual causes: two time services enabled at once, NTP turned off with set-ntp false, or DNS failing so pool names cannot be resolved. After a long power off, the first sync may step the clock by several seconds; that is expected. If you rely on precise time for trading bots or nodes, see the trading bots and Bitcoin node pages for how such workloads run on our plans.

Questions about Time zone and time sync

Does changing the time zone change the system clock?

No. The kernel keeps counting in UTC; only the way times are shown and how local schedules are interpreted change. Running services may need a restart to show the new zone.

Which time zone are new BitcoinVPS servers set to?

Check with timedatectl right after deploy rather than assuming. UTC is the usual starting point on server images, and you can change it at any time with timedatectl set-timezone.

Can I run systemd-timesyncd and chrony together?

No. Run one sync client only. Installing chrony on Ubuntu or Debian removes systemd-timesyncd for that reason.

How accurate is the clock with NTP?

On a healthy network connection chrony usually keeps the offset in the low millisecond range. chronyc tracking shows the current figure for your server.

How do cron jobs behave on daylight saving changes?

With a local zone, jobs scheduled inside the skipped or repeated hour may run zero or two times. A system on UTC avoids the problem entirely.