Deploying to a cloud platform
Deploy from a Git repository to a managed platform with automatic builds.
5 min readUpdated 2026-09
Prerequisites
- Project pushed to a Git repository (GitHub, GitLab, or Bitbucket)
- An account on a platform that supports Next.js applications
- Your environment variable values ready
Steps
- 01
Import the repository
Create a new project on the platform and select your repository.
- 02
Confirm build settings
Build command: npm run build. Output is detected automatically for Next.js.
- 03
Add environment variables
Copy each variable from .env.local into the platform's environment settings.
- 04
Deploy
Trigger the first deployment. Subsequent pushes to the main branch redeploy automatically.
- 05
Add your domain
Add the domain in the platform dashboard and update your DNS records as instructed.
Preview deployments
Most platforms create a preview URL for each branch or pull request, which is useful for reviewing content changes before they go live.