Setting your server’s clock and timezone properly is essential in ensuring the healthy operation of distributed systems and maintaining accurate log timestamps. This tutorial will show you how to configure NTP time synchronization and set the timezone on an Ubuntu 14.04 server.
A more detailed version of this tutorial, with better explanations of each step, can be found here.
- timedatectl list-timezones
Be sure to replace desired_timezone with the timezone you selected from the list:
- sudo timedatectl set-timezone desired_timezone
For example, to set the timezone to New York use this command:
- sudo timedatectl set-timezone America/New_York
- timedatectl
Example output: Local time: Fri 2016-03-25 12:00:43 EDT
Universal time: Fri 2016-03-25 16:00:43 UTC
Timezone: America/New_York (EDT, -0400)
. . .
- sudo apt-get update
- sudo apt-get install ntp
Once the NTP package installation is completed, your server will have NTP synchronization enabled!
Here is a link to a more detailed tutorial that is related to this guide:
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
Software Engineer @ DigitalOcean. Former Señor Technical Writer (I no longer update articles or respond to comments). Expertise in areas including Ubuntu, PostgreSQL, MySQL, and more.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.