If you're building Drupal sites with Lando and PhpStorm, you've probably typed lando drush cr
more times than you'd care to count. What if you could just... click a button?
In this guide, I’ll show you how to add one-click Drush commands directly to your PhpStorm toolbar. It’s surprisingly easy—and a massive time-saver.
What You’ll Need
- A Drupal site using Lando (Docker-based local dev)
- PhpStorm
- Drush installed in your project (
/vendor/bin/drush
) - Lando working from terminal
Step 1: Confirm Drush Works with Lando
lando drush status
You should see something like this:
Drush version : 13.x
Drupal root : /app/web
Step 2: Find the Lando Executable
Get-Command lando
This will output something like:
C:\Users\YourName\.lando\bin\lando.cmd
Step 3: Add a Drush Button in PhpStorm
- Go to File > Settings > Tools > External Tools
- Click the ➕ to add a new tool
- Use the following settings:
- Name:
Drush: Cache Rebuild
- Program:
C:\Users\YourName\.lando\bin\lando.cmd
- Arguments:
drush cr
- Working Directory:
C:\Path\To\Your\Project
Step 4: Add It to Your Toolbar
- Go to Settings > Appearance & Behaviour > Menus and Toolbars
- Expand
Main Toolbar > Main Toolbar Left
- Right-click → Add Action… → select
Drush: Cache Rebuild
- Click OK and Apply
You’ll now see a button at the top of PhpStorm!
Bonus: Add More Drush Tools
Here are a few more to consider:
Name | Arguments |
---|---|
Drush: Config Import | drush cim |
Drush: SQL Dump | drush sql-dump --result-file=../db.sql |
Drush: Login Link | drush uli |
Why This Matters
Little tweaks like this can shave minutes off every hour. When you’re running a solo dev setup or juggling multiple sites, efficiency like this adds up fast.
You’ll spend less time typing the same things and more time building what matters.
Gotchas to Avoid
- If PhpStorm says it “can’t find lando”, make sure you use the full
.cmd
path. - Restart PhpStorm after editing environment variables.
- Use
$ProjectFileDir$
for dynamic working directory paths if templating.
Final Thoughts
This tiny tweak made my dev life better. Try it. Share it. And if you want a downloadable PhpStorm External Tools export file, drop me a message.
Tags: Drupal 11, PhpStorm, Lando, Drush, Workflow Tips