DEV Community

Ibrar Hussain
Ibrar Hussain

Posted on

5 2

NTP (Network Time Protocol) Setup for Linux (Ubuntu) Server

When you launch a new Linux server, whether it's an AWS EC2 instance or a local server, by default, the server time is not synced with the NTP server and most of the times the timezone is set to UTC.

In most cases server timing synchronizing with the NTP server is very important.

Following are the steps:

Install & Configure NTP

  • Run the following command to install the NTP
sudo apt-get install ntp
Enter fullscreen mode Exit fullscreen mode
  • Open the ntp.conf file:
sudo vi /etc/ntp.conf
Enter fullscreen mode Exit fullscreen mode
  • Check if the NTP pool entries the same as below otherwise update it:
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst
Enter fullscreen mode Exit fullscreen mode
  • Restart the NTP service
sudo service ntp restart
Enter fullscreen mode Exit fullscreen mode
  • Check the NTP service status by running the following command:
service ntp status
Enter fullscreen mode Exit fullscreen mode

Set/Change timezone

  • Let's say you want to change the timezone to AEDT
  • You can set it by running the following command:
sudo timedatectl set-timezone Australia/ACT
Enter fullscreen mode Exit fullscreen mode
  • Restart the NTP service
sudo service ntp restart
Enter fullscreen mode Exit fullscreen mode
  • You can confirm the result by running the following command:
service ntp status
Enter fullscreen mode Exit fullscreen mode
  • and it should you the result like the following:

Alt Text

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more