Guide
Local Development
Set up a local WordPress environment for your WPNuxt project
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 |
|---|---|---|---|
| LocalWP | Most developers — easy GUI, no Docker | 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: LocalWP (Recommended)
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:
.env
WPNUXT_WORDPRESS_URL=http://my-wpnuxt-site.local
Option 2: 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 3: 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
.env
WPNUXT_WORDPRESS_URL=https://your-wordpress-site.com
For remote development, consider using a staging site rather than production.
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:
.env
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