Lando Local Development¶
Table of Contents¶
Overview¶
Lando is a local development tool that allows developers to easily spin up local development environments for WordPress and other applications.
Benefits: - Quick setup of local development environments - Consistent development environments across team - Built on Docker (but easier to use) - Includes common tools (WP-CLI, Composer, Node, etc.) - SSL certificates out of the box
Official documentation: lando.dev
Installation¶
Recommended: DMG Installer¶
Step 1: Download Lando
Download the latest .dmg package from GitHub Releases
Warning
Choose the correct DMG for your chip architecture:
- Apple Silicon (M1/M2/M3): Download the arm64 version
- Intel Macs: Download the x64 version
Not sure which chip you have? See: Which Chipset Do I Have?
Step 2: Install
- Open the downloaded
.dmgfile - Double-click the
LandoInstaller.pkgfile - Follow the installation steps
- Enter your username or password when prompted
Alternative: Homebrew¶
If you prefer Homebrew:
Note: If you don't have Homebrew installed, see: Homebrew Installation
Verify Installation¶
You should see the Lando version number.
Configuration¶
Project Setup¶
Every Lando project requires a .lando.yml configuration file in the project root.
Basic Configuration¶
File: /site/.lando.yml
# Project name (will be accessible at projectname.lndo.site)
name: hetccv
# Recipe (WordPress, Drupal, Laravel, etc.)
recipe: wordpress
# Configuration
config:
# PHP version
php: "8.2"
# Web server (nginx or apache)
via: nginx
# Document root (for Bedrock, this is 'web')
webroot: web
# Xdebug configuration
xdebug: "debug,develop,trace"
# Services
services:
database:
type: mariadb:10.6
Environment Variables¶
File: /site/.env
# Database configuration (matches Lando defaults)
DB_NAME=wordpress
DB_USER=wordpress
DB_PASSWORD=wordpress
DB_HOST=database
# WordPress environment
WP_ENV=development
# Site URL (must match 'name' in .lando.yml)
WP_HOME=http://hetccv.lndo.site
WP_SITEURL=${WP_HOME}/wp
Starting a New Project¶
Step 1: Create Configuration Files
Create .lando.yml and .env files as shown above.
Step 2: Start Lando
Step 3: Access Your Site
Your site will be available at: http://projectname.lndo.site
Step 4: Import Database (Optional)
Advanced Configuration¶
Custom Services¶
Add additional services to .lando.yml:
services:
# ElasticSearch
elasticsearch:
type: elasticsearch:7
portforward: 9200
# Redis
redis:
type: redis:6
# MailHog (email testing)
mailhog:
type: mailhog
portforward: 1025
hogfrom:
- appserver
Tooling Commands¶
Add custom commands:
tooling:
npm:
service: appserver
cmd: npm
yarn:
service: appserver
cmd: yarn
composer:
service: appserver
cmd: composer
Build Steps¶
Run commands during Lando start:
Useful Commands¶
Basic Commands¶
Start Lando:
Stop Lando:
Restart Lando:
Rebuild Lando:
Destroy Lando Environment:
View Info:
WP-CLI Commands¶
Lando includes WP-CLI by default:
Create Admin User:
Reset Admin Password:
Search and Replace:
Flush Cache:
Export Database:
Import Database:
List All Users:
Check WordPress Version:
Composer Commands¶
# Install dependencies
lando composer install
# Update dependencies
lando composer update
# Require package
lando composer require vendor/package
Node/NPM Commands¶
# Install packages
lando npm install
# Run build
lando npm run build
# Watch for changes
lando npm run watch
Database Commands¶
Import Database:
Export Database:
Access Database:
Connect with External Tool:
SSH into Container¶
Logs¶
View Logs:
lando logs
# Follow logs
lando logs -f
# Service-specific logs
lando logs -s appserver
lando logs -s database
Troubleshooting¶
Common Issues¶
Port Already in Use¶
Error:
Solution:
Change port in .lando.yml:
Certificate Error¶
Error:
Solution:
Database Connection Error¶
Symptoms: - "Error establishing database connection" - Can't connect to database
Solution:
# Check database is running
lando info
# Restart Lando
lando restart
# Verify .env database credentials
DB_HOST=database
DB_NAME=wordpress
DB_USER=wordpress
DB_PASSWORD=wordpress
Slow Performance¶
On macOS with large projects:
Add to .lando.yml:
This excludes large directories from file syncing.
Permission Issues¶
# Fix file permissions
lando ssh
chown -R www-data:www-data /app/web/app/uploads
chmod -R 755 /app/web/app/uploads
Xdebug Not Working¶
Check Xdebug is enabled:
Configure IDE (VS Code):
Add to .vscode/launch.json:
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}/site"
}
}
Lando Commands Not Found¶
Restart your terminal or add Lando to PATH:
Out of Disk Space¶
Clean up Docker:
Advanced Usage¶
Multiple PHP Versions¶
Custom Domain¶
Add to /etc/hosts:
Running Tests¶
Usage:
Performance Tips¶
- Use NFS for better file sync performance (macOS)
- Exclude large directories from sync (node_modules, vendor)
- Increase Docker resources (CPU, Memory in Docker Desktop)
- Use latest Lando version (performance improvements in new releases)
- Disable Xdebug when not debugging
See Also¶
- Lando Official Documentation
- WordPress Roots Stack - Bedrock, Sage, Trellis
- Roots Sync Scripts - Database synchronization
- Docker - Docker usage and troubleshooting
- Apple Silicon Macs - M1/M2/M3 specific issues