Step-by-Step Guide to Configure NTP Server on Windows Server

Administering your organization’s IT infrastructure requires proper configuration of the NTP (Network Time Protocol) to guarantee accurate time synchronization. This is crucial for event logging, network security, and various computer operations. In this article, we will guide you on setting up an NTP Server on a Windows Server.

Setting Up NTP Server on Windows Server

The Network Time Protocol (NTP) is a widely-used internet protocol that provides precise time information and synchronizes the time settings across computer systems.

To establish an NTP Server on Windows Server, you can either leverage the Windows Registry or utilize PowerShell.

1] Configuring NTP Server through Registry Editor

We will start with configuring the NTP Server using the Registry Editor, which is a structured database that configures your computer’s settings. Follow these steps:

  • First, back up your registry.
  • Next, enable NtpServer via the registry key and configure the Win32Time’s AnnounceFlags.
  • After that, restart the NTP Server.
  • Lastly, open the necessary UDP port in the Firewall.

To launch the Registry Editor, press Run, enter “regedit”, and click OK. When prompted by UAC, select Yes to proceed. Start by backing up your registry, which will be useful if you need to restore it later. In the Registry Editor, go to File > Export, choose a location for the backup, and save it.

Once you have created your backup, navigate to the Registry Editor location:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer

Locate the Enabled value, double-click it, and set its Value data to 1 to activate the NTP protocol on your server.

Next, navigate to:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

Find the AnnounceFlags value, double-click on it, and set its Value data to 5.

To restart the NTP Server, simply restart the Time service. Press Win + S, search for Services, and open it. Locate the Windows Time service, right-click, and select Restart. After the service has restarted, proceed to the final step.

Finally, we need to open UDP Port 123, which is essential for NTP traffic. Here’s how:

  • Open Run with Win + R, type “wf.msc” , and press Enter to access the Windows Defender Firewall with Advanced Security.
  • Select Inbound Rules > New Rule.
  • Opt for Port and click Next.
  • Check the UDP option and input 123 in the Specific local port field, then click Next.
  • Select Allow the connection and hit Next.
  • Choose the profile that applies to this rule: Domain, Private, or Public, then click Next.
  • Name your rule and add a description before proceeding with Next.

By doing this, you will successfully open UDP Port 123 to facilitate NTP traffic.

This concludes the configuration of an NTP Server on a Windows Server.

2] Configuring NTP Server via PowerShell

While the previous method guides you through a GUI approach, there is also a command-line interface (CLI) alternative. You will need to open PowerShell and execute the following commands:

  • To enable the NTP Server registry key, run the command below:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer"-Name "Enabled"-Value 1

  • Next, set AnnounceFlags to 5 by entering the command below:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config"-Name "AnnounceFlags"-Value 5

  • To restart the Time service, enter: Restart-Service w32Time.
  • Lastly, configure the firewall by running the following commands:

New-NetFirewallRule ` -Name "Allow NTP"` -DisplayName "NTP Server Port"` -Description 'Allow NTP Server Port' ` -Profile Any ` -Direction Inbound ` -Action Allow ` -Protocol UDP ` -Program Any ` -LocalAddress Any ` -LocalPort 123

With these steps, your NTP Server is now configured.

How to Configure NTP Server on Windows Server

To successfully set up an NTP Server in Windows Server, ensure you enable the relevant registry key and configure the AnnounceFlags under W32Time. After these configurations, restart the Time service and set up the UDP port to permit NTP traffic. We suggest following the provided steps for a seamless setup.

How Do I Establish My Own NTP Server?

Setting up your NTP Server on Windows is relatively straightforward—simply configure the registry settings, reboot the Windows Time service, and adjust the UDP port settings as outlined in this guide.


Author: Egor Kostenko

My goal is to make complex technical topics simple and accessible. On this site, I gather unique and useful content that not only solves users’ problems but also helps them better understand the capabilities of Windows.


Leave a Reply

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