---
title: "How to configure NTP and the correct time on a Linux server | StreetHosting"
description: "Set up NTP on a Linux server to keep the clock in sync with time servers. Fix time zone problems, misaligned event logs and SSL certificate errors."
url: "https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server"
type: "page"
language: "en-US"
---

Infrastructure · 3 min · Intermediate

Published on Jun 18, 2026 · Updated on Jun 18, 2026

# Configure NTP and the correct time on a Linux server

A server with the wrong clock causes confusing logs, SSL certificate failures and authentication problems. Here is how to set up NTP with chrony or systemd-timesyncd and pick the right time zone.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Linux administration](https://streethosting.com.br/en/guides/topics/linux)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20configure%20NTP%20and%20the%20correct%20time%20on%20a%20Linux%20server&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server "Share on LinkedIn") [](https://wa.me/?text=How%20to%20configure%20NTP%20and%20the%20correct%20time%20on%20a%20Linux%20server%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fconfigure-ntp-linux-server "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server.md)

In this guide 6 sections

* [Why the time matters](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#por-que-ntp)
* [Check the current time](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar)
* [Set the time zone](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#timezone)
* [NTP with systemd-timesyncd](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#systemd-timesyncd)
* [NTP with chrony (recommended)](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#chrony)
* [Check synchronization](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar-sincronizacao)

Quick answer

Set the time zone with `sudo timedatectl set-timezone America/Sao_Paulo` and install **chrony** for NTP synchronization: `sudo apt install chrony`. Check with `timedatectl status` that it shows "System clock synchronized: yes".

## Why the time matters[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#por-que-ntp)

A server with a misaligned clock causes a chain of problems:

* **Confusing logs**: events show up out of order or with wrong timestamps, which makes debugging harder
* **SSL certificate failures**: certificates are valid for a date range. A wrong clock makes the server reject valid certificates
* **Authentication errors**: protocols like Kerberos and JWT are sensitive to time differences between client and server
* **Wrong cron runs**: scheduled tasks run at the wrong moment
* **Misaligned backups**: backup files with incorrect timestamps

Set up NTP as one of the first steps when you create a new VPS, before installing any application. See the guide on [time zone and locale on a VPS](https://streethosting.com.br/en/guides/vps/set-vps-timezone-brazil).

## Check the current time[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar)

Before changing anything, look at the clock's current state:

* `date`: the server's current time
* `timedatectl status`: detailed sync status
* `cat /etc/timezone`: the configured time zone

## Set the time zone[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#timezone)

To set the server's time zone:

1. List the available time zones: `timedatectl list-timezones | grep America/`
2. Set the Brasília/SP time zone: `sudo timedatectl set-timezone America/Sao_Paulo`
3. Confirm: `timedatectl`

Common time zones in Brazil:

* `America/Sao_Paulo`: Brasília, SP, RJ, MG, RS, PR, SC (UTC-3/UTC-2 during daylight saving time)
* `America/Manaus`: Manaus and AM (UTC-4)
* `America/Belem`: Pará and the north (UTC-3, no daylight saving time)
* `UTC`: recommended for production servers in a professional environment

## NTP with systemd-timesyncd[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#systemd-timesyncd)

Ubuntu 22.04 ships with **systemd-timesyncd** active by default. It already does basic NTP synchronization with nothing to install. To check it and enable it:

1. Check the status: `systemctl status systemd-timesyncd`
2. Enable it if it is not: `sudo systemctl enable --now systemd-timesyncd`
3. Turn on synchronization: `sudo timedatectl set-ntp true`

systemd-timesyncd is enough for most VPS instances and web servers. For servers that need higher accuracy or act as an NTP server for other servers, use chrony.

## NTP with chrony (recommended)[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#chrony)

Chrony is more accurate and robust, especially on virtual machines. To install and configure it:

1. Install it: `sudo apt install chrony -y`
2. Start and enable it: `sudo systemctl enable --now chrony`
3. Check the synchronization: `chronyc tracking`

Installing chrony can conflict with systemd-timesyncd. The chrony installer usually disables timesyncd automatically. If it does not, disable it manually: `sudo systemctl disable systemd-timesyncd`

## Check synchronization[](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar-sincronizacao)

After setting up NTP, confirm that it is working:

* `timedatectl status`: should show "System clock synchronized: yes"
* `chronyc sources`: lists the NTP servers in use (if you are using chrony)
* `chronyc tracking`: shows the offset and the accuracy of the synchronization

An offset under 10ms is considered excellent for most applications. For financial or high-precision applications, aim for sub-millisecond with dedicated NTP servers.

In this guide

* [Why the time matters](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#por-que-ntp)
* [Check the current time](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar)
* [Set the time zone](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#timezone)
* [NTP with systemd-timesyncd](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#systemd-timesyncd)
* [NTP with chrony (recommended)](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#chrony)
* [Check synchronization](https://streethosting.com.br/en/guides/infrastructure/configure-ntp-linux-server#verificar-sincronizacao)

## Frequently asked questions

Which time zone should I use on a server in Brazil?

It depends on your preference. Many administrators set the server to UTC to standardize logs and avoid daylight saving problems. If you need logs in local time, use America/Sao\_Paulo for Brasília and SP, or the time zone that matches your region.

What is NTP?

NTP (Network Time Protocol) is the protocol used to sync a server's clock with accurate time sources on the internet. Without NTP, the server clock drifts gradually, causing errors in logs, authentication and certificates.

What is the difference between chrony and ntpd?

Chrony is more modern and recommended for current servers. It syncs faster, works well on systems that go offline for periods and is more accurate on virtual machines (VMs). The older ntpd suits servers that never go offline.

How do I check whether NTP is synchronized?

Use the 'timedatectl status' command to see the time sync status. If it shows 'NTP service: active' and 'System clock synchronized: yes', the time is being kept correctly.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See dedicated servers Exclusive hardware in São Paulo with NVMe and Anti-DDoS.](https://streethosting.com.br/en/dedicated)

## Related guides

[VPS Beginner How to set the VPS timezone and locale for Brazil Many VPS images ship with another country's timezone and language. That scrambles logs, schedules and reports. Setting the timezone to São Paulo and fixing the locale puts everything on the time you expect. 3 min Read guide](https://streethosting.com.br/en/guides/vps/set-vps-timezone-brazil) [VPS Intermediate How to create a sudo user on a Linux VPS Running as root all the time is risky: one wrong command affects everything. The best practice is to create a regular user with sudo and keep root for when you really need it. 3 min Read guide](https://streethosting.com.br/en/guides/vps/create-sudo-user-linux-vps) [Infrastructure Beginner The 3-2-1 backup strategy for servers The 3-2-1 rule is one of the most reliable ways to reduce data loss after a technical failure or a human mistake. 2 min Read guide](https://streethosting.com.br/en/guides/infrastructure/3-2-1-backup-strategy)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
