NTP Server and Client(s) on
Ubuntu/Debian
Step 1: Update repository index
In order to install the latest available version of the software from the Internet
repositories, your local repository index needs to be in line with them. Run the
following command as sudo in order to update your local repository index:
$ sudo apt-get update
Step 2: Install NTP Server with apt-get
Please run the following command as sudo in order to install NTP server
daemon from the APT repositories:
$ sudo apt-get install ntp
Step 3: Verify installation (optional)
You can verify your NTP installation and also check the version number by
running the following command in your Terminal:
$ sntp --version
Step 4: Switch to an NTP server pool closest to your location
When you
install the NTP server, it is mostly configured to fetch the proper
time. However, you can switch the server pool to the ones closest to your
location. This includes making some changes in the
/etc/ntp.conf
file.
Open the file in the nano editor as sudo by running the following command:
$ sudo nano /etc/ntp.conf
In
this file, you will be able to see a pool list. We have highlighted this list in the
above image. The task here is to replace this pool list
by a pool of time servers
closest to your location. The pool.ntp.org project provides reliable NTP service
from a big cluster of time servers. To choose a pool list according to your
location, visit the following page:
https://www.ntppool.org/en/