Beginner
How to connect a GitHub repository on Vercel
Quick Answer
Sign up on Vercel with GitHub, import your repository from the dashboard, configure build settings if needed, and deploy. Automatic deployments trigger on git pushes. Use CLI as alternative if dashboard issues arise.
Prerequisites
- GitHub account with owner/write permissions on the target repository
- Vercel account (free tier works)
- GitHub app installed and configured for Vercel access to repositories
- Optional: Vercel CLI and Node.js 18+ for troubleshooting
1
Sign up or log in to Vercel with GitHub
Visit
vercel.com, click Sign Up or Log In, and select Continue with GitHub to authorize access. This grants permissions like Contents (read/write), Deployments, Pull Requests, and Web Hooks.2
Start a New Project in Vercel Dashboard
After logging in, go to the Vercel Dashboard and click New Project in the top-right. You'll see a list of accessible GitHub repositories from your connected account (personal or organization).
3
Authorize GitHub Access if Prompted
If needed, click Import GitHub Repository or Authorize Vercel. Select All repositories or specific ones. For organizations, ensure Owner or Member role with repo access; collaborators on personal repos cannot connect.
Tip
Verify permissions in GitHub Settings > Applications > Vercel > Configure.
4
Select and Import Your Repository
Choose the target repo (must have write access). Vercel filters eligible repos. Click Import to proceed.
5
Configure Project Settings
Vercel auto-detects Framework Preset (e.g., Next.js). Adjust if needed: Build Command (default
next build), Output Directory (e.g., .next), Install Command (e.g., npm install), Root Directory (default /). Click Deploy.6
Set Up Environment Variables (Optional)
In the project Dashboard, go to Settings > Environment Variables. Add keys like
API_KEY with values, select scopes (Preview, Production, or All). Save and redeploy via git push.7
Verify Git Connection in Settings
In project Settings > Git, confirm connected repo, branch (default
main), and webhook status. Change repo or Disconnect if needed.8
Test Automatic Deployments
Push commits to branches: previews for non-production, production for default branch. View in Deployments tab.
9
CLI Alternative for Setup
npm i -g vercel
cd /path/to/your/repo
vercel login
vercel git connect
vercel --prod Use for troubleshooting dashboard issues; prompts match dashboard defaults.Tip
Authenticates with GitHub if needed.
Troubleshooting
Silent failure or no repo import after connecting dialog
Reconnect GitHub in Vercel Settings > Git > Disconnect/Reconnect. Clear browser cache/cookies, use incognito, or verify GitHub Applications > Vercel permissions.
Infinite install loop or 404 on Vercel git pages
Check GitHub status, reconnect integrations, clear browser data, or use CLI with
vercel link.DELETED ACCOUNT or permission errors
Ensure owner/write access on repo. For orgs, confirm Member role with repo access. Reinstall Vercel GitHub app.
Repository not visible in import list
Must be repo Owner for personal accounts. Verify GitHub app grants All repositories or specific access.
Deployment fails after connection
Check team permissions, org settings for Vercel integration, and use CLI to trigger new deployment.
Ready to get started with Vercel?
Put this tutorial into practice. Visit Vercel and follow the steps above.
Visit Vercel →