CentOS Linux Install and Configure NTP to Synchronize The System Clock

by on May 18, 2007 · 38 comments· LAST UPDATED November 13, 2013

in , ,

How do I install and configure NTP under CentOS Linux version 5.x or 6.x server to synchronize the system clock?

You can easily install NTP (Network Time Protocol, a means of transmitting time signals over a computer network) using the yum command under Red Hat or CentOS/Fedora Linux server or workstation based systems. You need to install the following packages:
Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNTPD server
Estimated completion time5m

  1. ntp : ntpd server which continuously adjusts system time and utilities used to query and configure the ntpd daemon.
  2. ntpdate : Utility to set the date and time via NTP.
  3. ntp-doc : NTP documentation

Procedure: Setup NTPD on CentOS Linux

Open the terminal or login over the ssh session. You must login as as the root user. Type the following yum command to install ntp
# yum install ntp ntpdate ntp-doc

Turn on service, enter:
# chkconfig ntpd on

Synchronize the system clock with 0.pool.ntp.org server (use this command only once or as required):
# ntpdate pool.ntp.org

Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate:
# /etc/init.d/ntpd start

Configure ntpd (optional)

Edit /etc/ntp.conf, enter:
# vi /etc/ntp.conf
Set public servers from the pool.ntp.org project:

server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

See this tutorial on how to configure NTPD for LAN based client on RHEL / CentOS Linux for more information.

Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 38 comments… read them below or add one }

1 Jose Arellano June 28, 2008 at 5:26 pm

Nice inof, but how do i configure a NTP server? i want to do this with a client and a server… Thanks


2 Vincent February 19, 2009 at 5:39 pm

Thanks, very straight forward.


3 Pentav February 22, 2009 at 9:34 am

This helped me to fix my call of duty world at war server problem.

Thank you.


4 Joe March 5, 2009 at 11:46 pm

Does anyone know how to make it run ntpdate at certain time increments?
Like every hour?


5 nixCraft March 6, 2009 at 1:07 am

Setup a cronjob.


6 Spyisra March 10, 2009 at 7:12 am

Good info, very helpful.


7 Muzammil April 23, 2009 at 4:38 am

Thanks, very simple to install and configure. My time is synchronized now.


8 KSK May 28, 2009 at 3:51 am

nice information but please tell me about the client end that how i sync time server with clients


9 nixCraft May 28, 2009 at 6:47 am
10 Pooyait September 15, 2009 at 4:47 am

thanks man

very nice


11 Krishna October 14, 2014 at 8:37 am

is there a way where i can use my own server from which clients should sync time?


12 Kunal January 6, 2010 at 10:19 am

I did ntpdate 0.asia.pool.ntp.org
and now all my servers showing different time. Any idea why
server1 – Wed Jan 6 15:54:10 IST 2010
server2 – Wed Jan 6 15:47:39 IST 2010
server3 – Wed Jan 6 15:58:23 IST 2010

For more infomation – My servers are in India
Thanks in advance


13 JohnFen February 16, 2010 at 9:17 pm


My guess: You are obtaining your time info from a pool, so each time you synchronize you’re really getting your time form a different server. This shouldn’t matter, but it seems that the different servers in that pool are not synchronized with each other. You could pick a single server out of the pool and synchronize with it directly on each of your servers.

Or, even better, set up your own ntp server, have it synchronize with a quality outside time server, then have the rest of your servers sync up with the time server that you installed. That way, even if there’s an accuracy problem upstream, at least all of your servers will agree with each other.


14 Bahadir February 25, 2010 at 2:44 pm

I have this error:

ntpdate[14060]: step-systime: Operation not permitted


15 Anonymous June 4, 2010 at 11:25 am

This is likely related to the server being a virtual server. It is not possible to sync to ntp in a VPS because the clock is inherited from the hardware that you are hosted on.

I just ran across the same problem.


16 Matt April 28, 2010 at 6:27 am

Very useful


17 Bajinder May 31, 2010 at 4:17 am

Very Helpful :)


18 Ahmed Jaafar September 1, 2010 at 12:34 am

Replying @Anonymous June 4, 2010

Actually if you mean a Xen VM, you still can have your own independent system clock setting the following sysctl parameter.
sysctl -w xen.independent_wallclock = 1;

And you save it inside /etc/sysctl.conf


19 Jeffrey Roberts October 9, 2011 at 1:10 pm

Thanks for this tip!


20 Pal Singh October 22, 2010 at 10:06 pm

Thanks you for your instructions.


21 Koviko April 26, 2011 at 1:25 pm

This is exactly what I was looking for. Thank you for this clear post. :)


22 Jimbo May 27, 2011 at 5:58 pm

Thank you this was very helpful!


23 satish July 6, 2011 at 9:44 am

i have configured ntp server on my machine which runs rhel6
but at the client side at the time of ntp setting it giving me error tha
server is note reachable or doesn’t act as a ntp server and also i cant
see the port of ntp is open on my system, will you please help me for this



24 zanami July 20, 2011 at 2:09 am

Thanks but setting up / configuriing ntp servers list would be useful also


25 Ruben September 7, 2011 at 6:07 am

Thank you very much, it was exactly as you said.


26 Amin January 4, 2012 at 5:41 pm

Thanks a lot. great howto…


27 seachen March 20, 2012 at 5:45 pm

i am from Malaysia. which server should i use ?


28 ajd May 8, 2012 at 9:26 am

Great post ,, and it works as a charm :) ,, thank you very much


29 Enrique May 30, 2012 at 5:22 pm

Thanks a lot for your concise post.


30 Emil Stoyanov June 11, 2012 at 12:49 pm

The following command will additionally update your hardware clock

hwclock –systohc


31 s.khademi June 12, 2012 at 9:11 pm

Very helpful. Thanks


32 Fred September 3, 2012 at 2:50 pm

You dont need to have an ntp server running in your machine in order to have the time synced, it is as easy as having cron do the syncing with the ‘ntpclient’ command.


33 Ravindra Gohil September 10, 2012 at 5:49 am

Hi Fred,
Could you please share script to sync with ntp server. so that i can run the same as a cron job.


34 Leon November 25, 2012 at 12:58 am

Thank you much.


35 Wellington Torrejais da Silva May 19, 2014 at 2:37 pm



36 Buddhi August 13, 2014 at 5:53 pm

Thanks! you saved my day!


37 Carlo October 8, 2014 at 8:31 am

Thank you very much ! Very useful guide.


38 Scott February 12, 2015 at 1:54 am


I’m having a small issue on Fedora 21: when my computer goes to sleep, I lose time synchronization and have to manually restart ntpd when I wake it in order to resync. Any idea how to fix this?


Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: