Deployment
Next.js applications can be deployed to various platforms. Below are two options we’ve validated:
1. Vercel (Default)
Vercel, developed by the creators of Next.js, is the primary and preferred platform for deploying Next.js applications.
To deploy on Vercel:
- Push your code to a Git repository (GitHub, GitLab, or Bitbucket)
- Import your project into Vercel
- Vercel will automatically detect Next.js and configure the build settings
- Deploy with a single click
Vercel provides features such as automatic HTTPS, CDN integration, continuous deployment, and more.
2. Coolify
Coolify is an open-source, self-hosted solution we’ve tested for deploying Next.js applications.
To deploy with Coolify:
- Set up a Coolify instance on your own server
- Connect your Git repository to Coolify
- Configure the build and start commands:
- Build Command:
npm run build
- Start Command:
npm run start
- Build Command:
- Deploy your application
Coolify offers features like automatic HTTPS, seamless rollbacks, and database management, all hosted on your infrastructure.
Regardless of the deployment platform you select, ensure all environment variables are correctly configured and your application is thoroughly tested in a production-like environment prior to deployment.