A comprehensive Docker-based development environment for WordPress plugin and theme development, optimized for GitHub Codespaces and local development.
Currently only works with VS Code Desktop! This template does not work in browser-based VS Code due to WordPress URL handling and Codespaces redirects. Please use VS Code Desktop with the GitHub Codespaces extension for full functionality. Maybe someone can provide a fix via pull request? I failed so far...
- Click "Use this template" → "Create a new repository"
- Open your new repository and click "Code" → "Create codespace on main"
- Wait for the environment to set up automatically
- Start developing in the wp-content folder
Stack: WordPress + MariaDB + phpMyAdmin + WP-CLI + Node.js + VS Code extensions
Access URLs:
Local Development:
- WordPress: http://localhost:8000 (admin/admin)
- phpMyAdmin: http://localhost:8080 (wordpress/wordpress)
Includes: Sample data, theme unit tests, and @wordpress/create-block tool ready to use.
File Structure:
├── .devcontainer/ # Container configuration
├── wp-content/ # Your plugins & themes
└── wp-core/ # WordPress core (auto-generated)
cd wp-content/plugins
npx @wordpress/create-block my-block
cd my-block && npm startCreates a modern React-based block with hot reloading.
mkdir wp-content/plugins/my-plugin
cd wp-content/plugins/my-plugin
# Create your plugin files
wp plugin activate my-plugin --allow-rootmkdir wp-content/themes/my-theme
cd wp-content/themes/my-theme
# Create style.css and index.php
wp theme activate my-theme --allow-root# Plugin management
wp plugin list --allow-root
wp plugin activate plugin-name --allow-root
wp plugin deactivate plugin-name --allow-root
# Theme management
wp theme list --allow-root
wp theme activate theme-name --allow-root
# Database operations
wp db search "old-url" --allow-root
wp search-replace "old-url.com" "new-url.com" --allow-root
# User management
wp user list --allow-root
wp user create newuser user@example.com --role=administrator --allow-root
# Clear cache and flush rewrite rules
wp cache flush --allow-root
wp rewrite flush --allow-root- Only commit files in
wp-content/plugins/andwp-content/themes/ - WordPress core files (
wp-core/) are ignored by Git - Database persists between restarts
- Fork this repository
- Create your feature branch
- Test your changes thoroughly
- Submit a pull request
This template is open source and available under the MIT License.
Built with ❤️ by @eetezadi