Deployment
Netlify
Learn how to deploy your SaaS application to Netlify.
Deploying your SaaS application to Netlify is straightforward. Netlify automatically detects Next.js projects and configures the build settings for you.
Steps to Deploy
-
Connect Your Repository:
- Sign up or log in to your Netlify account.
- Click on "Add new site" > "Import an existing project".
- Connect to your Git provider (GitHub, GitLab, Bitbucket) and select the repository containing your StarterKitPro project.
-
Configure Build Settings:
- Netlify usually auto-detects Next.js and sets the correct build command (
npm run build
oryarn build
) and publish directory (.next
). - You typically don't need to change these settings.
- Netlify usually auto-detects Next.js and sets the correct build command (
-
Add Environment Variables:
- Go to your site's settings in Netlify:
Site settings
>Build & deploy
>Environment
. - Add all the necessary environment variables defined in your
.env.example
file (e.g.,DATABASE_URL
,NEXTAUTH_SECRET
,RESEND_API_KEY
, etc.). - Important: Ensure these variables match the ones required by your application to function correctly in production.
- Go to your site's settings in Netlify:
-
Deploy:
- Click the "Deploy site" button. Netlify will start the build process and deploy your application.
- Once the deployment is complete, your site will be live on a Netlify subdomain (e.g.,
your-site-name.netlify.app
). You can configure a custom domain later if needed.
That's it! Your StarterKitPro application should now be live on Netlify. Subsequent pushes to your connected Git branch (usually main
or master
) will automatically trigger new deployments.
Add a Custom Domain
After deploying, you can replace the default Netlify subdomain with your own custom domain.
- Go to Domain Settings: In your Netlify site dashboard, navigate to
Site settings
>Domain management
. - Add Custom Domain: Click "Add a domain" and enter your desired domain name (e.g.,
yourdomain.com
). - Verify and Configure DNS: Follow the instructions provided by Netlify. This usually involves:
- Setting your domain's nameservers to Netlify's DNS (recommended for automatic HTTPS).
- Or, adding specific DNS records (like
CNAME
orA
records) at your domain registrar to point your domain to your Netlify site.
- Wait for Propagation: DNS changes can take some time to propagate (up to 48 hours, but often much faster). Netlify will automatically provision an SSL certificate once the DNS is configured correctly.