Deploy
Other Platforms
Deploy WPNuxt to Netlify, Cloudflare, and more
WPNuxt works on any platform that supports Nuxt 4.
Netlify
Build Settings
netlify.toml
[build]
command = "pnpm build"
publish = ".output/public"
[build.environment]
NODE_VERSION = "20"
WPNUXT_WORDPRESS_URL = "https://your-wordpress-site.com"
Environment Variables
For sensitive values, use the Netlify dashboard instead of netlify.toml:
- Go to Site settings → Environment variables
- Add
WPNUXT_WORDPRESS_URLwith your WordPress URL - Optionally add
WPNUXT_DEBUG=truefor build debugging
Deploy
# Install Netlify CLI
npm i -g netlify-cli
# Link to your site
netlify link
# Deploy
netlify deploy --build --prod
Or connect your Git repository in the Netlify dashboard for automatic deployments.
Cloudflare Pages
Nuxt Config
nuxt.config.ts
export default defineNuxtConfig({
nitro: {
preset: 'cloudflare-pages'
}
})
Environment Variables
Set environment variables in the Cloudflare dashboard:
- Go to Workers & Pages → your project → Settings → Environment variables
- Add
WPNUXT_WORDPRESS_URLfor both Production and Preview environments
Deploy with Wrangler
# Install wrangler
npm i -g wrangler
# Build the project
pnpm build
# Deploy
wrangler pages deploy .output/public
Or connect your Git repository in the Cloudflare dashboard for automatic deployments.
Limitations
- Cloudflare Workers have a 1MB script size limit (compressed). Large dependencies may need to be externalized.
- The Workers runtime does not support all Node.js APIs. If you encounter issues, check the Cloudflare compatibility flags.
Self-Hosted (Node.js)
Build and Run
pnpm build
WPNUXT_WORDPRESS_URL=https://your-wordpress-site.com node .output/server/index.mjs
Systemd Service
Create a service file to run WPNuxt as a background service:
/etc/systemd/system/wpnuxt.service
[Unit]
Description=WPNuxt Application
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/wpnuxt
Environment=NODE_ENV=production
Environment=WPNUXT_WORDPRESS_URL=https://your-wordpress-site.com
ExecStart=/usr/bin/node .output/server/index.mjs
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable wpnuxt
sudo systemctl start wpnuxt
Nginx Reverse Proxy
/etc/nginx/sites-available/wpnuxt
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
Docker
Dockerfile
A multi-stage build keeps the final image small:
Dockerfile
# Build stage
FROM node:20-alpine AS build
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
# Runtime stage
FROM node:20-alpine
WORKDIR /app
COPY --from=build /app/.output .output
ENV HOST=0.0.0.0
ENV PORT=3000
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
Docker Compose
docker-compose.yml
services:
wpnuxt:
build: .
ports:
- "3000:3000"
environment:
- WPNUXT_WORDPRESS_URL=https://your-wordpress-site.com
- WPNUXT_DEBUG=false
restart: unless-stopped
Run:
docker compose up -d
Environment Variables
All platforms need:
| Variable | Required | Description |
|---|---|---|
WPNUXT_WORDPRESS_URL | Yes | WordPress site URL |
WPNUXT_DEBUG | No | Enable debug logs |