t
Temps

How to Deploy Next.js in Under 5 Minutes with Temps

How to Deploy Next.js in Under 5 Minutes with Temps

January 31, 2026 (3w ago)

Temps Team

Written by Temps Team

Last updated January 31, 2026 (3w ago)

Deploying a Next.js application shouldn't require a DevOps degree. With Temps, you go from code to production in under 5 minutes — complete with automatic HTTPS, preview environments, and built-in analytics.

This tutorial walks through deploying any Next.js app to Temps, whether you're starting fresh or migrating from another platform.

What You'll Get

After following this guide, your Next.js app will have:

  • Production deployment with automatic SSL
  • Preview environments for every pull request
  • Built-in analytics (no Google Analytics needed)
  • Error tracking (no Sentry subscription needed)
  • Custom domain support
  • Environment variable management

All without per-seat charges or bandwidth limits.


Prerequisites

  • A Next.js application (any version 13+)
  • Git repository (GitHub, GitLab, or Bitbucket)
  • 5 minutes of time

Method 1: Deploy with Temps CLI

The fastest way to deploy is through the command line.

Step 1: Install Temps CLI

# macOS / Linux
curl -fsSL https://temps.sh/deploy.sh | bash

# Or with npm/bun
npm install -g @temps-sdk/cli

Step 2: Login to Temps

bunx @temps-sdk/cli login

This opens a browser window for authentication. Sign in with GitHub, GitLab, or email.

Step 3: Create a Project and Connect Your Repository

# Create a new project
bunx @temps-sdk/cli projects create -n "My Next.js App" -d "Next.js application"

# Connect your Git repository
bunx @temps-sdk/cli projects git -p my-nextjs-app \
  --owner your-org --repo your-nextjs-app --branch main --preset nextjs -y

Temps automatically detects your Next.js configuration and sets up optimal deployment settings.

Step 4: Deploy

bunx @temps-sdk/cli deploy my-nextjs-app -b main -e production -y

That's it. Temps builds your application and deploys it to production. You'll receive a URL like your-app.temps.sh within seconds.


Method 2: Deploy via Git Push

Connect your repository for automatic deployments on every push.

Step 1: Connect Repository

  1. Go to temps.sh and sign in
  2. Click New Project
  3. Select your Git provider (GitHub, GitLab, Bitbucket)
  4. Choose your Next.js repository

Step 2: Configure Build Settings

Temps auto-detects Next.js projects. Default settings work for most apps:

SettingDefault Value
Build commandnpm run build
Output directory.next
Node version20

Step 3: Deploy

Click Deploy or push to your main branch. Temps handles:

  • Installing dependencies
  • Building your application
  • Deploying to production
  • Provisioning SSL certificate
  • Setting up CDN caching

Configuring Environment Variables

Most Next.js apps need environment variables for databases, APIs, or feature flags.

Via CLI

# Add a single variable
bunx @temps-sdk/cli environments vars set -e production \
  DATABASE_URL "postgresql://..."

# Add multiple from a file
bunx @temps-sdk/cli environments vars import -e production -f .env.production

# List all variables
bunx @temps-sdk/cli environments vars list -e production

Via Dashboard

  1. Navigate to your project settings
  2. Click Environment Variables
  3. Add key-value pairs
  4. Choose which environments (production, preview, development)

Environment variables are encrypted and securely injected at build and runtime.


Preview Environments

Every pull request automatically gets a preview deployment.

How It Works

  1. Open a pull request
  2. Temps builds and deploys a preview
  3. A comment appears with the preview URL
  4. Review changes before merging
  5. Preview is cleaned up when PR closes

Sharing Preview Links

Preview URLs follow the pattern:

pr-123-your-app.temps.sh

Share these with stakeholders for feedback before merging to production.


Custom Domains

DNS Configuration

Add an A record pointing to your server:

TypeNameValue
Ayourdomain.comYOUR_SERVER_IP
AwwwYOUR_SERVER_IP

Adding Your Domain

# Uses HTTP challenge by default
bunx @temps-sdk/cli domains add -d yourdomain.com

For wildcard domains, DNS challenge is required:

# Wildcard — must use DNS challenge
bunx @temps-sdk/cli domains add -d "*.yourdomain.com" --challenge=dns-01

With --challenge=dns-01, the CLI shows a TXT record to add to your DNS provider. Once propagated, Temps completes ACME validation and issues the certificate. For standard (non-wildcard) domains, the default http-01 challenge handles everything automatically.

SSL certificates are provisioned via Let's Encrypt.


Next.js Feature Support

Temps supports the full Next.js feature set:

App Router

// app/page.tsx - fully supported
export default function Home() {
  return <h1>Hello from App Router</h1>
}

Server Components

// Server components work out of the box
async function getData() {
  const res = await fetch('https://api.example.com/data')
  return res.json()
}

export default async function Page() {
  const data = await getData()
  return <div>{data.title}</div>
}

API Routes

// app/api/hello/route.ts
export async function GET() {
  return Response.json({ message: "Hello" });
}

Server Actions

// Server actions work without configuration
async function submitForm(formData: FormData) {
  "use server";
  // Handle form submission
}

ISR (Incremental Static Regeneration)

// ISR with revalidation
export const revalidate = 60; // Revalidate every 60 seconds

Middleware

// middleware.ts
export function middleware(request: NextRequest) {
  // Runs on the edge
}

Built-in Analytics

After deployment, your Temps dashboard includes analytics:

  • Page views and unique visitors
  • Top pages and referrers
  • Geographic distribution
  • Device and browser breakdown

No additional integration required. Privacy-friendly and GDPR-compliant by default.


Built-in Error Tracking

Temps captures frontend and backend errors automatically:

  • Exception tracking with stack traces
  • Environment context (browser, OS, user)
  • Breadcrumbs showing user actions before error
  • Grouping to identify patterns

Errors appear in your dashboard immediately. No Sentry subscription needed.


Optimizing Performance

Enable Standalone Output

For smaller, faster deployments, add to next.config.js:

/** @type {import('next').NextConfig} */
const nextConfig = {
  output: "standalone",
};

module.exports = nextConfig;

This reduces deployment size by excluding unnecessary dependencies.

Image Optimization

Temps supports Next.js Image Optimization out of the box:

import Image from 'next/image'

export default function Page() {
  return (
    <Image
      src="/hero.jpg"
      alt="Hero"
      width={1200}
      height={600}
      priority
    />
  )
}

Images are automatically optimized and cached at the edge.


Comparing Deployment Methods

Temps vs Vercel

AspectTempsVercel
Deploy time~30 seconds~30 seconds
Team pricingFree (unlimited)$20/seat
BandwidthUnlimited$40/100GB
AnalyticsIncluded$10+/month
Error trackingIncludedNot included

Temps vs Docker + VPS

AspectTempsDocker + VPS
Setup time5 minutes30+ minutes
Preview deploysAutomaticManual setup
SSL certificatesAutomaticLet's Encrypt setup
RollbacksOne clickManual

Troubleshooting

Build Fails

Check your build logs in the dashboard. Common issues:

  • Missing environment variables
  • Node version mismatch (update in settings)
  • TypeScript errors (fix locally first)

Deploy Succeeds but App Errors

  1. Check runtime logs in dashboard
  2. Verify environment variables are set for production
  3. Ensure API endpoints are accessible from production

Custom Domain Not Working

  1. Verify DNS records are correct
  2. Wait for propagation (up to 48 hours)
  3. Check SSL certificate status in dashboard

Next Steps

Your Next.js app is now live on Temps. Here's what to explore next:

  1. Set up preview environments for pull request reviews
  2. Add your custom domain for a professional presence
  3. Explore analytics to understand your users
  4. Review error tracking to catch issues early

Quick Reference

# Install CLI
curl -fsSL https://temps.sh/deploy.sh | bash

# Login
bunx @temps-sdk/cli login

# Create project and connect repo
bunx @temps-sdk/cli projects create -n "My App" -d "My Next.js app"
bunx @temps-sdk/cli projects git -p my-app --owner myorg --repo my-app --branch main --preset nextjs -y

# Deploy
bunx @temps-sdk/cli deploy my-app -b main -e production -y

# Set environment variable
bunx @temps-sdk/cli environments vars set -e production KEY "value"

# View logs
bunx @temps-sdk/cli runtime-logs -p my-app -f

# Add custom domain (HTTP challenge by default, use --challenge=dns-01 for wildcards)
bunx @temps-sdk/cli domains add -d yourdomain.com

# Rollback to previous deployment
bunx @temps-sdk/cli deployments rollback -p my-app -e production

Ready to deploy? Get started at temps.sh or run:

curl -fsSL https://temps.sh/deploy.sh | bash && bunx @temps-sdk/cli deploy
#next.js#deployment#tutorial#getting-started