Skip to content

Deploy a Next.js App

Varity Team Core Contributors Updated May 2026

Deploy a production Next.js app with a database and a live URL with one command. No server configuration, no environment variable setup, no infrastructure decisions.

Zero configuration

Varity detects your framework, wires your database, and deploys. You run one command.

Predictable pricing instead of usage-metered cloud bills

One flat monthly cost per app. Your bill on day 1 equals your bill on day 1000. No DevOps overhead.

You can deploy from your AI editor using the Varity MCP server (the fastest path), or from the terminal using the CLI.

Step 1. Add the Varity MCP server

Terminal window
claude mcp add varity -- npx -y @varity-labs/mcp@beta

Step 2. Ask your AI to deploy

Type this prompt in your AI editor:

Build and deploy my current Next.js project to Varity.

The AI will call varity_install_deps, varity_build, and varity_deploy in sequence. Your live URL appears when it is done.

Step 3. Check the result

Show me the status of my Varity deployment

You will get the live URL, framework detected, build time, and status.

When you deploy a Next.js app with Varity, these services are wired automatically:

ServiceWhat Varity does
Database (Postgres)Provisions a dedicated schema, injects connection credentials at deploy time
HostingDetects SSR vs. static and picks the right compute type
SSLHTTPS is on by default. No certificate setup needed
Custom URLYour app gets a live public URL at varity.app/your-app

No environment variables to copy, no credential files to manage. The auto-wired services are documented in Auto-wired Services.

  1. Verify your environment

    Terminal window
    varitykit doctor

    This checks Node.js, Python, CLI, and authentication status. Fix anything it flags before proceeding.

  2. Open your app and install dependencies

    Terminal window
    cd my-nextjs-app
    npm install
  3. Run locally

    Terminal window
    npm run dev

    Open http://localhost:3000. Sign in, create a record, verify the UI works.

  4. Build for production

    Terminal window
    npm run build

    Fix any TypeScript or lint errors before deploying.

  5. Deploy

    Terminal window
    varitykit app deploy

    Output when done:

    Detecting framework... Next.js (App Router)
    Building app... Done in 42s
    Deploying... Done in 18s
    Live at: https://varity.app/my-nextjs-app/
  6. Verify

    Open the URL. Sign in. Create a record. Confirm the app works exactly as it did locally.

By default Varity detects whether your app is static or needs a live server. A Next.js app with API routes, server actions, or getServerSideProps is automatically deployed with container-based compute.

If you want to force the hosting type:

Terminal window
varitykit app deploy --hosting dynamic

See Auto-wired Services for a full explanation of how Varity picks the hosting type.

These are the relevant MCP tools for a Next.js deploy workflow:

ToolWhat it does
varity_doctorChecks environment setup
varity_install_depsRuns npm install
varity_buildBuilds for production
varity_deployDeploys and returns the live URL
varity_deploy_statusLists deployments with status and URL
varity_deploy_logsGets build logs for debugging

Copy-paste prompts for each step:

Check if my environment is ready for Varity
Create a new Varity app called invoice-tracker, install dependencies
Build my project and deploy it to Varity
Show me the deployment status and live URL

After making changes, redeploy with the same command:

Terminal window
varitykit app deploy

Or from your AI editor:

Build and redeploy my Varity app

Varity keeps the previous deployment available for instant rollback. See Rollback a Deployment.

Varity uses fixed hardware profile pricing, while Vercel, Render, and Railway are usage-based. Use the cost calculator to get a precise estimate:

How much would it cost to host a Next.js app with 500 users on Varity?

Or use the CLI:

Terminal window
varitykit cost-calculator --users 500 --has-database

See How pricing works for details.

Build fails with “Module not found”

Run npm install first, then rebuild.

“varitykit not found” in terminal

Terminal window
pipx install varitykit
varitykit doctor

Deploy times out

Terminal window
varitykit doctor
varitykit app deploy --verbose

App loads but database is empty

Your app scaffold includes sample data creation in the dashboard. Navigate to a list view and create a record to confirm the database is wired correctly.

See Troubleshooting Deploys for the full list.