Set the Time Zone and NTP Sync on Ubuntu Server

Current state (time, time zone, NTP):

timedatectl

Find and set your time zone:

timedatectl list-timezones | grep Madrid
sudo timedatectl set-timezone Europe/Madrid

Enable NTP sync:

sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd

Check:

date
timedatectl
timedatectl timesync-status
systemctl status systemd-timesyncd

Use your own NTP server (e.g. a domain controller): set NTP=10.0.0.10 in /etc/systemd/timesyncd.conf and restart systemd-timesyncd. If the server uses chrony instead, check it with chronyc tracking.

Written by Daniel Ruiz Peláez, Systems & Infrastructure Engineer (Linux, VMware, Proxmox, Active Directory, networking and security). These are notes from real problems I have solved.

← Back to all posts