Framework Guide

Next.js on CupaDev

Deploy your Next.js applications with zero configuration. Automatic optimizations, edge functions, and serverless scaling included.

Getting Started

Deploy your Next.js app in minutes

1

Create your app

Start with a new Next.js project or use an existing one.

npx create-next-app@latest
2

Connect your repository

Connect your GitHub, GitLab, or Bitbucket repository to CupaDev.

git push origin main
3

Deploy automatically

Your Next.js app deploys automatically on every push.

Deployed ✓

Example Configuration

cupadev.json

{
  "buildCommand": "npm run build",
  "outputDirectory": ".next",
  "nodeVersion": "20.x",
  "env": {
    "NODE_ENV": "production"
  },
  "headers": [
    {
      "source": "/api/(.*)",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "no-cache"
        }
      ]
    }
  ],
  "redirects": [
    {
      "source": "/docs",
      "destination": "/documentation",
      "permanent": true
    }
  ]
}

Build & Deploy

Specify your build command and output directory. CupaDev automatically detects Next.js projects and optimizes the build process.

  • Automatic build optimization
  • Node.js version management

Environment & Routing

Configure environment variables, headers, redirects, and rewrites for your deployment.

  • Custom headers and redirects
  • Environment variable management

Next.js Features on CupaDev

App Router & Server Components

  • Full support for Next.js 14+ App Router
  • React Server Components (RSC) ready
  • Streaming and incremental static regeneration
  • Dynamic and static route handling

API Routes & Middleware

  • Serverless API routes with automatic scaling
  • Edge middleware execution
  • Request/response optimization
  • CORS and security headers built-in

Image & Asset Optimization

  • Automatic image optimization with next/image
  • WebP and modern format support
  • Automatic responsive image sizing
  • Global CDN for fast delivery

Performance & Caching

  • Automatic static page caching
  • On-demand incremental static regeneration (ISR)
  • Smart cache invalidation
  • Response compression and minification

Additional Setup

Environment Variables

Set sensitive environment variables securely in your CupaDev project settings:

NEXT_PUBLIC_API_URL=https://api.example.com
DATABASE_URL=postgresql://...
STRIPE_API_KEY=sk_...

Variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Keep sensitive keys private.

Database Connections

CupaDev supports connections to any database provider:

  • PostgreSQL with connection pooling
  • MongoDB and Mongoose ORM
  • Prisma ORM ready
  • Redis for caching and sessions

Custom Domains

Point your custom domain to your Next.js deployment:

  • Free SSL certificates with auto-renewal
  • DNS management and CNAME setup
  • Wildcard subdomains support

Ready to deploy your Next.js app?

Get your Next.js application deployed in minutes with automatic scaling and edge optimization.