selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

swarm-cronjob logo

Self-host swarm-cronjob

v1.16.1

Cron-style job scheduler for Docker Swarm clusters

ReleaseOpen SourceMIT
Updated7 hours ago
LanguageGo
Setup difficultyEasy
Stars
888
Requires
Docker Swarm
Docker
crazymax/swarm-cronjob
Install with Docker

What is swarm-cronjob?

swarm-cronjob is an open-source scheduler that brings cron-style recurring jobs to a Docker Swarm cluster. Instead of running a separate cron daemon, you label Swarm services with swarm.cronjob.enable and swarm.cronjob.schedule, and the tool polls the Docker API to launch each job on time. It picks up newly deployed or modified services on its own, can skip a run when the target service is still busy, and honors a global time zone plus per-schedule CRON_TZ overrides. Replicated services (deployed at zero replicas) and global-mode services are both schedulable. Self-hosting is straightforward: deploy the container pinned to a manager node with the Docker socket mounted, or grab the binary and run it, optionally as a systemd unit on Debian-based distributions. There is no web UI; configuration is driven entirely by service labels, environment variables and CLI flags. Licensed under MIT.

Should you self-host swarm-cronjob?

swarm-cronjob scores 51/100 on selfhost.directory (how scoring works) and ranks #20 of 26 in Automation. It has 888 GitHub stars.

It shipped 3 stable releases in the past year. The latest, v1.16.1, came out on 24 October 2026. New versions land roughly every 5 months.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Node RED (81/100, 23 790 stars). It scores higher overall, so compare the two before you pick. See swarm-cronjob vs Node RED side by side.

Features

  • Automatic service discovery
  • Configurable time zone
  • Cron-style scheduling
  • Global-mode service support
  • Label-based Configuration
  • Overlap control

swarm-cronjob README

How to install swarm-cronjob

Install swarm-cronjob with Docker

Docker Swarm
Environment variables
TZ, LOG_LEVEL, LOG_JSON
services:
  swarm-cronjob:
    image: crazymax/swarm-cronjob
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - "TZ=Europe/Paris"
      - "LOG_LEVEL=info"
      - "LOG_JSON=false"
    deploy:
      placement:
        constraints:
          - node.role == manager

Edit this example with your preferences and deploy the stack:

docker stack deploy -c swarm_cronjob.yml swarm_cronjob

Or via `docker service create` with the Docker socket mounted and a manager-node constraint.

How to configure swarm-cronjob

  • LOG_JSONfalseEnable JSON logging output

    Enable JSON logging output

  • LOG_LEVELinfoLog level

    Log level

  • swarm.cronjob.enableSet to `true` to enable scheduling for the service. required

    Set to `true` to enable scheduling for the service. required

  • swarm.cronjob.query-registryWhether the service update requires contacting a registry.

    Whether the service update requires contacting a registry.

  • swarm.cronjob.registry-authfalseSend registry authentication details to Swarm agents.

    Send registry authentication details to Swarm agents.

  • swarm.cronjob.replicas1Number of replicas to set for a scheduled run in `replicated` mode.

    Number of replicas to set for a scheduled run in `replicated` mode.

  • swarm.cronjob.scheduleCron expression format to use. required

    Cron expression format to use. required

  • swarm.cronjob.skip-runningfalseDo not start a new job if the service is already running.

    Do not start a new job if the service is already running.

  • TZTime zone used for all schedule interpretation and scheduling.

    Time zone used for all schedule interpretation and scheduling.

swarm-cronjob releases & version history

FAQ

Which time zone is used to interpret cron schedules?

By default scheduling follows the local time zone set through the TZ environment variable, and an individual schedule can override it by prefixing the spec with something like CRON_TZ=Asia/Tokyo.

More in Containers

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…