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)
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
- Go to temps.sh and sign in
- Click New Project
- Select your Git provider (GitHub, GitLab, Bitbucket)
- Choose your Next.js repository
Step 2: Configure Build Settings
Temps auto-detects Next.js projects. Default settings work for most apps:
| Setting | Default Value |
|---|---|
| Build command | npm run build |
| Output directory | .next |
| Node version | 20 |
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
- Navigate to your project settings
- Click Environment Variables
- Add key-value pairs
- 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
- Open a pull request
- Temps builds and deploys a preview
- A comment appears with the preview URL
- Review changes before merging
- 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:
| Type | Name | Value |
|---|---|---|
| A | yourdomain.com | YOUR_SERVER_IP |
| A | www | YOUR_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
| Aspect | Temps | Vercel |
|---|---|---|
| Deploy time | ~30 seconds | ~30 seconds |
| Team pricing | Free (unlimited) | $20/seat |
| Bandwidth | Unlimited | $40/100GB |
| Analytics | Included | $10+/month |
| Error tracking | Included | Not included |
Temps vs Docker + VPS
| Aspect | Temps | Docker + VPS |
|---|---|---|
| Setup time | 5 minutes | 30+ minutes |
| Preview deploys | Automatic | Manual setup |
| SSL certificates | Automatic | Let's Encrypt setup |
| Rollbacks | One click | Manual |
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
- Check runtime logs in dashboard
- Verify environment variables are set for production
- Ensure API endpoints are accessible from production
Custom Domain Not Working
- Verify DNS records are correct
- Wait for propagation (up to 48 hours)
- Check SSL certificate status in dashboard
Next Steps
Your Next.js app is now live on Temps. Here's what to explore next:
- Set up preview environments for pull request reviews
- Add your custom domain for a professional presence
- Explore analytics to understand your users
- 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