I recently set up the Stripe CLI on a Debian machine using Docker for local development and webhook testing. Here’s how it went:
1. Installation & Login
- Used the official Docker image: stripe/stripe-cli
- Persisted config with volume: -v stripe-config:/root/.config/stripe
- Logged in using stripe login –interactive with a standard sk_test_ key
2. Key Commands That Worked
- stripe version → Confirmed 1.40.9
- stripe logs tail → Real-time API logs
- stripe listen –forward-to http://localhost:3000/webhook → Local webhook forwarding
- stripe trigger payment_intent.succeeded → Successfully triggered test events
3. Pro Tips I Learned
- Always use a volume mount for config persistence
- Prefer standard sk_test_ keys initially (restricted keys need full permissions)
- Create an alias for convenience:Bash
alias stripe="docker run --rm -it -v stripe-config:/root/.config/stripe stripe/stripe-cli"
The setup is now rock-solid for local Stripe development.