Epidemiology & Technology

NTP Server setup in Ubuntu 22.04

NTP server is an essential component of ant Datacenter

To set up a NTP server, use the following steps

sudo timedatectl set-timezone Asia/Karachi
sudo apt update
sudo apt install chrony


sudo nano /etc/chrony/chrony.conf

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


allow 192.168.0.1/24
allow 192.168.1.1/24
allow 10.0.0.0/24



systemctl restart chrony.service

sudo ufw allow proto udp from 192.168.0.1/24 to any port 123
sudo ufw allow out 123/udp
sudo ufw allow out 53


# Chrony Commands

chronyc sources -v
chronyc activity
chronyc tracking
chronyc sourcestats -v
sudo chronyc ntpdata

sudo chronyc clients
Code language: JavaScript (javascript)

Additional help:

https://chrony.tuxfamily.org/faq.html

https://ubuntu.com/blog/ubuntu-bionic-using-chrony-to-configure-ntp

https://www.vultr.com/docs/install-an-ntp-server-with-chrony-on-ubuntu-20-04/

https://ubuntu.com/server/docs/security-firewall

Related Posts