How to Deploy a Next.js App
No Dockerfile needed. No Vercel required.
What you're building
A Next.js app deployed on PromptShip. PromptShip detects your package.json, installs dependencies, and runs your start command.
Your package.json
Make sure your package.json has a build step and a start script:
{
"scripts": {
"build": "next build",
"start": "next start -p $PORT"
}
}
Next.js reads PORT automatically — the -p $PORT flag is optional but explicit.
How do I deploy it?
Just ask your AI assistant. It calls the PromptShip MCP tools for you:
Deploy my Next.js app from github.com/me/my-nextjs-app on Node 22.
create_app(
name: "my-nextjs-app",
github_repo: "github.com/me/my-nextjs-app"
)configure_app(
app_name: "my-nextjs-app",
runtime: "node:22",
port: 3000
)configure_process(
app_name: "my-nextjs-app",
process_name: "web",
process_type: "web",
command: "npm run build && npm start"
)deploy_app(app_name: "my-nextjs-app", branch: "main")Faster deploys: Building at runtime is slower than building during the image build. For pre-built deploys, use a custom Dockerfile with a multi-stage build.
Your app is live at https://my-nextjs-app-dev.promptship.dev
How do I add API routes with a database?
Ask for Postgres and access it via process.env.DATABASE_URL in your API routes:
Attach a Postgres DB to my-nextjs-app and redeploy.
attach_postgres(app_name: "my-nextjs-app", environment: "dev", tier: "pg-1")deploy_app(app_name: "my-nextjs-app", branch: "main")