Skip to main content

Schedule Automatic Updates

This page provides steps to schedule automatic updates using cron expression for your self-hosted instance.

Docker

Follow the below steps to schedule automatic updates for Appsmith Docker installation:

  1. Go to the root directory of the Appsmith installation and run:

    docker-compose down
  2. Open the docker-compose.yml file and uncomment the below code block. Note that you must add a 6 space-separated fields cron expression, not the traditional 5 space-separated fields to the command attribute. See the CRON Expression Format section to learn more. Based on the specified cron expression, watchtower updates Appsmith at the stipulated time whenever a new version becomes available.

     labels:
    com.centurylinklabs.watchtower.enable: "true"
    auto_update:
    image: containrrr/watchtower
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    # Update check interval in seconds.
    command: --schedule "0 0 * ? * *" --label-enable --cleanup
    restart: unless-stopped
    depends_on:
    - appsmith
    environment:
    - WATCHTOWER_LIFECYCLE_HOOKS=true

    The above 6 space-separated fields cron expression 0 0 * ? * * means that the task runs every day of every month, regardless of the day of the week or year, at midnight (0:00). You can change the schedule, adjust the cron expression accordingly. If you wish to update Appsmith immediately, you can opt for a manual update and follow the steps in the Update Appsmith guide.

    Below are some examples of 6 space-separated fields cron expressions:

    • Check for updates every Sunday at 12:00 noon:

      command: --schedule "0 0 12 ? * SUN" --label-enable --cleanup
    • Check for updates every hour:

      command: --schedule "0 0 * ? * *" --label-enable --cleanup
    • Check for updates once at 12:00 noon every day:

      command: --schedule "0 0 12 * * ?" --label-enable --cleanup 
    • Check for updates once at midnight every day:

      command: --schedule "0 0 0 * * ?" --label-enable --cleanup 
  3. Restart the watchtower container with:

    sudo docker-compose pull && sudo docker-compose up --force-recreate auto_update
  4. Verify the logs that the scheduled update is in effect with:

    docker-compose logs -f auto_update

Kubernetes

Follow the below steps to schedule automatic updates for Appsmith Kubernetes installation:

  1. Go to the root directory of the Appsmith installation and open values.yaml file.

  2. Update the values.yaml and set enabled to true for autoupdate attribute, and set the desired cron expression in the scheduler attribute. Note that you must add a 5 space-separated fields cron expression, not the 6 space-separated fields. See the CRON Expression Format section to learn more. Based on the specified cron expression, watchtower updates Appsmith at stipulated time whenever a new version is available.

    autoupdate:
    ## @param autoupdate.enabled - Enable config autoupdate
    ##
    enabled: true
    ## @param autoupdate.scheduler - Schedule cron job to check & update Helm image
    ##
    scheduler: "0/10 * * * *"

    The above 5 space-separated fields cron expression 0/10 * * * * means that the task runs every day of the week and every month, regardless of the year, at the 0th minute of every hour. You can change the schedule, adjust the cron expression accordingly. If you wish to update Appsmith immediately, you can opt for a manual update and follow the steps in the Update Appsmith guide.

    Below are some examples of 5 space-separated fields cron expressions:

    • Check for updates every Sunday at 12:00 noon:

      scheduler: 0 12 * * SUN
    • Check for updates every hour:

      scheduler: 0 * * * *
    • Check for updates once at 12:00 noon every day:

      scheduler: 0 12 * * *
    • Check for updates once at midnight every day:

      scheduler: 0 0 * * * 
  3. Save the changes and update the Appsmith installation.

    • If you are on the Community Edition, update with:

      helm upgrade -i appsmith appsmith/appsmith -f values.yaml
    • If you are on the Business Edition, update with:

      helm upgrade -i appsmith appsmith-ee/appsmith -f values.yaml

Switch off automatic updates

Follow the below steps for your Appsmith installation to switch off automatic updates:

Docker

  1. Go to the root directory of the Appsmith installation and run:

    docker-compose down
  2. Open the docker-compose.yml file and comment out the below code block:

    #auto_update:
    # image: containrrr/watchtower
    # volumes:
    # - /var/run/docker.sock:/var/run/docker.sock
    # # Update check interval in seconds.
    # command: --schedule "0 0 * ? * *" --label-enable --cleanup
    # restart: unless-stopped
    # depends_on:
    # - appsmith
    # environment:
    # - WATCHTOWER_LIFECYCLE_HOOKS=true
  3. Save the changes and restart the Appsmith instance with:

    docker-compose up -d --force-recreate
  4. Verify that the automatic update is turned off with:

    docker-compose ps

Kubernetes

Follow the steps below to turn off auto updates:

  • If you are on the Community Edition on Kubernetes, update the configuration as shown below:

    a. Go to the Appsmith installation directory, and edit values.yaml, and set enabled to false for autoupdate attribute:

    autoupdate:
    ## @param autoupdate.enabled - Enable config autoupdate
    ##
    enabled: false
    ## @param autoupdate.scheduler - Schedule cron job to check & update Helm image
    ##
    scheduler: "0 * * * *"

    b. Save the changes and update the configuration with:

      helm upgrade --values values.yaml appsmith appsmith/appsmith
  • If you are on the Business Edition on Kubernetes, update the configuration as shown below:

    a. Go to the Appsmith installation directory, and edit values.yaml, and set enabled to false for autoupdate attribute:

    autoupdate:
    ## @param autoupdate.enabled - Enable config autoupdate
    ##
    enabled: false

    b. Save the changes and update the configuration with:

    helm upgrade --values values.yaml appsmith appsmith-ee/appsmith

Troubleshooting

If you face issues, contact the support team using the chat widget at the bottom right of this page.