• Docs
  • Changelog
Sign in
Get started
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Manage files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK reference
        • TypeScript SDK
        • Python SDK
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render

Deploy a Next.js App

You can deploy a Next.js application on Render in just a few clicks. A sample app for this quickstart is deployed at https://next-js.onrender.com.

Depending on your app, you deploy Next.js either as a Node.js web service or as a static site:

  • Deploy a web service for a full Next.js app with server-side logic.
  • Deploy a static site for a Next.js static export.

Deploy as a web service

  1. Fork nextjs-hello-world on GitHub.

  2. Create a new Web Service on Render, and give Render permission to access your new repo.

  3. Use the following values during creation:

    LanguageNode
    Build Commandyarn; yarn build
    Start Commandyarn start

That's it! Your web service will be live on your Render URL as soon as the build finishes.

See Specifying a Node Version if you need to customize the version of Node.js used for your app.

Deploy as a static site

  1. Fork nextjs-hello-world on GitHub.

  2. Modify the code according to the instructions in the nextjs-hello-world README.

  3. Create a new Static Site on Render, and give Render permission to access your new repo.

  4. Use the following values during creation:

    Build Commandyarn; yarn build
    Publish Directoryout

That's it! Your static site will be live on your Render URL as soon as the build finishes.

Caching Next.js builds (optional)

Next.js stores the output of its compiler in .next/cache to speed up subsequent builds. Render services do not persist this directory, which means builds do not benefit from the cache by default. If Next.js does not find its cache, it outputs No build cache found in your build logs.

Render does persist the directory specified by $XDG_CACHE_HOME between builds. You can add a build script like the following to your repository that restores .next/cache from $XDG_CACHE_HOME/next before each build, then saves it again to $XDG_CACHE_HOME/next afterward. This enables cache reuse between builds.

  1. Save this script to a file in your repository root: build.sh

  2. Change the permissions to allow the file to be executable: chmod u+x ./build.sh

  3. Update your service's Build Command: yarn install && ./build.sh

Deploy a Next.js App
  • Deploy as a web service
  • Deploy as a static site
  • Caching Next.js builds (optional)
All Systems Operational
© Render Inc. All rights reserved.