Install and configure NTP on Ubuntu
Enter the following command to install NTP:
sudo apt-get install ntp
Use NTP pool servers
- Open
/etc/ntp.conf
in a text editor. - Look for lines similar to the following:
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org
- Replace those lines or add additional lines that specify your NTP pool server or other NTP servers. It’s a good idea to specify more than one.
- An example of using three United States-based NTP servers follows:
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
- Save your changes to
/etc/ntp.conf
and exit the text editor. - Restart the service.
sudo service ntp restart
- Enter
date
to check the server’s date.