Deploy
Once you have your project running locally, you can deploy it to production. Your Next.js application can be deployed to any platform that supports Node.js.
Building for Production
Most deployment platforms (like Vercel and Netlify) automatically build your application during deployment. However, you can test your production build locally before deploying:
# Build the application locally (optional)
pnpm build
# or
npm run build
# or
yarn build
# Test the production build locally
pnpm start
# or
npm start
# or
yarn startDeployment Platforms
Vercel (Recommended)
Vercel is built by the creators of Next.js and offers the best integration experience:

Deploy your app to Vercel
-
Connect your repository:
- Visit Vercel Dashboard
- Click "Add New" → "Project"
- Import your GitHub repository
-
Add environment variables:
- Go to Project Settings → Environment Variables
- Add your production environment variables
- Copy from your
.env.localfile
-
Deploy:
- Click "Deploy"
- Your app will be live in minutes
Netlify
Netlify offers great static site hosting with serverless functions:

Deploy your app to Netlify
-
Connect your repository:
- Visit Netlify Dashboard
- Click "Add new site" → "Import an existing project"
- Connect your Git provider and select your repository
-
Configure build settings:
- Build command:
pnpm build(ornpm run buildoryarn build) - Publish directory:
.next
- Build command:
-
Add environment variables:
- Go to Site Settings → Environment Variables
- Add your production environment variables
- Copy from your
.env.localfile
-
Deploy:
- Click "Deploy site"
- Your site will be live shortly
Other Platforms
- Railway - Zero-configuration deployments with automatic HTTPS and database integration
- DigitalOcean App Platform - Auto-detects Next.js projects with simple configuration
- AWS Amplify - Amazon's hosting platform with CI/CD and serverless backend
- Firebase Hosting - Google's platform with integrated backend services
- Cloudflare Pages - Fast global edge network with automatic deployments