Self-hosted climate transparency for enterprises
Deploy OpenEco to Vercel for demos, previews, or small-scale production deployments.
Time: ~10 minutes
Open-Eco/oe-corewebAdd these in Vercel project settings:
| Variable | Value | How to Get |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | See Database Options |
NEXTAUTH_SECRET |
Random 32+ char string | openssl rand -base64 32 |
NEXTAUTH_URL |
Your Vercel URL | https://your-project.vercel.app |
NEXT_PUBLIC_APP_URL |
Same as NEXTAUTH_URL | https://your-project.vercel.app |
Click Deploy and wait ~2-5 minutes.
After first deploy:
# Clone repo locally
git clone https://github.com/Open-Eco/oe-core.git
cd oe-core/web
# Pull Vercel environment variables
vercel env pull .env.local
# Run migrations
npx prisma generate
npx prisma db push
Best for Vercel deployments
DATABASE_URLFree tier: 0.5 GB storage, perfect for demos
DATABASE_URLFree tier: 500 MB database
DATABASE_URLdemo.open-eco.orgType: CNAME
Name: demo
Value: cname.vercel-dns.com
After adding domain:
NEXTAUTH_URL=https://demo.open-eco.org
NEXT_PUBLIC_APP_URL=https://demo.open-eco.org
Then redeploy.
A 404 Not Found response after deployment is one of the most common issues with OpenEco on Vercel.
web — OpenEco’s Next.js app lives in web/. If Vercel builds from the repository root it cannot locate the application, causing all routes to return 404.vercel.json — Invalid rewrites, redirects, or routes entries can send requests to paths that do not exist.outputDirectory to anything other than .next (the Next.js default) prevents Vercel from serving the compiled app.Step 1: Check the Root Directory setting
web., change it to web and redeployStep 2: Verify vercel.json
The repository-level vercel.json should look like this (no outputDirectory or framework overrides needed):
{
"buildCommand": "npm run build",
"installCommand": "npm install",
"functions": {
"app/api/**/*.ts": {
"memory": 1024,
"maxDuration": 10
}
}
}
Step 3: Review build logs
✓ Compiled successfully and a route listing.next output indicate a build failureStep 4: Confirm the build output locally
cd web
npm install
npm run build
ls -la .next/ # Should list: cache/, server/, static/, BUILD_ID, etc.
Step 5: Test a known route
Visit https://your-project.vercel.app/ and https://your-project.vercel.app/api/health. If only specific routes return 404, the issue is in Next.js routing rather than Vercel configuration.
| Setting | Correct Value |
|---|---|
| Root Directory | web |
| Framework Preset | Next.js (auto-detected) |
| Build Command | npm run build |
| Output Directory | .next (auto-detected) |
| Install Command | npm install |
An empty Root Directory causes Vercel to look for next.config.js in the repository root (where it does not exist), producing a build error or 404 on all routes.
Solution: Ensure web/package.json has:
"scripts": {
"postinstall": "prisma generate"
}
Check:
DATABASE_URL is set?sslmode=require for managed databasesCheck:
NEXTAUTH_URL matches your actual deployment URLNEXTAUTH_SECRET is set (32+ characters)https:// prefixLocated in repository root. Key settings:
{
"buildCommand": "npm run build",
"installCommand": "npm install",
"functions": {
"app/api/**/*.ts": {
"memory": 1024,
"maxDuration": 10
}
}
}
Important: Do not add
"framework","outputDirectory", or"routes"keys unless you have a specific reason — Next.js auto-detection handles these correctly when Root Directory is set toweb. Incorrect values for these keys are a common cause of 404 errors after deployment. See Troubleshooting: 404 Not Found Error for details.
Automatically applied:
X-Content-Type-Options: nosniffX-Frame-Options: DENYReferrer-Policy: strict-origin-when-cross-originContent-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';| Feature | Vercel | Self-Hosted |
|---|---|---|
| Setup Time | 10 min | 2-4 hours |
| SSL/HTTPS | Automatic | Manual |
| Scaling | Automatic | Manual |
| Database | External | Included |
| Best For | Demos, small teams | Enterprise, production |
When to self-host:
See INSTALLATION.md for self-hosted deployment.
For complete Vercel deployment documentation with advanced configuration, see:
VERCEL_DEPLOYMENT.md in the repository root
Estimated Time: 10-15 minutes
Difficulty: Easy
Best For: Demos, previews, small teams
Part of the OpenEco Documentation