Deploying on Vercel
Learn how to deploy your project to the Vercel platform
This guide will help you deploy your project to the Vercel platform. Since the project is built with Next.js, Vercel, as the creator of Next.js, provides the best developer experience and performance optimization.
Prerequisites
Before deploying your project, make sure you have:
- A Git repository containing your project code (like GitHub, GitLab, or Bitbucket)
- A Vercel account, sign up here if you don't have one
- Environment variables configured for the production environment
Deployment Steps
Push Code to Git Repository
Ensure your code is pushed to a code repository on GitHub, GitLab, or Bitbucket.
Connect to Vercel
- Log in to the Vercel Console
- Click the "Add New Project" or "New Project" button
- Import your Git repository
Configure New Project
On the configuration page, you need to set the following options:
- Framework Preset: Select Next.js
- Build Command: Use the default
npm run build
(oryarn build
if using Yarn) - Output Directory: Use the default
.next
- Install Command: Use the default
npm install
(oryarn install
if using Yarn)
If you're unsure about a setting, you can keep the default value. Vercel typically detects the correct configuration automatically.
Configure Environment Variables
On the configuration page, find the "Environment Variables" section
-
Add all necessary environment variables, for example:
-
Make sure to add all necessary environment variables for running the project
-
Make sure the environment variables are set for the production environment
Deploy the Project
Click the "Deploy" button to start the deployment process. Vercel will automatically build and deploy your project.
Update Environment Variables
If you want to add or update environment variables after deploying the project, you can do it in the Project Settings > Environment Variables, and then redeploy the project.

Automatic Deployments
Vercel provides automatic deployment functionality when you:
- Push code to the main branch
- Create a new Pull Request
- Push to a branch with preview deployments enabled
Each Pull Request gets a unique preview URL, allowing you to test changes before merging to production.
Custom Domain
If you want to add a custom domain to your project:
- Go to your project settings in the Vercel console
- Navigate to the "Domains" section
- Add your custom domain
- Follow the DNS configuration instructions
Troubleshooting Common Issues
Build Failures
If the build process fails:
- Check the build logs for detailed error information
- Ensure all dependencies are correctly installed
- Verify that environment variables are properly configured
Application Functions Incorrectly
- Confirm all environment variables are set correctly
- Check if the database connection is working properly
- Verify that API keys for third-party services are valid
- Check the logs for any errors or messages that can help you diagnose the issue
Next Steps
Now that you understand how to deploy your MkSaaS website to Vercel, explore these related topics: