Deployment options
Typeset can be deployed to any platform that supports Next.js applications:- Vercel (recommended) - Zero-config deployment with automatic scaling
- Docker - Containerized deployment for any cloud provider
- Node.js server - Traditional server deployment
- AWS, GCP, Azure - Cloud platform deployments
Deploy to Vercel
Vercel is the recommended deployment platform for Typeset. It provides:- Automatic HTTPS certificates
- Global CDN for static assets
- Serverless API routes with auto-scaling
- Zero-config deployment
- Built-in analytics and monitoring
Deploy
From your project directory:This will:
- Build your Next.js application
- Upload the build to Vercel
- Provide a preview URL
Configure environment variables
Add environment variables in the Vercel dashboard:
- Go to your project settings
- Navigate to Environment Variables
- Add each variable:
Vercel deployment via GitHub
For continuous deployment:Import to Vercel
- Go to vercel.com/new
- Click Import Git Repository
- Select your repository
- Configure project settings (automatic for Next.js)
- Add environment variables
- Click Deploy
Vercel configuration
Createvercel.json in your project root for advanced configuration:
vercel.json
regions- Deployment regions (e.g.,iad1for US East)buildCommand- Custom build commandinstallCommand- Custom package installationfunctions- Serverless function configuration
Tectonic binary on Vercel
The Tectonic binary must be included in your deployment:- Ensure
bin/tectonicis committed to your repository - Verify the binary is executable:
- The binary will be included in the deployment automatically
- Max deployment size: 50 MB (Typeset with Tectonic: ~40 MB)
- Max function size: 50 MB
/tmpstorage: 512 MB (for LaTeX package cache)- Function timeout: 10 seconds (Hobby), 60 seconds (Pro), 900 seconds (Enterprise)
LaTeX compilation may timeout on Vercel Hobby plan (10 seconds). Upgrade to Pro for 60-second function execution.
Deploy with Docker
Deploy Typeset as a containerized application:Docker Compose
For easier container management:docker-compose.yml
Deploy Docker to cloud platforms
Deploy to traditional Node.js server
For deployment on a VPS or dedicated server:Copy files to server
Transfer these files to your server:
.next/- Built applicationpublic/- Static assetsbin/- Tectonic binarypackage.json- Dependenciesnode_modules/- Or runpnpm install --prodon server
Production checklist
Before going live, verify:Security
- HTTPS enabled with valid SSL certificate
- Environment variables are secured (not in source control)
- Production API keys configured (not test keys)
- Clerk webhook signing secrets configured
- CORS properly configured if using separate API domain
Performance
- Next.js production build completed successfully
- Static assets served from CDN
- Tectonic binary is executable and cached
- LaTeX package cache directory has sufficient space
- Database connection pooling configured (if applicable)
Monitoring
- Error tracking configured (e.g., Sentry)
- Log aggregation set up
- Uptime monitoring enabled
- API usage monitoring for third-party services
- Disk space alerts for LaTeX cache
Scaling considerations
Horizontal scaling
For high-traffic deployments: Vercel Vercel automatically scales serverless functions. No additional configuration needed. Docker/Kubernetes Scale horizontally with multiple containers:Performance optimization
LaTeX package caching Share Tectonic cache across instances:public/ and .next/static/:
next.config.ts
- Use connection pooling
- Enable read replicas for queries
- Implement caching with Redis
Troubleshooting
Build fails on Vercel
- Check build logs in Vercel dashboard
- Verify all dependencies are in
package.json - Ensure Node.js version matches (20.x)
- Check for TypeScript errors:
pnpm tsc --noEmit
Function timeout errors
- Upgrade to Vercel Pro for longer function execution
- Optimize LaTeX compilation (remove unnecessary packages)
- Implement compilation caching
- Pre-warm Tectonic cache with common packages
Tectonic binary not found
- Verify binary exists in
bin/tectonic - Check file permissions:
chmod +x bin/tectonic - Ensure binary is committed to Git
- Verify platform matches (Linux x86_64)
Collaboration not working
- Check Liveblocks API key is correct
- Verify WebSocket connections are allowed (check firewall)
- Test
/api/liveblocks-authendpoint - Check browser console for errors
High memory usage
- Monitor LaTeX package cache size
- Implement cache cleanup for old packages
- Limit concurrent compilations
- Use Vercel Pro for larger memory limits
Next steps
After deployment:- Monitor application performance and errors
- Set up automated backups (if using database)
- Configure CI/CD for automatic deployments
- Implement rate limiting for API routes
- Set up staging environment for testing
Join the Typeset community for deployment support and best practices.