Skip to content

Vercel

Vercel is the recommended platform for Velocity.

  1. Push your code to GitHub, GitLab, or Bitbucket

  2. Import project in Vercel Dashboard

  3. Set environment variables:

    • SITE_URL = Your production domain
  4. Click Deploy

Terminal window
# Install Vercel CLI
pnpm add -g vercel
# Deploy
vercel
# Deploy to production
vercel --prod

For API routes and server-side rendering, add the Vercel adapter:

Terminal window
pnpm add @astrojs/vercel
astro.config.mjs
import vercel from '@astrojs/vercel';
export default defineConfig({
output: 'server',
adapter: vercel(),
});

Set in Vercel Dashboard → Project → Settings → Environment Variables:

Terminal window
SITE_URL=https://your-project.vercel.app
PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
  1. Go to Project → Settings → Domains
  2. Add your domain
  3. Update DNS records as instructed
  4. Update SITE_URL environment variable

Vercel auto-detects Astro. Manual configuration if needed:

SettingValue
Framework PresetAstro
Build Commandpnpm build
Output Directorydist
Install Commandpnpm install

Every push creates a preview deployment:

  • https://your-project-git-branch-name.vercel.app

Perfect for testing before merging to main.

With the Vercel adapter, API routes run on the edge:

src/pages/api/hello.ts
export const config = {
runtime: 'edge',
};
export async function GET() {
return new Response('Hello from the edge!');
}

Check build logs in Vercel Dashboard for errors.

  • Ensure no typos in variable names
  • Redeploy after adding/changing variables
  • Check if variable should be PUBLIC_ prefixed