What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (2024)

Imagine you have several Ubuntu servers running different applications.

Each server sends logs to the logger server, and you have monitoring software that collects resource metrics. Both services show logs with a timestamp. That requires all servers and devices in a network to have accurate and consistent time information.

This is where Network Time Protocol steps into the picture.

NTP stands for Network Time Protocol. The main purpose of NTP is to make sure that all computers and devices in a network have accurate and consistent time information.

Network Time Protocol is a client-server application. Each device in a network must be equipped with NTP client software to synchronize its clock to the NTP server.

Here are five important NTP use cases for DevOps:

  • Network Security: Accurate timekeeping is crucial for network security. In the case of a security breach, having synchronized time is important to track the security events and incidents.
  • Logging and Monitoring Accuracy: NTP helps ensure consistent timestamps across multiple devices in the network, so you can be sure that the timestamp you see in the logger is reflecting the true time.
  • Automation servers and scripts: Any automation requires the execution of commands at precise times.
  • Distributed Systems and Cloud Computing: In distributed computing environments and cloud-based services, you have to make sure that all devices are synchronized in real time.
  • Working with databases: in databases, time synchronization is essential for transaction ordering, replication, and consistency models.

Let’s talk about two main NTP implementation methods: NTP in the internal, closed network, and NTP in the external network with internet access.

Closed network:

It’s a network without internet access, so you will need to install an NTP server inside the network and connect our NTP clients to it.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (1)

There is an option to use the router with a calendar function as an NTP server, but in this tutorial, I will use one of the Windows computers running Windows 10 for that.

Configure the NTP server (Windows 10):

Windows 10 PC will be an NTP server, and my Ubuntu 22.04 machines will update the time from it as NTP clients.

  • Proceed to Control Panel\System and Security\Administrative Tools. Open the Run dialog (Windows Key + R), type services.msc and click OK.
  • Stop the Windows Time service.

  • Update the Windows Registry. Open the Run dialog (Windows Key + R), type regedit and click OK.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (3)

  • Navigate to the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (4)

  • Create LocalNTP DWORD (32 bit) Value. Right click > New > DWORD (32 bit) Value > LocalNTP. Double-click on LocalNTP, change the Value data to 1, make sure Base of Hexadecimal, and click OK.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (5)

  • Now navigate to the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer.
  • Double-click on Enabled, change Value data to 1, make sure Base of Hexadecimal, and click OK.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (6)

  • Navigate to the registry key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config.
  • Double click on AnnounceFlags, change Value data to 1, make sure Base of Hexadecimal, and click OK.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (7)

  • Close the Registry Editor.
  • Proceed to Control Panel\System and Security\Administrative Tools. Open the Run dialog (Windows Key + R), type services.msc and click OK.
  • Double-click on Windows Time, Startup time = Automatic, press Start, press OK.

Recommended by LinkedIn

Become part of the team which implements… NN 2 years ago
The Importance of Ansible and Configuration Management… Mesut Oezdil 1 year ago
Enhancing Software Development Security: The Case for… Tristan McGowan 1 year ago
What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (11)
The local NTP Time Server configuration is complete. Now you can synchronize the time of other devices in your local network.

Configure the NTP client (Ubuntu 22.04):

First, get the IP address of the NTP server.

  • On the Windows NTP server, press the Windows key, type cmd and press Enter.
  • Execute the ipconfig command, you will see the IP address on the output.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (12)

Proceed to the Ubuntu 22.04 machine.

  • Run a system update.

sudo apt-get update && sudo apt-get upgrade -y 

  • Install NTP.

sudo apt-get install ntp -y 

  • Configure the NTP server IP.

sudo vim /etc/ntp.conf 

  • Specify the NTP server to which you want to synchronize your machine.

# Specify one or more NTP servers.server 192.168.56.1 iburst 

  • Save the changes and close the editor.
  • If you are using a Linux firewall, you need to allow NTP.

sudo ufw allow 123/udp 

  • Restart the NTP service.

sudo systemctl restart ntp 

  • Verify NTP is working by checking the status.

sudo systemctl status ntp 
What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (13)

  • That’s it, you configured the NTP server and connected the NTP client (your Ubuntu machine) to it.

Network with internet access:

On a network with internet access, you can choose from many NTP servers and connect your devices to one of them.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (14)

For example:

Google Public NTP: https://developers.google.com/time

Cloudflare time services: https://www.cloudflare.com/time/

Microsoft NTP server: https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings?tabs=config

There are many of them, choose your own based on your needs.

What is NTP, why do you need it, and how to install/configure it? Guide for DevOps engineers. (2024)
Top Articles
Impact of Closing Store Credit Card on Credit Score
Dilution Techniques and Calculations
Netronline Taxes
How Many Cc's Is A 96 Cubic Inch Engine
Voorraad - Foodtrailers
Ingles Weekly Ad Lilburn Ga
What to Serve with Lasagna (80+ side dishes and wine pairings)
Koordinaten w43/b14 mit Umrechner in alle Koordinatensysteme
Jefferson County Ky Pva
Vocabulario A Level 2 Pp 36 40 Answers Key
Does Pappadeaux Pay Weekly
Tiraj Bòlèt Florida Soir
Lantana Blocc Compton Crips
Delectable Birthday Dyes
Audrey Boustani Age
The Shoppes At Zion Directory
Byte Delta Dental
Images of CGC-graded Comic Books Now Available Using the CGC Certification Verification Tool
Ess.compass Associate Login
Charter Spectrum Store
Where to Find Scavs in Customs in Escape from Tarkov
Arre St Wv Srj
Dragonvale Valor Dragon
Asteroid City Showtimes Near Violet Crown Charlottesville
Roanoke Skipthegames Com
Catchvideo Chrome Extension
Wku Lpn To Rn
Evil Dead Rise Ending Explained
Imagetrend Elite Delaware
Lininii
Franklin Villafuerte Osorio
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Lehpiht Shop
24 slang words teens and Gen Zers are using in 2020, and what they really mean
Movies123.Pick
Cvb Location Code Lookup
Laurin Funeral Home | Buried In Work
Dr. John Mathews Jr., MD – Fairfax, VA | Internal Medicine on Doximity
Sc Pick 4 Evening Archives
Mvnt Merchant Services
Kerry Cassidy Portal
Scarlet Maiden F95Zone
What Is A K 56 Pink Pill?
Coroner Photos Timothy Treadwell
Bekkenpijn: oorzaken en symptomen van pijn in het bekken
Breaking down the Stafford trade
Wolf Of Wallstreet 123 Movies
Is Chanel West Coast Pregnant Due Date
Mytmoclaim Tracking
Craigslist Anc Ak
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 5988

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.