Skip to content

Deployment Overview ​

Deploy your Portfolio CMS to production and make it available to the world.

Deployment Options ​

PlatformBest ForDifficultyCost
VercelEasiest deploymentEasyFree tier available
NetlifyStatic + FunctionsEasyFree tier available
VPSFull controlMedium$5-20/month

Pre-Deployment Checklist ​

Before deploying, ensure you have:

Environment Variables ​

env
# Required
DATABASE_URL=postgresql://...
PAYLOAD_SECRET=your-secret-key-at-least-32-characters

# Required for production
NEXT_PUBLIC_SITE_URL=https://yourdomain.com

# Required for media uploads
S3_BUCKET=your-bucket-name
S3_ACCOUNT_ID=your-account-id
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET=your-secret-key

# Optional
RESEND_API_KEY=re_...
RESEND_FROM_EMAIL=...
RESEND_FROM_NAME=...

Database ​

Choose a managed PostgreSQL provider:

ProviderFree TierNotes
Neon512MBServerless, auto-scaling
Supabase500MBFull Postgres features
Railway$5 creditEasy setup
Vercel Postgres256MBNative integration

S3 Storage ​

For media uploads, set up S3-compatible storage:

ProviderFree TierNotes
Cloudflare R210GBNo egress fees
AWS S35GBIndustry standard
DigitalOcean SpacesNoneSimple pricing
Backblaze B210GBS3 compatible

Content ​

  1. All content is entered and published
  2. Images are uploaded and optimized
  3. SEO settings are configured
  4. Site Settings are complete

Build Process ​

Local Build Test ​

Before deploying, test the build locally:

bash
# Generate types
pnpm generate:types

# Build the application
pnpm build

# Test the production build
pnpm start

Build Requirements ​

  • Node.js 18.20+ or 20.9+
  • 4GB+ RAM for build
  • TypeScript compiles without errors
  • All environment variables set

Common Build Issues ​

TypeScript Errors:

bash
# Check for type errors
pnpm typecheck

# Generate latest types
pnpm generate:types

Missing Dependencies:

bash
# Reinstall dependencies
rm -rf node_modules
pnpm install

Memory Issues:

bash
# Increase Node.js memory
export NODE_OPTIONS="--max-old-space-size=4096"
pnpm build

Database Setup ​

Creating the Database ​

Neon (Recommended):

  1. Sign up at neon.tech
  2. Create a new project
  3. Copy the connection string

Supabase:

  1. Sign up at supabase.com
  2. Create a new project
  3. Go to Settings > Database
  4. Copy the connection string

Running Migrations ​

After setting up the database:

bash
# Run migrations
pnpm payload migrate

Or if your platform supports it, add to build command:

bash
payload migrate && pnpm build

S3 Storage Setup ​

  1. Sign up for Cloudflare
  2. Go to R2 > Create bucket
  3. Create API token with R2 permissions
  4. Note: Account ID, Access Key, Secret Key, Bucket name

Configuration ​

env
S3_BUCKET=your-bucket-name
S3_ACCOUNT_ID=your-cloudflare-account-id
S3_ACCESS_KEY_ID=your-r2-access-key
S3_SECRET=your-r2-secret-key

CORS Configuration ​

For R2, configure CORS in bucket settings:

json
[
  {
    "AllowedOrigins": ["https://yourdomain.com"],
    "AllowedMethods": ["GET", "PUT", "POST"],
    "AllowedHeaders": ["*"],
    "MaxAgeSeconds": 3000
  }
]

Domain Setup ​

Custom Domain ​

  1. Purchase domain from registrar (Namecheap, Cloudflare, etc.)
  2. Configure DNS based on your platform:
    • Vercel: Add domain in project settings
    • Netlify: Add domain in site settings
    • VPS: Point A record to server IP

SSL Certificate ​

  • Vercel/Netlify: Automatic SSL
  • VPS: Use Let's Encrypt with Certbot

DNS Records ​

Type    Name    Value
A       @       YOUR_SERVER_IP
CNAME   www     yourdomain.com

Post-Deployment ​

Verify Deployment ​

  1. Homepage loads: Check all sections render
  2. Admin panel works: Login at /admin
  3. Images display: Media loads correctly
  4. Forms work: Test contact form
  5. SEO correct: Check meta tags

Set Up Monitoring ​

  • Uptime: Use UptimeRobot or Better Uptime
  • Analytics: Configure Google Analytics or Plausible
  • Errors: Set up Sentry for error tracking

Next Steps ​

Choose your deployment platform:

  • Vercel - Recommended for most users
  • Netlify - Great alternative
  • VPS - For full control

Released under the MIT License.