Skip to content
Follow
Ubuntu Linux

How to Set Up NTP Server and Client on Ubuntu 24.04

Richard
Written by
Richard
Mar 9, 2025 Updated Sep 15, 2026 4 min read
How to Set Up NTP Server and Client on Ubuntu 24.04
How to Set Up NTP Server and Client on Ubuntu 24.04

Chrony keeps your computer clocks in sync on Ubuntu 24.04 by setting up a Network Time Protocol (NTP) server and client. NTP makes sure all computers on a network share the exact same time so event logs stay correct and security tools run properly.

Advertisement

Accurate time stops errors caused by clock drift between machines. You need root access to install and configure these time-sync tools on your system.

⚡ Quick Answer

Install the Chrony package using `sudo apt install chrony`. Configure `/etc/chrony/chrony.conf` to specify your desired NTP servers and allow network access. Then, set up clients by editing `/etc/systemd/timesyncd.conf` to point to your NTP server.

Advertisement

Install NTP server

Installing an NTP server on Ubuntu 24.04 requires choosing between NTPsec and Chrony to keep your system clock accurate. You only need one of these programs installed. Run the command sudo apt install ntpsec in your terminal to download and set up NTPsec on your system right away.

You can pick one of the two to use in your environment.

Install NTPsec

Run the command below to install NTPsec.

Advertisement
sudo apt install ntpsec

After installing NTPsec, you can find its configuration file at the following location: [/etc/ntpsec/ntp.conf].

Install Chrony

To install Chrony, run the command below.

sudo apt install chrony

After installing Chrony, you can find its configuration file at the following location: [/etc/chrony/chrony.conf].

Advertisement

Configure NTP server

Configuring your NTP server on Ubuntu 24.04 involves editing the main settings file to point your system to reliable time sources. You need to open the configuration file, turn off the default time pools by adding hash symbols, and add your preferred time servers to keep everything accurate.

NTPsec configuration

⚠️WarningComment out [#] the bold lines to disable the default NTP pool.

Then, add the pool you want to use.

# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
#tos minclock 4 minsane 3

# Specify one or more NTP servers.

# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See https://www.pool.ntp.org/join.html for
# more information.
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst


pool time.nist.gov iburst

# Use Ubuntu's ntp server as a fallback.
#server ntp.ubuntu.com

Save and exit the file.

Advertisement

Check the status.

ntpq -p

Chrony configuration

⚠️WarningComment out [#] the bold lines to disable the default NTP pool.

Then, add the pool you want to use.

# About using servers from the NTP Pool Project in general see (LP: #104525).
# Approved by Ubuntu Technical Board on 2011-02-08.
# See http://www.pool.ntp.org/join.html for more information.
#pool ntp.ubuntu.com iburst maxsources 4
#pool 0.ubuntu.pool.ntp.org iburst maxsources
#pool 1.ubuntu.pool.ntp.org iburst maxsources 1
#pool 2.ubuntu.pool.ntp.org iburst maxsources 2


pool time.nist.gov iburst

# add this line to allow all clients on network
allow 192.168.156.0/24

Save the file and exit.

Advertisement

Restart Chrony

sudo systemctl restart chrony

Check status.

chronyc sources

Set up NTP client

Setting up an NTP client on Ubuntu 24.04 does not require installing any extra software because the tools are already built into the operating system. You only need to edit the system time configuration file to point your computer at your local NTP server for automatic clock synchronization.

There's no additional software to install on the client.

Advertisement

Run the command below to open the NTP client configuration file.

sudo nano /etc/systemd/timesyncd.conf

Then, add the local server name in the file.

[Time]
NTP=srv1.example.com

Save the file and exit.

Restart the services.

Advertisement
sudo systemctl restart systemd-timesyncd

Check status.

timedatectl timesync-status

You should see output similar to the one below.

       Server: 192.168.156.130 (srv1.example.com)
Poll interval: 1min 4s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 2
Reference: 84A36006
Precision: 1us (-26)
Root distance: 16.433ms (max: 5s)
Offset: +2.247ms
Delay: 380us
Jitter: 0
Packet count: 1
Frequency: +31.702ppm

That should do it!

Conclusion:

Setting up an NTP server and client on Ubuntu 24.04 ensures that your devices maintain accurate time synchronization, which is vital for various network operations. Here are the key points to remember:

  • NTP Importance: Essential for keeping accurate, synchronized time across devices.
  • Server Options: Choose between NTPsec and Chrony based on your needs.
  • Configuration: Adjust the configuration files to specify desired NTP servers and settings.
  • Client Setup: No additional software is required; simple configuration is sufficient.
  • Verification: Use commands to check the status and ensure synchronization works correctly.
  • Benefits of Accuracy: Consistent timestamps contribute to better security protocols, logging, and data integrity.

Following the outlined steps, you can successfully establish a reliable NTP setup to enhance your network's time management.

Was this guide helpful?

0% of readers found this helpful (1 votes)

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Advertisement

📚 Related Tutorials

How to Change Internet Time Server in Windows 11
Windows How to Change Internet Time Server in Windows 11
How to Install NetData on Ubuntu 24.04
Ubuntu Linux How to Install NetData on Ubuntu 24.04
How to Install Emby Media Server on Ubuntu 24.04
Ubuntu Linux How to Install Emby Media Server on Ubuntu 24.04
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *