Skip to main content

Set the time on your Debian/Ubuntu VPS

This guide explains how to properly configure the timezone and time synchronization on your Debian/Ubuntu VPS.

Hostmyservers has its own NTP server, it is highly recommended to configure it to synchronize your VPS time.

Prerequisites

  • SSH access to your VPS
  • Administration rights (sudo)

Configuration steps

  1. Connect to your VPS via SSH.

  2. Open the NTP configuration file:

    sudo nano /etc/systemd/timesyncd.conf
  3. Modify the #NTP= line to:

    NTP=ntp.infra.hostmyservers.fr
  4. Save the file:

    • Press Ctrl + X
    • Then O to confirm
    • Press Enter
  5. Restart the synchronization service:

    sudo systemctl restart systemd-timesyncd
  6. Verify that synchronization is active:

    timedatectl status

Verification

To check the current time, use the command:

timedatectl status

Troubleshooting

If you encounter difficulties, make sure that:

  • The timesyncd service is active
  • Your VPS can access the NTP server
  • You have sufficient rights to modify the configuration