# Dietpi as local NTP server

**URL:** <https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868>\
**Category:** Troubleshooting\
**Created:** [12 January 2026 22:11 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868 "2026-01-12T22:11:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duser](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@duser](https://dietpi.com/forum/u/duser)\
**Post date:** [12 January 2026 22:11 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868/1 "2026-01-12T22:11:21Z")

</div>

I have a Raspberry Pi that only occasionally gets Internet via the router. I want the Pi to run an NTP daemon and act as the primary time source for devices on the local network. When the Pi has Internet access it should use public NTP servers as references; if the Internet is unavailable it should continue serving time to the LAN using its battery‑backed RTC.  
(does dietpi save to PI5s onboard clock?)

How to configure the Pi as the LAN’s NTP server so other devices can sync to it.

Use Internet NTP servers when online, but remain the authoritative local source when offline.

Can anybod recommend a configuration for this scenario? Thanks.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [13 January 2026 00:23 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868/2 "2026-01-13T00:23:22Z")

</div>

You can do this with `ntp` (and disabling `systemd-timesyncd`) and a cronjob/systemd-timer to check network connectivity and then writing to hw clock with `hwclock` command, or you can just use [`chrony`](https://chrony-project.org/), which handles all of this in one piece of software . It’s ntp-client, ntp-server and handles multiply clock sources with fallbacks etc. pp.

A config for chrony could be

```auto
# internet NTP
pool pool.ntp.org iburst maxsources 4

# RTC as base on boot
rtcsync
rtcfile /var/lib/chrony/rtc

# offline fallback
local stratum 10

# allow LAN clients
allow 192.168.1.0/24

# drift file
driftfile /var/lib/chrony/drift

# time correction if necessary
makestep 1.0 3

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [13 January 2026 10:42 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868/3 "2026-01-13T10:42:54Z")

</div>

basically every guide on the web for running NTP server on Debian and/or RPI SBC should work

---

<div class="post-metadata">

**Author:** ![duser](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@duser](https://dietpi.com/forum/u/duser)\
**Post date:** [13 January 2026 22:43 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868/4 "2026-01-13T22:43:12Z")

</div>

tnx,

Are there any problems to be expected with the integrated NTP or configs?

Can I just use apt install chrony, systemctl disable systemd-timesyncd and

use the above config without braking something?

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [11 July 2026 10:43 UTC](https://dietpi.com/forum/t/dietpi-as-local-ntp-server/24868/5 "2026-07-11T10:43:29Z")

</div>

Closed on 11 July 2026 10:43 UTC

This topic was automatically closed 178 days after the last reply. New replies are no longer allowed.
