Ploy
Ploy
CLI

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 or a Next.js app and starts the appropriate development environment.

ploy dev [options]

Options

FlagDescriptionDefault
-p, --port <number>Server port3000
-h, --host <string>Server hostlocalhost
-c, --config <path>Path to ploy.yamlauto-detected
--no-watchDisable file watchingwatch enabled
-v, --verboseVerbose outputfalse
--dashboard-port <number>Dev dashboard portport + 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:4000

The 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:9080

Custom Dashboard Port

ploy dev --dashboard-port 5000
# Worker at http://localhost:3000
# Dashboard at http://localhost:5000

Watch 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-watch

Next.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:

  1. ploy.yaml has kind: nextjs, or
  2. A next.config.ts, next.config.js, next.config.mts, or next.config.mjs file exists
ploy dev
#   Next.js at      http://localhost:3000
#   Ploy dashboard  http://localhost:4000

The 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

ploy.yaml
kind: nextjs
db:
  DB: default
auth:
  binding: PLOY_AUTH

Verbose Output

Use -v / --verbose to see detailed logs from the emulator and all runtime services:

ploy dev -v

Project Setup

Make sure your package.json includes a types script that calls ploy types so that type definitions stay in sync:

package.json
{
	"scripts": {
		"dev": "ploy dev",
		"types": "ploy types",
		"build": "ploy build"
	}
}

How is this guide?

Last updated on