Webhooks are neat, but they need your Git host to reach Portainer. At home, behind a router, that’s not always something I want to open up. Portainer has a second way that works the other direction.
When you deploy a stack from a Git repository, there’s a GitOps updates toggle. Switch it on and you choose a mechanism: Polling or Webhook.
- Webhook gives you a URL that your Git host calls to trigger an update on demand.
- Polling makes Portainer check the repository on its own, at the Fetch interval you set.
Polling is the one that works with no inbound connection at all, because Portainer is the one reaching out. For a Portainer server that is only reachable on your own network, that is the simple option.
Two settings change what happens when a check finds something. Re-pull image always pulls the newest version of the container images on an update, like --pull=always for docker run. Force redeployment redeploys at every interval, even without a change in Git, and it overwrites local changes. When it is off, an update only happens when Portainer sees a change in the remote repository.
The caveat is the delay. A webhook reacts at once, while polling reacts at the next check, so a short interval gives you speed and a long one gives your Git host less traffic. The Portainer docs don’t give a default, so look at what the field shows on your version.
Further reading: Portainer: add a stack from Git