Deployments

Next.js

Deploy a Next.js app from GitHub using the Dockerfile build pack (recommended default). Devployer exposes port 3000 and sets PORT / HOSTNAME for the container.

Before you start

  • A Devployer account and a project with an environment
  • A public or private GitHub repository with a Next.js app
  • A root Dockerfile (create one if missing — vibecoding / MCP should add it at the project root)
  • Optional: MCP + Deploy with MCP

1. Create the app in Devployer

  1. Open your project and environment
  2. Add resourcePublic GitHub or Private GitHub
  3. Select framework Next.js
  4. Keep Build pack → Dockerfile (recommended)
  5. Dockerfile path: /Dockerfile (root)
  6. Pick a plan and complete payment when asked
  7. Finish creation (leave instant deploy off to deploy later from MCP)

2. Root Dockerfile

Your repository must include a Dockerfile at the root. If it does not exist, create one before deploy (MCP/vibecoding will do this when you choose Dockerfile).

A typical Next.js standalone image listens on 3000 and matches Devployer’s ports_exposes: "3000".

Example pattern (adapt to your app):

FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci

FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]

Enable output: 'standalone' in next.config when using this layout.

3. Deploy from Cursor (MCP)

  1. Connect MCP — MCP
  2. If no root Dockerfile exists, the agent creates it; then commit/push
  3. In chat: “Deploy my app on Devployer”
  4. The agent uses Dockerfile only and shows the logs

Full guide: Deploy with MCP.

Tips

  • Port must stay 3000 for the standard Next.js Docker path
  • Prefer Dockerfile over Nixpacks for Next.js on Devployer
  • See also Dockerfile and Deploy with MCP

Quick checklist

  • Next.js selected in Devployer with Dockerfile build pack
  • Root Dockerfile exists and is pushed
  • App listens on 3000 inside the container
  • Deploy from portal or MCP
  • Public URL loads when the build finishes