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

Configure time synchronization with an external NTP server

In the OS images that Selectel provides for the dedicated servers, all the necessary settings for NTP executed. Customization is required if you are installing the OS from your image.

  1. Check the installed utility.
  2. Customize the utility.

Check the installed utility

  1. Connect to the server via SSH or through KVM console.

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

    systemctl status ntp
    systemctl status chronyd
    systemctl status systemd-timesyncd

    We recommend the use of ChronyBut you can customize the utility that is already installed on the server.

  3. If you want to go to Chronydisable and uninstall the utilities systemd-timesyncd and ntpd and set Chrony:

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

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

Customize the utility

  1. Run Chrony:

    systemctl start chronyd
  2. Open the configuration file Chrony word processing vi:

    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 available NTP servers.

    server <domain> iburst

    Specify <domain> — 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 0.spb.ntp.selectel.ru iburst
    server 1.spb.ntp.selectel.ru iburst
  4. Exit the text editor vi with the changes intact:

    :wq
  5. Restart the utility Chrony:

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

    chronyc -N sources