{"id":22039489,"url":"https://github.com/mpolinowski/nomad-nts-chrony","last_synced_at":"2026-05-02T14:49:09.265Z","repository":{"id":111484018,"uuid":"540378377","full_name":"mpolinowski/nomad-nts-chrony","owner":"mpolinowski","description":"Deploy a Chrony NTS Timeserver with Hashicorp Nomad","archived":false,"fork":false,"pushed_at":"2022-09-23T09:57:03.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T19:17:40.127Z","etag":null,"topics":["chrony","hashicorp-consul","hashicorp-nomad","ntp-server","nts-server"],"latest_commit_sha":null,"homepage":"https://mpolinowski.github.io/docs/DevOps/Hashicorp/2022-09-22--nomad-nts-timeserver/2022-09-22","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-23T09:57:00.000Z","updated_at":"2024-02-19T17:06:32.000Z","dependencies_parsed_at":"2023-06-06T16:00:55.631Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/nomad-nts-chrony","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-nts-chrony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-nts-chrony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-nts-chrony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-nts-chrony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/nomad-nts-chrony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104529,"owners_count":20561380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrony","hashicorp-consul","hashicorp-nomad","ntp-server","nts-server"],"created_at":"2024-11-30T11:10:59.625Z","updated_at":"2026-05-02T14:49:09.228Z","avatar_url":"https://github.com/mpolinowski.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrony NTS with Hashicorp Nomad\n\nChrony Timeserver with NTS support.\n\n\n\u003e This repository is based on [docker-ntp](https://github.com/mpolinowski/docker-ntp) by [Chris Turra](https://github.com/cturra) but uses Hashicorp Nomad instead of Docker Compose to deploy the secure timeserver.\n\n\n\u003c!-- TOC --\u003e\n\n- [Chrony NTS with Hashicorp Nomad](#chrony-nts-with-hashicorp-nomad)\n  - [Clone the Repository](#clone-the-repository)\n  - [Build the Docker Image](#build-the-docker-image)\n  - [Create Certificates](#create-certificates)\n  - [Run the Container (Docker Compose)](#run-the-container-docker-compose)\n    - [Running \\\u0026 Testing](#running--testing)\n    - [Container Logs](#container-logs)\n      - [NTP Service](#ntp-service)\n      - [NTS Service](#nts-service)\n  - [Run the Container (Nomad)](#run-the-container-nomad)\n\n\u003c!-- /TOC --\u003e\n\n\n## Clone the Repository\n\n```bash\ngit clone https://github.com/mpolinowski/nomad-nts-chrony\n```\n\n\u003e __Note__: The `docker-compose` file expects the repository to be in `/opt/chrony-nts`.\n\n\n\n## Build the Docker Image\n\nRun the build script (you need to have docker installed):\n\n```bash\n./build.sh\n```\n\n\n## Create Certificates\n\nRun `certbot` to create the TLS certificate for your domain:\n\n\n```bash\napt install certbot python3-certbot-nginx\ncertbot certonly --standalone\n```\n\n\n## Run the Container (Docker Compose)\n\nUse Docker Compose to run the container and mount/bind the TLS certificate:\n\n\n```yml\nversion: '3.9'\n\nservices:\n  chrony:\n    build: .\n    image: cturra/ntp:latest\n    container_name: chrony\n    restart: unless-stopped\n    volumes:\n      - type: bind\n        source: /etc/letsencrypt/live/my.server.domain/fullchain.pem\n        target: /opt/fullchain.pem\n      - type: bind\n        source: /etc/letsencrypt/live/my.server.domain/privkey.pem\n        target: /opt/privkey.pem\n    ports:\n      - 123:123/udp\n      - 4460:4460/tcp\n    environment:\n      - NTP_SERVERS=0.de.pool.ntp.org,time.cloudflare.com,time1.google.com\n      - LOG_LEVEL=1\n```\n\n\n* __NTP_SERVERS__: Upstream NTP server to use.\n* __LOG_LEVEL__: Levels can to specified: 0 (informational), 1 (warning), 2 (non-fatal error), and 3 (fatal error).\n\n\n\n### Running \u0026 Testing\n\nTest if the server is working:\n\n\n### Container Logs\n\n```bash\ndocker compose up -d chrony\ndocker compose logs chrony\n```\n\n\n#### NTP Service\n\n```bash\napt install sntp\nsntp time.instar.com\n```\n\n```bash\ndocker exec chrony chronyc tracking\ndocker exec chrony chronyc sources\ndocker exec chrony chronyc sourcestats\n```\n\n\n#### NTS Service\n\n```bash\ndocker exec -ti chrony chronyd -Q -t 3 'server my.server.com iburst nts maxsamples 1'\ndocker exec -ti chrony chronyc serverstats\n```\n\nCheck `NTS-KE connections accepted` and `Authenticated NTP packets`:\n\n\n```bash\nNTP packets received       : 3\nNTP packets dropped        : 0\nCommand packets received   : 27\nCommand packets dropped    : 0\nClient log records dropped : 0\nNTS-KE connections accepted: 1\nNTS-KE connections dropped : 0\nAuthenticated NTP packets  : 1\nInterleaved NTP packets    : 0\nNTP timestamps held        : 0\nNTP timestamp span         : 0\n```\n\n\n\n## Run the Container (Nomad)\n\n[./chrony_nts.nomad](https://mpolinowski.github.io/docs/DevOps/Hashicorp/2022-09-22--nomad-nts-timeserver/2022-09-22)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fnomad-nts-chrony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fnomad-nts-chrony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fnomad-nts-chrony/lists"}