---
title: How to Set the Timezone and Configure NTP on Rocky Linux
url: https://docs.vultr.com/how-to-set-the-timezone-and-configure-ntp-on-rocky-linux
description: Learn how to properly set the timezone and configure Network Time Protocol (NTP) on Rocky Linux to ensure accurate system time synchronization for your server.
publish_date: 2022-05-03T00:00:00Z
last_updated: 2025-04-01T00:00:00Z
header_image: https://docs.vultr.com/public/doc-assets/1305/fcb5972cc352da81.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

## Introduction

Accurate time is essential for any production server and the Network Time Protocol (NTP) is the standard way to keep the system clocks synchronized to accurate sources. NTP uses [the intersection algorithm](https://en.wikipedia.org/wiki/Network_Time_Protocol) to mitigate the effects of variable network latency and keep your system clock within a few milliseconds of Coordinated Universal Time (UTC). Linux systems typically keep the time in UTC, but you can also set the timezone to your local timezone. This article explains how to set the timezone on an Ubuntu Linux cloud server and use NTP to synchronize the time.

## Prerequisites

* [Launch a Rocky Linux Server Instance on Vultr.](https://www.vultr.com/servers/rocky-linux)
* Use SSH to access the server as a non-root user with sudo rights.
* [Update the server.](https://docs.vultr.com/how-to-update-a-vultr-cloud-server#how-to-update-almalinux-centos-rocky-linux-and-vzlinux)

## Set the Timezone

To check your current timezone, [log in to your server](https://docs.vultr.com/how-to-use-ssh-with-vultr-servers/) and display the date and time.

    $ timedatectl

You'll see output similar to this:

    Local time: Sat 2022-04-02 00:44:18 UTC
    Universal time: Sat 2022-04-02 00:44:18 UTC
    RTC time: Sat 2022-04-02 00:44:17
    Time zone: UTC (UTC, +0000)
    System clock synchronized: yes
    NTP service: active
    RTC in local TZ: no

By default, a Vultr Rocky Linux server uses the UTC timezone, which is usually preferable if you manage servers in different locations. However, you can set the server to your local timezone by following these steps.

1. View a list of all timezones.

        $ timedatectl list-timezones

    Select your desired timezone and take note of the exact name and capitalization. You can use :key_space: and :key_b: to page forward and backward or your arrow keys to move one line at a time through the list. When finished, type :key_q: to exit the list.

    For this example, choose **Antarctica/South_Pole**.

2. Set the timezone with `timedatectl`.

        $ sudo timedatectl set-timezone Antarctica/South_Pole

    Verify the timezone by viewing `/etc/timezone`.

        $ cat /etc/timezone
        Antarctica/South_Pole

3. Check the time to verify the changes.

        $ date
        Sat 02 Apr 2022 04:22:00 AM NZST

    Notice the timezone now shows NZST, indicating the time at the South Pole.

If you decide to return to UTC later, run `timedatectl` again with the UTC timezone.

    $ sudo timedatectl set-timezone Etc/UTC

## Use NTP to Synchronize the Time

Vultr's Rocky Linux systems have the `timesyncd` service enabled by default to synchronize their time with an NTP server. You can verify this by running `timedatectl`.

    $ timedatectl status
                   Local time: Sat 2022-04-09 04:23:00 NZST
               Universal time: Fri 2022-04-08 16:23:00 UTC
                     RTC time: Fri 2022-04-08 16:23:00
                    Time zone: Antarctica/South_Pole (NZST, +1200)
    System clock synchronized: yes
                  NTP service: active
              RTC in local TZ: no

The **System clock synchronized: yes** and **NTP service: active** lines confirm that the system clock has synchronized with an NTP server. If you see these, you can proceed to the next section. Otherwise, start the service with `timedatectl`. Again, you need to be the root user or use sudo.

    $ sudo timedatectl set-ntp on

Wait a few minutes for the `timesyncd` service to start, then verify the status.

    $ timedatectl status

## Advanced NTP Configuration

Vultr configures new servers with **constant.com** NTP servers, which are low-latency servers on Vultr's network infrastructure. You can examine the configuration by viewing `chrony.conf`.

    $ cat /etc/chrony.conf

You'll see the default NTP servers:

        server 1.time.constant.com iburst
        server 2.time.constant.com iburst
        server 3.time.constant.com iburst

If you need to use specific NTP servers:

1. Edit the Chrony configuration file.

        $ sudo nano /etc/chrony.conf

    Change them according to your needs. You'll find public name servers listed on the [NTP support website.](https://support.ntp.org/bin/view/Servers/NTPPoolServers). For example, if you want to sync with the public UK pool, you can use the following values:

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

1. Restart the Chrony NTP daemon to load changes.

        $ sudo systemctl restart chronyd

1. Verify the new NTP pools.

        $ chronyc sources

1. Confirm the NTP synchronization status.

        $ chronyc tracking

## Optional: Setup an NTP Server

**Most users do not need to set up an NTP server.** However, in some situations, you may want to offer NTP service, perhaps to a [Virtual Private Cloud (VPC)](https://docs.vultr.com/how-to-create-a-vultr-virtual-private-cloud-vpc/). If you know that you need an NTP server, follow these steps.

To accept client requests to the server:

1. Edit the main Chrony configuration file.

        $ sudo nano /etc/chrony.conf

1. Add a line to allow requests from the desired network interface, such as a VPC network address.

        allow 10.0.0.0/24

    > To allow connections from all interfaces, use the `Allow 0.0.0.0/0` directive.

1. Save and close the file.

1. Restart Chrony to load changes.

        $ sudo systemctl restart chronyd

1. To accept incoming client requests, allow the NTP service through the firewall.

        $ sudo firewall-cmd --permanent --add-service=ntp

1. Restart the Firewall.

        $ sudo firewall-cmd --reload

On each client that should receive time from your NTP server:

1. Edit the configuration file.

        $ sudo nano /etc/chrony.conf

1. Add a line specifying your NTP time server's IP address. For example:

        Server 10.0.0.1

1. Restart the Chrony NTP daemon to load changes.

        $ sudo systemctl restart chronyd

1. Show available NTP sources:

        $ chronyc sources

1. Verify the NTP synchronization status.

        $ chronyc tracking

    Output:

        Reference ID    : 4622FB9A (10.0.0.1.vultrusercontent.com)
        Stratum         : 5
        Ref time (UTC)  : Fri Apr 08 00:18:17 2022
        System time     : 0.000303299 seconds fast of NTP time
        Last offset     : +0.000142631 seconds
        RMS offset      : 0.000152918 seconds
        Frequency       : 6.807 ppm slow
        Residual freq   : +0.007 ppm
        Skew            : 0.219 ppm
        Root delay      : 0.048402909 seconds
        Root dispersion : 0.011339894 seconds
        Update interval : 64.1 seconds
        Leap status     : Normal

1. From your NTP server, confirm the clients have connected by running the following command:

        $ chronyc clients

    Output:

        Hostname                      NTP   Drop Int IntL Last     Cmd   Drop Int  Last
        ===============================================================================
        10.0.0.1.vultruser>            2      0   6   -     8       0      0   -     -

## Conclusion

You have set up the timezone and configured NTP on Rocky Linux. For more information, please see these resources:

* [Chrony NTP Daemon Documentation](https://chrony.tuxfamily.org/doc/3.1/chronyc.html)
* [List of Time Zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
