Skip to main content
Configure time synchronization with an external NTP server
Last update:

Configure time synchronization with an external NTP server

In ready images of cloud servers, all necessary settings for NTP are done. Customization is needed if you are preparing your ISO image to work with the cloud platform.

  1. Check the installed utility.
  2. Configure utility.

1. Check the installed utility

  1. Connect to the server via SSH or via console in the control panel.

  2. Check which utility is being used on the server:

    systemctl status ntp
    systemctl status chronyd
    systemctl status systemd-timesyncd

    We recommend using Chrony, but you can customize whichever utility is already installed on the server.

  3. If you want to switch to Chrony, disable and uninstall the systemd-timesyncd and ntpd utilities and install Chrony:

    systemctl disable <name>
    sudo apt remove <name>
    sudo apt-get install chronyd

    Specify <name> is the name of the utility to be removed (ntp or systemd-timesyncd).

2. Customize the utility

  1. Start `Chrony':

    systemctl start chronyd
  2. Open the Chrony configuration file in the vi text editor:

    vi /etc/chrony/chrony.conf
  3. Add or replace the NTP servers in the file. We recommend replacing the servers in the file with Selectel NTP servers, but you can specify any.

    server <domain> iburst

    Specify <domain> — the domain name or address of the pool or server.

    If you need to specify multiple servers, specify each on a separate line, for example:

    server iburst
    server iburst
  4. Exit the vi text editor with the changes saved:

  5. Restart the `Chrony' utility:

    sudo systemctl restart chronyd
  6. Check the list of NTP servers in use:

    chronyc -N sources