Skip to main content

Schedule Automatic Updates

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


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
  1. Open the docker-compose.yml file and add the below code block after the restart attribute in the appsmith service. 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 Upgrade Appsmith Versions 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 
  2. Restart the watchtower container with:

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

    docker-compose logs -f auto_update

Troubleshooting

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

See also