ploy dev
Start the local development server with hot reloading.
ploy dev
Start the local development server with hot reloading. ploy dev automatically detects whether your project is a worker, a Next.js app, or a Cloudflare Vite app and starts the appropriate development environment.
For Cloudflare Vite projects, ploy dev starts the Vite dev server alongside the Ploy dashboard. See the Vite guide for how the integration works and how it's configured.
ploy dev [options]Options
| Flag | Description | Default |
|---|---|---|
-p, --port <number> | Server port | 3000 |
-h, --host <string> | Server host | localhost |
-c, --config <path> | Path to ploy.yaml | auto-detected |
--no-watch | Disable file watching | watch enabled |
-v, --verbose | Verbose output | false |
--dashboard-port <number> | Dev dashboard port | port + 1000 |
Worker Projects
For worker projects (kind: worker in ploy.yaml), ploy dev starts the full local emulator with all Ploy services available:
- SQLite database (D1-compatible)
- Message queues
- Workflows
- Cache
- State
- File storage
- Auth
- Scheduled jobs
ploy dev
# Worker running at http://localhost:3000
# Dashboard at http://localhost:4000The dev dashboard lets you inspect queued messages, workflow runs, database tables, and other runtime state while developing locally.
All services run entirely locally — no cloud connection required during development.
Custom Port
ploy dev -p 8080
# Worker at http://localhost:8080
# Dashboard at http://localhost:9080Custom Dashboard Port
ploy dev --dashboard-port 5000
# Worker at http://localhost:3000
# Dashboard at http://localhost:5000Watch Mode
File watching is enabled by default. Changes to your worker source files trigger a hot reload. Disable it with --no-watch:
ploy dev --no-watchNext.js Projects
For Next.js projects, ploy dev starts next dev alongside a Ploy mock server that provides all runtime bindings (database, queues, auth, etc.) to your Next.js app.
Auto-detection: a project is considered Next.js if:
ploy.yamlhaskind: nextjs, or- A
next.config.ts,next.config.js,next.config.mts, ornext.config.mjsfile exists
ploy dev
# Next.js at http://localhost:3000
# Ploy dashboard http://localhost:4000The PLOY_MOCK_SERVER_URL environment variable is automatically set so that @meetploy/nextjs connects to the local mock server instead of the production API.
Minimal Next.js ploy.yaml
kind: nextjs
db:
DB: default
auth:
binding: PLOY_AUTHVerbose Output
Use -v / --verbose to see detailed logs from the emulator and all runtime services:
ploy dev -vProject Setup
Make sure your package.json includes a types script that calls ploy types so that type definitions stay in sync:
{
"scripts": {
"dev": "ploy dev",
"types": "ploy types",
"build": "ploy build"
}
}How is this guide?
Last updated on