How to Deploy a Project with Vercel
1. Create and Log in to Vercel Account
1) Creating a Vercel Account
Go to the Vercel homepage.
Sign in using your GitHub, GitLab, or Bitbucket account (GitHub is recommended).
Grant Vercel the necessary permissions to access your GitHub account.
2) Log in
Once your account is created, you will be automatically logged in, and you can proceed with the deployment process.
2. Prepare Your Project
1) Prepare Your Project Locally
If you already have a project to deploy, make sure it's uploaded to a GitHub, GitLab, or Bitbucket repository.
Vercel supports various frameworks, including static sites and Server-Side Rendering (SSR) frameworks like Next.js, React.js, Svelte, and Vue.js.
2) Push to Git Repository
Use the following commands to push your project to GitHub:
3. Connect GitHub Repository to Vercel
1) Create a New Project
In the Vercel dashboard, click on the New Project button.
You will see a list of repositories linked to your GitHub, GitLab, or Bitbucket account. Select the repository you want to deploy.
Click Import to import the project.
4. Project Settings
1) Project Configuration Options
During the import process, you can customize deployment settings.
You can also configure build and environment variables. For Next.js, the build settings are automatically detected.
2) Build Command and Output Directory
Vercel will automatically set the appropriate build command and output directory for your project.
Example: For a Next.js project, the default build command is
npm run build
, and the output directory is.next
.
5. Deploy
1) Automatic Deployment
Once the setup is complete, Vercel will automatically build and deploy your project.
After the deployment is done, you can view your site at the default domain provided by Vercel (e.g.,
https://<project-name>.vercel.app
).
2) Automatic Deployments on Git Push
Since Vercel is linked to GitHub, every time you push new commits to the
main
branch, Vercel will automatically deploy the changes.
6. Domain Setup (Optional)
1) Using Vercel’s Default Domain
Vercel provides a default domain in the format
https://<project-name>.vercel.app
.
2) Connecting a Custom Domain
In the Vercel dashboard, select the deployed project and go to the Domains tab.
Click Add Domain and enter the custom domain you want to use.
To link your custom domain, update your DNS settings:
Add a CNAME or A record with your DNS provider, pointing to Vercel's IP address.
Last updated