How to install NTP server in Ubuntu 24.04

Introduction

Network Time Protocol (NTP) allows devices across your network to stay synchronized with precise time sources. 

Having an NTP server on your network ensures that all devices maintain synchronized time, which is invaluable during troubleshooting. When network issues occur, synchronized logs allow engineers to reconstruct the exact sequence of events across multiple devices without wasting time adjusting for clock differences. This precision helps quickly identify which device failed first, how problems cascaded through the network, and ultimately reduces mean time to resolution - turning what could be hours of investigation into minutes.

This guide will help you install and configure an NTP server on Ubuntu 24.04.

Table of Contents

Update your System

  1. Before installing, ensure your system is up to date:
sudo apt update && sudo apt upgrade -y

Install the NTP server

Install the NTP package with:

sudo apt install ntp -y

Configure the NTP Server

Open the configuration file:

sudo nano /etc/ntp.conf

write there IP address of your device to make it NTP server:

server <Your NTP server address>

If you want to add Ubuntu default servers type this in file:

server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst

Allow NTP traffic through the firewall:

Allow NTP traffic through the firewall:

sudo ufw allow 123/udp
sudo ufw reload

Restart and Verify the NTP Service

Restart the NTP service:

sudo systemctl status ntp

Check if the service is active and running:

sudo systemctl status ntp

To verify if the NTP server is synchronizing time properly, use:

ntpq -p

You should see a list of servers and synchronization offsets.

Troubleshooting

Check logs if NTP fails to start:

sudo journalctl -u ntp

Congratulations!

You have successfully configured your NTP server on Ubuntu 24.04. Your network devices can now stay synchronized with accurate time sources, ensuring smooth communication and proper timekeeping across your infrastructure. Remember to periodically check the server status and logs to maintain optimal performance.

Happy networking!

If you want to explore more topics, be sure to check out our other guides, including:

How to set up your first console connection to the open networking switch?

How to build the community version of SONiC Virtual Switch (SONiC VS) image?

 

For more free resources, visit: https://stordis.com/free-resources/

Was this article helpful?
0 out of 0 found this helpful

Articles in this section