The core loop is plumbing: take a Git webhook, build in a container, swap the running version, give each branch a subdomain and issue certificates. One VPS with Docker and Caddy handles a handful of personal projects, and an agent can build that scaffold in a weekend. What you can't copy is the global CDN, DDoS protection and functions that scale per request. Next.js itself runs fine on a plain Node server, but past one instance you supply your own shared cache. If you just want the result, Coolify or Dokploy are the shorter path.
Before you buildVercel Hobby is free for personal, non-commercial projects, so a hobby site may not need any of this. The commercial-use rule is the one that forces a move.
Build me a tiny self-hosted deploy server to replace Vercel for my personal sites. Requirements: - Node.js 22 + TypeScript on one Linux VPS. `npm start` runs a daemon on :4900 with an admin UI and a webhook endpoint at /hook/github. - Docker does the building: use `dockerode` to run each build in a throwaway container (default image `node:22`, runs the project's build script), then copy the output into either a static folder served by Caddy or a Node container started with the project's start command. - Caddy is the front door: generate a Caddyfile from the project list and reload it through Caddy's admin API. Use a wildcard *.apps.example.com plus per-project custom domains, all with automatic HTTPS. - Storage: better-sqlite3 in ./data/deploy.db: projects (repo URL, production branch, build and start commands, port), deployments (commit SHA, status, build log, timestamps) and environment variables, encrypted at rest with a key from .env and scoped to production or preview. - Webhook: verify X-Hub-Signature-256 (HMAC with GITHUB_WEBHOOK_SECRET). A push to the production branch deploys to <project>.apps.example.com; a push to any other branch deploys to <branch>--<project>.apps.example.com, removed when the branch is deleted. - Swap with no downtime: start the new container, wait for a 200 on a health path (30 s timeout), switch Caddy, stop the old one. Keep the last 5 deployments so a Roll back button only re-points Caddy. - Admin UI (server-rendered, one password in .env): project list, deployment history with build logs streamed over SSE, environment variable editor, roll back, delete project. Single user, no telemetry. - Limits: one build at a time, 15-minute build timeout, 512 MB memory cap per container, and the Docker socket is never mounted into build containers. - Out of scope: edge functions, a CDN, serverless scaling, teams, analytics. - README: DNS records to add, ports to open (80 and 443), and a warning that builds run code from your repositories, so deploy only repos you control.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Vercel.
Add a build cache to the deploy server in this folder. Requirements: - Mount a per-project Docker volume at the package manager's cache directory (npm, pnpm and yarn) and reuse node_modules when the lockfile hash is unchanged. - A Clear cache button per project and a cache size readout. - Never share a cache between projects. - Show "cache hit" or "cache miss" in each deployment's log header. - Update the README.
Add notifications to the deploy server in this folder. Requirements: - Set a GitHub commit status (pending, success, failure) with a link to the preview URL, using a fine-grained token in .env. - Post a message to a Discord or Slack incoming-webhook URL when a production deploy succeeds or fails. - Include the commit message, author and build duration, and never include environment variable values. - Update the README.
Add scheduled jobs and a worker process type to the deploy server in this folder. Requirements: - Per project, define cron jobs with a schedule and a command, run in the project's latest production image with its environment variables. - Keep the last 20 runs of each job with exit code, duration and output. - Allow one extra long-running worker command per project with automatic restart and a log view. - Update the README.
Add traffic stats to the deploy server in this folder. Requirements: - Configure Caddy to write JSON access logs per project, and ingest them every minute into SQLite. - Show requests per day, top paths, status code counts and bandwidth for the last 30 days; ignore known bots by user-agent. - Do not store IP addresses; keep only a daily salted hash for unique-visitor counts. - Update the README.
Connecting a repository gives you a production build on every merge and a preview link on every branch, with no servers to run. Teams pay for that speed, for free viewer seats so reviewers can comment, and for infrastructure that scales without attention. The usual complaint is that the bill follows traffic once the monthly credit is gone.
Estimate · A small VPS runs a few sites, and you likely already own a domain. The build is token usage on your agent plan; expect more turns than most entries while Docker and Caddy permissions get sorted out.
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Hobby | $0 | $0 | 200 projects, 1 developer seat, 100 deployments a day, 1M CDN requests, 100 GB of fast data transfer, 1M function invocations and 4 CPU-hours of function compute a month, 1 hour of runtime logs. |
| Pro | $20 | — | A $20 platform fee that includes one deploying seat and $20 of monthly usage credit; unlimited projects, up to 6,000 deployments a day, 1 TB of data transfer, 1 day of runtime logs, free read-only viewer seats. |
| Pro extra seat | $20 | — | Each additional Owner or Member seat that can configure and deploy projects. |
| Enterprise | custom | — | Custom limits, audit logs, SCIM, 12 custom environments and 3 days of runtime logs. |
Hobby is free but limited to personal, non-commercial use, with usage caps and no way to buy more.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: A global CDN and edge network in front of every deployment, DDoS mitigation and a managed firewall.
About $20 a month on the Pro plan per seat, $240 a year (checked 2026-10-14).
A global CDN and edge network in front of every deployment; DDoS mitigation and a managed firewall; Functions that scale per request without a server to patch; Web analytics, Speed Insights and runtime logs; Team roles, free viewer seats and comments on preview deployments. If any of those matter to you, keep paying.
Yes: Coolify (open source), Dokploy (open source), Dokku (open source).