Deployment
This framework is designed exclusively for the Bun runtime. All deployment environments must have Bun installed.
Verifying Bun Installation
bun --version# Should return v1.2 or higher
Deployment Targets
1. Traditional Servers (VPS/Bare Metal)
# Install Buncurl -fsSL https://bun.sh/install | bash
# Clone your projectgit clone your-project.gitcd your-project
# Install dependenciesbun install
# Start production serverbun run start
2. Containerized Deployment (Docker)
FROM oven/bun:latest
WORKDIR /appCOPY . .
RUN bun install
CMD ["bun", "run", "start"]
3. Platform-as-a-Service
Recommended Providers:
- Railway.app
- Render.com
- Fly.io
All require:
- Bun buildpack selection
start
script in package.json- Environment variables configuration
Configuration
Essential Environment Variables
APP_ID=MONITOR_SECRET=ENV=developmentPORT=3000MODE=fullstack
Startup Scripts
{ "scripts": { "start": "bun cmd.ts start", "tests": "bun cmd.ts tests", "migrate": "bun cmd.ts migrate" }}
Performance Tuning
Bun Runtime Flags
# Enable optimized production modebun run --smol start
# Memory limits (adjust based on your needs)BUN_MEMORY_LIMIT=512MB bun start
Monitoring
Health Check Endpoint
app.get('/health', (req, res) => { res.status(200).json({ status: 'healthy', version: Bun.version });});