Rabu, 05 Februari 2025

How to Install and Configure NTP Server on Ubuntu 22.04

How to Install and Configure NTP Server on Ubuntu 22.04

How to Install and Configure NTP Server on Ubuntu 22.04

Network Time Protocol (NTP) is used to synchronize the system clock with a reliable time source. This guide will walk you through the installation and configuration of an NTP server on Ubuntu 22.04.

Step 1: Update System Packages

Before installing NTP, update your system packages:

sudo apt update && sudo apt upgrade -y

Step 2: Install NTP

Install the NTP package using the following command:

sudo apt install ntp -y

Step 3: Configure NTP Server

Open the NTP configuration file:

sudo nano /etc/ntp.conf

Modify the server list to use reliable NTP servers:

server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst

Save the file and exit.

Step 4: Restart and Enable NTP Service

sudo systemctl restart ntp
sudo systemctl enable ntp

Step 5: Verify NTP Status

Check if the NTP service is running:

sudo systemctl status ntp

To check synchronization sources, use:

ntpq -p

Conclusion

You have successfully installed and configured an NTP server on Ubuntu 22.04. Your system time should now be synchronized with reliable time sources.

Share: