Appearance
Deployment Overview
Deploy your Portfolio CMS to production and make it available to the world.
Deployment Options
| Platform | Best For | Difficulty | Cost |
|---|---|---|---|
| Vercel | Easiest deployment | Easy | Free tier available |
| Netlify | Static + Functions | Easy | Free tier available |
| VPS | Full control | Medium | $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:
| Provider | Free Tier | Notes |
|---|---|---|
| Neon | 512MB | Serverless, auto-scaling |
| Supabase | 500MB | Full Postgres features |
| Railway | $5 credit | Easy setup |
| Vercel Postgres | 256MB | Native integration |
S3 Storage
For media uploads, set up S3-compatible storage:
| Provider | Free Tier | Notes |
|---|---|---|
| Cloudflare R2 | 10GB | No egress fees |
| AWS S3 | 5GB | Industry standard |
| DigitalOcean Spaces | None | Simple pricing |
| Backblaze B2 | 10GB | S3 compatible |
Content
- All content is entered and published
- Images are uploaded and optimized
- SEO settings are configured
- 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 startBuild 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:typesMissing Dependencies:
bash
# Reinstall dependencies
rm -rf node_modules
pnpm installMemory Issues:
bash
# Increase Node.js memory
export NODE_OPTIONS="--max-old-space-size=4096"
pnpm buildDatabase Setup
Creating the Database
Neon (Recommended):
- Sign up at neon.tech
- Create a new project
- Copy the connection string
Supabase:
- Sign up at supabase.com
- Create a new project
- Go to Settings > Database
- Copy the connection string
Running Migrations
After setting up the database:
bash
# Run migrations
pnpm payload migrateOr if your platform supports it, add to build command:
bash
payload migrate && pnpm buildS3 Storage Setup
Cloudflare R2 (Recommended)
- Sign up for Cloudflare
- Go to R2 > Create bucket
- Create API token with R2 permissions
- 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-keyCORS Configuration
For R2, configure CORS in bucket settings:
json
[
{
"AllowedOrigins": ["https://yourdomain.com"],
"AllowedMethods": ["GET", "PUT", "POST"],
"AllowedHeaders": ["*"],
"MaxAgeSeconds": 3000
}
]Domain Setup
Custom Domain
- Purchase domain from registrar (Namecheap, Cloudflare, etc.)
- 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.comPost-Deployment
Verify Deployment
- Homepage loads: Check all sections render
- Admin panel works: Login at
/admin - Images display: Media loads correctly
- Forms work: Test contact form
- 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: