Valet is a redeployment notification framework for Portainer
1.2K
Programmatically trigger stack redeploys for Portainer.
Push a new image from CI, hit a webhook, and your Portainer stack is pulling and redeploying within seconds.
Portainer CE has no stack or container webhooks. This means that if you want to re-pull and re-deploy a stack as part of CI, you can't. You have to go into the UI or SSH.
Valet closes that gap. Each stack gets a deploy hook URL. When you want to re-deploy your stack, simply POST to that hook and Valet asks Portainer — via its own API — to update the stack with an image re-pull.
Screenshots coming soon — placeholders live in docs/images/.
If you're already running Portainer, you can deploy Valet as just another stack on it:
In Portainer, go to Stacks → Add stack and name it valet.
You can use this compose definition as a starting point:
services:
valet:
image: rdelorenzo/valet:latest
restart: unless-stopped
ports:
- "3000:3000"
environment:
APP_BASE_URL: https://valet.example.com
AUTH_SECRET: <your-secret-here>
volumes:
- valet-data:/app/data
volumes:
valet-data:
Tip
A ready-made sample lives at [`docker-compose.yml`](docker-compose.yml) in the repo root.
Set the environment variables — either inline above, or under the stack's Environment variables section (Portainer keeps those with the stack):
APP_BASE_URL — your public URL, will be used to compute hook and auth URLs
AUTH_SECRET — generate one with
openssl rand -base64 32
Deploy the stack.
Notes:
Valet talks to Portainer over its API as a client. Deployed on the same host as Portainer, host.docker.internal or a shared network works; for self-signed certs (e.g. Portainer's :9443), enable the instance's insecure TLS option when adding it.
Open the app in a browser. With no login provider configured, it'll send you to the first-time setup flow.
Grab the setup code from the container logs — it's printed there on first use (in Portainer: Containers → valet → Logs, or docker logs valet):
══════════════════════════════════════════
Valet — Initial setup required
Setup code: A1B2C3
══════════════════════════════════════════
Enter the code (it's valid for one hour) and configure your first OIDC auth provider, for example Authentik. The flow will provide you with instructions.
Sign in through that provider. The first account to sign in becomes the admin.
As admin, add your Portainer instances under Instances, then create your first deploy hook (below).
From the dashboard, Create deployment hook and walk through the wizard:
Each hook gets its own secret URL:
https://valet.example.com/api/deploy/<token>
Trigger the hook after your image push, then poll until the deploy finishes. We provide snippets to do this in the most popular CI frameworks.
Store the hook URL as a repository secret (e.g. DEPLOY_WEBHOOK_URL) rather than committing it.
Building a custom integration? See the deploy hook API reference.
Run from source:
git clone https://github.com/rudydelorenzo/valet.git
cd valet
npm ci
npm run dev # http://localhost:3000
| Script | Purpose |
|---|---|
npm run dev | Dev server |
npm run build | Production build |
npm start | Serve the production build |
npm run lint | ESLint |
npm run typecheck | Generate route types + TypeScript check |
Notes for contributors:
drizzle/../data/valet.db on first run (gitignored).sequenceDiagram
participant CI as CI pipeline
participant V as Valet
participant Q as SQLite queue
participant W as Worker
participant P as Portainer CE API
CI->>V: POST /api/deploy/{token}
V->>Q: Enqueue deploy event
V-->>CI: 200 { eventId, statusUrl }
W->>Q: Claim event (poll)
W->>P: GET /api/stacks/{id} + /file
W->>P: PUT /api/stacks/{id}?endpointId=…<br/>compose + env sent back, pullImage: true
P->>P: Pull image, recreate containers
W->>Q: Mark event success/error
CI->>V: GET statusUrl (poll until done)
V-->>CI: queued → running → success
Contributions are welcome.
git checkout -b feature/awesomegit commit -m 'feat: add awesome'git push origin feature/awesome| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router) + React 19 |
| UI | Tailwind CSS 4 + shadcn/ui (Base UI primitives) |
| Database | SQLite via Drizzle ORM + better-sqlite3 (migrations auto-apply at startup) |
| Auth | OpenID Connect with PKCE; sessions are signed JWTs (jose) |
| Validation | Zod — the API contract, types inferred from schemas |
| Orchestration | Portainer CE REST API (X-API-Key access tokens) |
Copyright (C) 2026 rudydelorenzo
Distributed under the GNU General Public License v3.0 (copyleft — derivative works must remain GPL). See LICENSE for details.
Questions or issues? Open a GitHub issue.
docker pull rdelorenzo/valet:latest