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
-
Connect to your VPS via SSH.
-
Open the NTP configuration file:
sudo nano /etc/systemd/timesyncd.conf -
Modify the
#NTP=line to:NTP=ntp.infra.hostmyservers.fr -
Save the file:
- Press
Ctrl + X - Then
Oto confirm - Press
Enter
- Press
-
Restart the synchronization service:
sudo systemctl restart systemd-timesyncd -
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