Static Export
How to deploy as a static site
Static Export
Guide to exporting your Next.js site as static files for deployment anywhere.
Step 1: Update next.config.js
Add static export configuration:
Step 2: Build
Build the static site:
This creates an out directory with all static files.
Step 3: Deploy
Deploy the out directory to any static hosting:
- GitHub Pages
- AWS S3
- Cloudflare Pages
- Any static file server
Limitations
Static export has some limitations:
- No server-side features
- No API routes
- No dynamic routes (unless pre-rendered)
- No image optimization (use static images)
Next Steps
- Deploy to Vercel - Recommended option
- Deploy to Netlify - Alternative option