Fixing Incorrect System Time on VPS using Chrony

Is your VPS showing the wrong time/clock? Are you experiencing issues with time sync on your VPS? This guide will help you understand why this happens and how to fix it using a tool called Chrony. Instead of messing around with different ntp servers or worrying about putting ntpdate on a cron job, you should consider the modern alternative which is Chrony.

What could cause a VPS's clock to go out of sync, anyway?

Time synchronization issues on a VPS can stem from various sources and can be quite complex. One common cause is the lack of proper time synchronization tools. Without these tools, your system has no way to automatically adjust its clock, leading to gradual drift over time.

Incorrect timezone settings can also play a role. If your VPS is configured with the wrong timezone, it may appear to be out of sync even if the underlying time is correct. Additionally, software conflicts can sometimes interfere with the system's ability to maintain accurate time. For instance, certain applications or scripts might inadvertently modify the system time or block time update processes.

Another factor to consider is the use of outdated or misconfigured NTP (Network Time Protocol) servers. If your system is relying on unreliable or no longer functional NTP servers, it won't be able to synchronize its time correctly.

It's important to note that these are just a few common examples. The reality is that time synchronization issues can arise from any number of reasons, and over time, these issues can compound, leading to some time discrepancies. This can have a cascading effect on various applications and services running on your VPS, potentially causing problems with everything from scheduled tasks to SSL certificate validation.

Understanding these potential causes is the first step in maintaining accurate time on your VPS. In this tutorial, we'll introduce you to Chrony, a powerful, yet simple to use tool for addressing these synchronization challenges.

What is Chrony?

Chrony is a versatile software tool for maintaining accurate time synchronization on computer systems. It's designed to work well in a variety of conditions, including intermittent network connections and rapidly changing clock frequencies, making it ideal for virtual environments.

Why is Chrony More Reliable Than ntp/ntpdate?

While ntp/ntpdate has been a popular choice for time synchronization, Chrony offers several advantages:

1. Continuous adjustments: Chrony makes small, frequent adjustments to keep the system time accurate, rather than making large, periodic jumps.
2. Improved accuracy: Chrony can achieve better time accuracy, often to within a few microseconds.
3. Resilience to network issues: Chrony handles varying network latency and intermittent connections more effectively.
4. Lower resource usage: Chrony is generally more efficient in terms of system resources and network bandwidth.

How to Install and Configure Chrony

For RHEL-based Systems (CentOS, AlmaLinux, RockyLinux):

1. First, check your current system time:

date

2. Install Chrony:

sudo yum install chrony -y

3. Start and enable the Chrony service:

sudo systemctl start chronyd
sudo systemctl enable chronyd

4. Verify the time has been corrected:

date

5. (Optional) View the current time synchronization status:

chronyc tracking

6. (Optional) See the time sources Chrony is using:

chronyc sources

For Debian-based Systems (Ubuntu, Debian)

1. Check your current system time:

date

2. Install Chrony:

sudo apt-get update
sudo apt-get install chrony -y

3. Start and enable the Chrony service:

sudo systemctl start chronyd
sudo systemctl enable chronyd

4. Verify the time has been corrected:

date

5. (Optional) View the current time synchronization status:

chronyc tracking

6. (Optional) See the time sources Chrony is using:

chronyc sources

By implementing Chrony on your VPS, you can ensure that your system maintains accurate time synchronization. This is crucial for many applications and services that rely on precise timekeeping. Chrony is a great and modern alternative to ntpdate.

  • system time, vps time, chrony, ntpdate, ntp server, ntp, ntpdate server, how to sync time vps, vps timezone, server timezone, server time sync, server clock, vps clock
  • 0 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

Can I request to install Windows Operating System?

Windows is only able to run on our Windows VPS plans, which you can view here:...

Difference between Mb/s and MB/s

In this video, we go over the differences between Megabits per second (Mb/s) and Megabytes per...

Does RackNerd VPS support Custom ISO?

Yes, we can mount a custom Linux ISO of your choice to your KVM VPS service with us. There is no...

How do I use my new VPS?

So you just ordered a new VPS and want to know how to get started with using it? In this video...

How to Boot Your VPS to Rescue Mode

What is rescue mode used for? Rescue mode is useful if for example you may have a corrupt kernel,...