Set up NTP Server on Linux Server

This article describes the steps how to set up a NTP Server on your Local Network on RedHat, CentOS & Oracle Linux.

Table of contents:

– Network Time Protocol :

– Set UP NTP Server configuration:

– Set UP NTP Client configuration:

 1. Network Time Protocol:

Network Time Protocol (NTP) is a networking protocol for clock  synchronization between computer systems over packet-switched, variable-latency data networks. NTP is intended to synchronize all participating computers to within a few milliseconds of Coordinated Universal Time (UTC), for more info.


Setting up NTP is by installing the ntp package which contains utilities and daemons.

The ntp package includes ntpd (a daemon which continuously adjusts system time) and ntpdate (a program for retrieving the date and time from remote machines via a network).





To install the NTP package (on both NTP Client & Server side):

# yum install ntp
# chkconfig ntpd on

Note: Installing packages with YUM using DVD image.

Verify the NTPD Sysconfig configuration:

# cat /etc/sysconfig/ntpd
OPTIONS="-x -u ntp:ntp -p /var/run/"

 2. Set UP Local  NTP Server:

Step 1: Add your Local Network.

My local network is, then adjust the network within the configuration file of the ntp server.

# vi /etc/ntp.conf
restrict mask nomodify notrap

Step2: Setting the

Note: The NTP server is also a NTP Client of the, which is a big virtual cluster of timeservers providing reliable easy to use NTP service for millions of clients.

# vi /etc/ntp.conf
# Use public servers from the project.

Step 3 :To Synchronize our NTP Server with the, we can use the tool ntpdate directly or while the Linux server start will automatically synchronize his date if there are an internet connection:

# ntpdate -u
31 Aug 10:32:47 ntpdate[3391]: adjust time server offset -0.000237 sec




Step 4: Update your Firewall:

Update your firewall, the port number of the NTP Server is 123 while using the UDP protocol.

# iptables -A INPUT -s -m state --state NEW -p udp --dport 123 -j ACCEPT 
# iptables-save

 2. Set UP NTP Client:

Step 1: Editing the file /etc/ntp.conf to add the NTP Server IP address.

# vi /etc/ntp.conf
# Use public servers from the project.

Step 2: To synchronize immediatelly, we can use the tool ntpdate:

# ntpdate -u
31 Aug 10:38:54 ntpdate[2778]: adjust time server offset -0.001602 sec




Note: By enabling the service ntpd, then the Linux Server will update the date automatically while starting.


This article describes the steps how to create a local NTP Server and to configure NTP clients.



Share it now!
Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply