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 Jul 13, 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

Setting up an NTP server and client on Ubuntu 24.04 uses the Chrony package to keep computer clocks in sync.

Network Time Protocol, or NTP, is a system that makes sure all computers on a network have the exact same time. Chrony is the standard and best choice for this job on Ubuntu 24.04, and it’s known for being quick and precise.

Having accurate, matching times on all your devices is important for many things. It helps with keeping good logs of computer events, makes sure security systems work correctly, and allows different systems to work together smoothly. Getting your Ubuntu 24.04 system’s time right stops issues caused by time differences.

⚡ 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.

Install NTP server

You can set up an NTP server on Ubuntu 24.04 by installing either NTPsec or Chrony. Both programs help keep your computer’s clock accurate. You only need to choose and install one of them to get started.

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

Install NTPsec

Run the command below to install NTPsec.

🐧Bash / Shell
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.

🐧Bash / Shell
sudo apt install chrony

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

Configure NTP server

Once you’ve installed your NTP server software on Ubuntu 24.04, you need to configure it to use specific time sources. This involves editing the main settings file to tell your server where to get accurate time information from.

NTPsec configuration

⚠️Warning
Comment out [#] the bold lines to disable the default NTP pool. Then, add the pool you want to use.
💻Code
# 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.

Check the status.

💻Code
ntpq -p

Chrony configuration

⚠️Warning
Comment out [#] the bold lines to disable the default NTP pool. Then, add the pool you want to use.
💻Code
# 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.

Restart Chrony

🐧Bash / Shell
sudo systemctl restart chrony

Check status.

💻Code
chronyc sources

Set up NTP client

Setting up your Ubuntu 24.04 computer as an NTP client is straightforward and doesn’t need extra software. You simply adjust the current time settings to connect to your NTP server, ensuring your computer stays synchronized with accurate time.

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

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

🐧Bash / Shell
sudo nano /etc/systemd/timesyncd.conf

Then, add the local server name in the file.

💻Code
[Time]
NTP=srv1.example.com

Save the file and exit.

Restart the services.

🐧Bash / Shell
sudo systemctl restart systemd-timesyncd

Check status.

💻Code
timedatectl timesync-status

You should see output similar to the one below.

💻Code
       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?

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.

📚 Related Tutorials

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
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE 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 *