Setting up NTP on Debian/Ubuntu

You need to:

  1. Install the NTP dæmon (Package ntp in Debian and friends).
  2. Pick some NTPServers to synch with.
  3. If necessary, fix your system time.
  4. Start the dæmon.

All in all:

aptitude install ntp
/etc/init.d/ntp stop
echo 'server' >> /etc/ntp.conf
ntpdate  # optional
/etc/init.d/ntp start

Of course you would actually use a TextEditor to add the NTPServers to /etc/ntp.conf, and you would use whichever server is appropriate in place of

The ntpdate(8) step is necessary only if your local clock is way off from the time server’s time, in which case the NTP dæmon may terminate. Note that even ntpdate(8) adjusts the time only gradually if within a certain time range – if you don't want that, use the -b option.

See also