Local Development
To develop your WPNuxt project locally, you need a WordPress installation with WPGraphQL. Here are your options.
Quick Comparison
| Option | Best For | Requires Docker? | Setup Time |
|---|---|---|---|
| WordPress Playground | Quick start, no installation needed | No | ~1 min |
| LocalWP | Persistent local environment with GUI | No | ~5 min |
| wp-env | CI/CD, reproducible environments | Yes | ~10 min |
| Existing WordPress | Teams with a staging site already running | No | ~2 min |
| Demo instance | Quick exploration, no WordPress needed | No | 0 min |
Option 1: WordPress Playground (Recommended)
The WPNuxt starter template includes a WordPress Playground blueprint that launches a fully configured WordPress instance in your browser — no server, no Docker, no installation.
Setup
- Create a project with the starter template (if you haven't already):
npm create wpnuxt@latest - Start the dev server with WordPress Playground:
pnpm dev:blueprint
This starts a WordPress Playground with WPGraphQL, sample content (posts, pages, menus, images), and pretty permalinks — then launches the Nuxt dev server pointed at it.
What's Included
The blueprint configures WordPress with:
- WPGraphQL plugin (activated)
- Pretty permalinks (
/%postname%/) - Sample blog posts, pages, and a navigation menu
- Public introspection enabled
Limitations
- Data may not persist between sessions — treat it as a disposable environment
- Not suitable for testing WordPress plugins or custom themes
- Runs in Node.js via WebAssembly, not a full PHP/MySQL environment
Option 2: LocalWP
LocalWP is a free, user-friendly app for running WordPress locally.
Setup
- Download and install LocalWP
- Click Create a new site
- Choose a site name (e.g., "my-wpnuxt-site")
- Use the default PHP/MySQL settings
- Set your admin credentials
Install Required Plugins
In your LocalWP site's WordPress admin:
- Go to Plugins → Add New
- Search for and install WPGraphQL
- Activate the plugin
For Gutenberg blocks support, also install:
- WPGraphQL Content Blocks (download from GitHub)
For authentication (@wpnuxt/auth):
- Headless Login for WPGraphQL (download from GitHub)
Connect to Nuxt
Find your site URL in LocalWP (e.g., http://my-wpnuxt-site.local) and add it to your .env:
WPNUXT_WORDPRESS_URL=http://my-wpnuxt-site.local
Option 3: wp-env (Docker)
wp-env is WordPress's official Docker-based local environment.
Requirements
- Docker Desktop
- Node.js 20+
Setup
- Install wp-env globally:
npm install -g @wordpress/env - Create
.wp-env.jsonin your project root:{ "plugins": [ "https://downloads.wordpress.org/plugin/wp-graphql.zip", "https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip" ], "port": 8080 } - Start WordPress:
wp-env start - Access WordPress admin at
http://localhost:8080/wp-admin- Username:
admin - Password:
password
- Username:
- Add to your
.env:WPNUXT_WORDPRESS_URL=http://localhost:8080
wp-env Commands
wp-env start # Start WordPress
wp-env stop # Stop WordPress
wp-env destroy # Remove environment (start fresh)
Option 4: Existing WordPress
You can also use any existing WordPress installation (local or remote).
Requirements
- Install and activate WPGraphQL
- Enable introspection in GraphQL → Settings
- Ensure the GraphQL endpoint is accessible from your dev machine
Connect
WPNUXT_WORDPRESS_URL=https://your-wordpress-site.com
Testing Your Setup
After configuring WordPress, verify it works:
- Visit
{your-wordpress-url}/graphql- you should see the GraphQL IDE - Run this query:
{ posts { nodes { title } } } - Start your Nuxt dev server:
pnpm dev
Demo WordPress
Don't have WordPress set up yet? Use our demo instance to get started:
WPNUXT_WORDPRESS_URL=https://wordpress.wpnuxt.com
This is a read-only demo with sample content, perfect for trying out WPNuxt.
Related Pages
- Installation — Install and configure WPNuxt
- WordPress Setup — Configure WordPress for WPNuxt
- Quick Start — Build a blog from scratch in 15 minutes