Skip to content
Next.js logo

Full-stack JavaScript solution

Next.js local development environment with FlyEnv

Build, run, and test Next.js applications with the Node.js runtime, your preferred package manager, local databases, Redis, custom domains, and HTTPS — all managed in one workspace.

A practical local stack for Next.js

Next.js can start as one Node.js process, but a realistic full-stack project often needs a runtime, build tools, data services, and a browser-facing origin that stay aligned.

Node.js runtime

Run the Next.js server, development tools, and build scripts on the project-supported release.

Node.js feature

Package manager

Use the package manager and lockfile the repository already expects: npm, pnpm, Yarn, or Bun.

Application database

Connect PostgreSQL or MySQL when server actions, route handlers, or the application layer need persistent data.

Database feature

Optional Redis

Add Redis for caching, sessions, queues, rate limiting, or background work when the application uses it.

Redis feature

Local origin

Use Nginx or Caddy when the app needs a stable local hostname, proxy behavior, or multiple services.

Nginx feature

HTTPS for browser flows

Test OAuth, secure cookies, webhooks, service workers, and other browser features on a trusted local origin.

Local HTTPS feature

The Next.js lifecycle in FlyEnv

Keep the project runtime and package workflow together from installing dependencies to running a production-like build.

1

Install dependencies

Resolve the lockfile with the selected project toolchain.

npm install
2

Run dev server

Run the App Router, Server Components, and route handlers locally.

npm run dev
3

Build

Catch production rendering and dependency issues before deployment.

npm run build
4

Start production

Serve the built application through a local domain and HTTPS.

npm start

Frontend and backend in one local workspace

A Next.js project can serve the UI, route handlers, server actions, and API calls from one application while still depending on local data services.

Browser and local origin

Open https://next-app.test for cookies, OAuth, webhooks, and client-side integration tests.

UI and route handlers

Render pages, server actions, API endpoints, and backend-for-frontend logic from the Next.js project.

Next.js application

App Router · Server Components · Route Handlers · Server Actions

FrontendBackend
PostgreSQL or MySQL

PostgreSQL or MySQL

Store users, content, orders, and other application data used by the server layer.

Redis when needed

Redis when needed

Support cache, sessions, queues, rate limits, or other fast shared state.

Browser / HTTPSNext.js applicationPostgreSQL / Redis

Project runtime and package manager

Node.js is the application runtime; the package manager is part of the project toolchain. Keep both choices visible instead of relying on one global installation.

FlyEnv manages the runtime and local services around your project without replacing npm, pnpm, Yarn, Bun, or your existing package scripts.

Node.js version

Match the release required by the Next.js version, dependencies, and deployment target.

Open Node.js feature

Package manager

Keep npm, pnpm, Yarn, or Bun aligned with the lockfile and the scripts the project uses.

Lockfile is part of the project
FlyEnv Startup Groups for starting project services together
Use a Startup Group to start the Next.js app, database, Redis, and other local services together with one click.

Start a new Next.js project or run an existing one

Choose the workflow that matches where the project is today, then keep its runtime and supporting services in one workspace.

Create a new Next.js project

  1. 1Open Node.js → New Project and choose the Next.js template.
  2. 2Select the Node.js version and package manager the project will use.
  3. 3Install dependencies and keep the project lockfile with the source.
  4. 4Add the local domain, HTTPS, and database services when needed.
  5. 5Create a Startup Group for the app and its supporting services.

Run an existing Next.js project

  1. 1Open the repository and identify its Node.js and package manager requirements.
  2. 2Select the matching Node.js version and install from the lockfile.
  3. 3Start PostgreSQL, MySQL, Redis, or another configured service.
  4. 4Configure the local proxy, hostname, and HTTPS for browser-facing flows.
  5. 5Run next dev for development or next build and next start for a production-like check.

Why use FlyEnv for Next.js development

A more predictable local workflow for projects that move between browser UI, server code, builds, and data services.

  • Match Node.js to the project

    Keep different Next.js projects on the runtime releases their dependencies and deployment targets support.

    Project A → Node.js 20 · Project B → Node.js 22

  • Run the app and services together

    Start the Next.js app, database, Redis, and local proxy as one project group when the full stack is required.

    Next.js + PostgreSQL + Redis → Startup Group

  • Test a real local origin

    Use a readable local hostname and HTTPS for browser behavior that localhost alone cannot reproduce.

  • Keep full-stack projects isolated

    Keep each project’s runtime, local URL, database, Redis, and supporting services in its own workspace.

Next.js FAQ

Common questions about using FlyEnv for local Next.js projects.

Can different Next.js projects use different Node.js versions?

Yes. FlyEnv lets each project use the Node.js version it requires, which helps when applications or dependencies are on different release tracks.

Does FlyEnv replace the Next.js package manager?

No. Keep using the package manager and lockfile chosen by the repository. FlyEnv provides the project runtime and local services around that toolchain.

Do I need a database for every Next.js project?

No. A frontend-only project may only need Node.js. Add PostgreSQL or MySQL when the application uses server-side data, route handlers, or persistent content.

When should I add Redis?

Add Redis when the application uses caching, sessions, queues, rate limiting, or another shared fast state pattern. It is optional, not a requirement of Next.js itself.

Can I test OAuth and webhooks on a local Next.js domain?

Yes. Configure a local domain with trusted HTTPS so browser cookies, OAuth callbacks, webhooks, and other secure-origin features behave closer to production.

Can FlyEnv run next build and next start?

Yes. FlyEnv provides the Node.js runtime and local services; the project’s own package scripts still run next build and next start for a production-like local check.

Ready to build Next.js locally?

Run the Node.js runtime, build workflow, data services, local domain, and HTTPS in one workspace.

Download FlyEnv
Have questions using FlyEnv?