Moving off Vercel, Heroku, Render or Railway to your own server
The self-hosted alternative to a hosting platform: what you take over, when to stay, what a server costs, the three ways to run one, and a tested migration path to DNS cutover.
TL;DR
- The self-hosted alternative to Vercel (opens in a new tab), Heroku (opens in a new tab), Render (opens in a new tab) or Railway (opens in a new tab) is your app in Docker (opens in a new tab) on a server you rent or own, with a reverse proxy for HTTPS, its database beside it, and something that does the platform's deploy work: you, a self-hosted PaaS (Coolify (opens in a new tab), Dokploy (opens in a new tab), CapRover) or a deploy tool (Kamal, OpsCrew).
- A 2 vCPU, 4 GB Hetzner (opens in a new tab) server cost a flat €16.99 a month excluding VAT in Helsinki on 11 November 2026 for the app, its worker, cron jobs and database together, but the upkeep becomes yours.
- The move is a checklist: inventory, a portable image, a hardened server, the data copied with
pg_dumpandpg_restore, workers and cron, a rehearsal, a low DNS TTL, the cutover, and the old platform kept as the way back. - Stay on the platform if a free plan fits, your traffic needs autoscaling or a global edge, or nobody can own a server.
On this page
The self-hosted alternative to Vercel, Heroku, Render or Railway is your app running in Docker on a server you rent or own, behind a reverse proxy that handles HTTPS, with its database on the same server, plus something that does the platform's deploy work. You trade a per-service, often usage-based bill for a flat server price and take over the upkeep the platform did for you.
Each part of the move has a deeper article:
- Vercel alternatives: hosted, self-hosted and in Europe compares the hosted options, their free tiers and limits, and your own server.
- Heroku alternatives for apps that need a database prices a web process, a worker and PostgreSQL (opens in a new tab) on each platform and a server.
- Self-hosted PaaS compared sets out what Coolify, Dokploy, CapRover and Kamal manage and what they leave to you.
- Migrate a Heroku app and its Postgres database to a VPS is the tested move, from the Procfile to the DNS cutover and back.
- Hosting a Next.js app in the EU without Vercel sets out where each provider runs and processes data.
What a platform does for you
Each job the platform does today needs a new owner on your own server:
| Job | On Vercel, Heroku, Render or Railway | On your own server |
|---|---|---|
| Build each release | The platform builds from Git | CI builds a Docker image and pushes it to a registry |
| HTTPS and routing | Automatic | A reverse proxy such as Caddy (opens in a new tab) gets and renews certificates |
| Running the processes | Functions, dynos or services | Docker Compose: web, worker and cron as containers |
| Database and its backups | Managed add-on or marketplace provider | PostgreSQL in a container; dumps and copies off the server are yours |
| Scheduled jobs | Vercel cron, Heroku Scheduler, cron services | A cron in a container (such as supercronic) or the host's cron |
| Updates without downtime | Built in | Two copies and a proxy that switches, or a short restart |
| Previews of pull requests | Built in on most | A second server and a workflow, or a tool that does it |
| Operating system patches | The platform's job | Automatic security updates, which you turn on and watch |
| Scaling | A setting, or automatic | A bigger server, or more servers behind a load balancer |
| Support and SLA | Paid tiers | Your provider's support for the server; the rest is you |
No row is hard on its own, but a migration that skips one (usually backups or patching) has only moved the risk.
When staying is the right call
Stay where you are when:
- A free plan fits. Vercel's Hobby plan is free for personal, non-commercial projects; Netlify and Cloudflare (opens in a new tab) have free plans with limits. A server costs money every month.
- Your traffic jumps without warning and the app must scale out by itself, or it needs to run close to users on several continents.
- You rely on what a front-end cloud does best: a global CDN in front of every page, preview deployments with comments and protection, or features tied to the platform.
- Nobody can own a server. Someone has to read the alert when the disk fills up.
- Your app is one small web process. On 11 November 2026, Heroku's Basic dyno cost $7 a month and Render's Starter instance $7, while Hetzner's CPX12 (1 vCPU, 2 GB) cost €9.99 excluding VAT in Helsinki, and its cheaper Cost-Optimized servers, from €5.99, were listed as unavailable; the bills are close, and on the server you add the upkeep.
If the price or a limit is the problem but you still want someone else to run servers, switch platforms instead: see Vercel alternatives and Heroku alternatives.
Heroku's own status is not a reason by itself: in February 2026 it moved to what it calls a sustaining engineering model, with "no change for customers using Heroku today", and it still ships maintenance updates.
What it costs instead
A platform charges per service, per database and often per seat or by usage; a server charges one flat price for whatever fits on it.
| Where | A month | What changes as you grow |
|---|---|---|
| Heroku | $19 (two Basic dynos, Postgres Essential-0) | Each process and each database plan is a line |
| Render | about $20.30 (two Starter instances, Postgres 256 MB plus 1 GB of storage) | Each service and the bandwidth beyond 5 GB |
| Vercel | $20 for Pro, plus a database from a Marketplace provider | Usage beyond the included credit and CDN tier; each developer seat |
| Railway | At least $5 on Hobby, then usage by the second | Memory, CPU, volumes and egress you use |
| Hetzner CPX22, Helsinki | €16.99, excl. VAT (2 vCPU, 4 GB, 80 GB, 20 TB of traffic) | Nothing until the server is full; backups add 20% |
The platform's price includes upkeep; the server's does not include your time. And the table is a floor: bandwidth, bigger instances and backups are extra everywhere. Heroku alternatives for apps that need a database breaks the same app down on Fly.io and DigitalOcean (opens in a new tab) App Platform too, and our page comparing your own server and a hosting platform weighs cost against control, lock-in and effort.
A server wins clearly for the app with several parts: every extra worker, cron job, cache or second app is another line on a platform's bill and costs nothing extra on a server until its memory runs out.
Three ways to run a self-hosted Vercel or Heroku alternative
By hand
Docker Compose runs the app, its database and Caddy; a GitHub Actions (opens in a new tab) workflow builds each release as an image and tells the server to pull it. Our tested tutorials take this path: how to deploy a web app to a VPS is the complete guide, Deploy Next.js to a VPS does it for a Next.js (opens in a new tab) app, and zero-downtime deployments with Docker Compose adds updates that never drop a request.
Suits: people who want to understand every part and have time each month for updates and a restore test.
With a self-hosted PaaS
Coolify, Dokploy and CapRover are open-source dashboards you install on your server, with Git deploys, databases from templates, domains with automatic certificates and, depending on the tool, previews and database backups, in a web interface much like Heroku's or Vercel's. Kamal, from 37signals, does the deploy part from your terminal instead, with no dashboard. The software is free to self-host; Coolify, Dokploy and CapRover also sell paid plans or features, such as a hosted dashboard for your servers. They manage your apps, not the server: hardening, the provider's firewall and tested backups stay yours, and a dashboard is one more admin interface to keep updated. Self-hosted PaaS compared goes through the four.
Suits: several apps across one or more servers, managed from one place.
With a deploy tool
A tool on your computer writes the server's configuration and the deploy workflow into your repository, so nothing extra runs on the server and every change is reviewable. Kamal is one (a config file and kamal deploy); OpsCrew is another, covered below.
Suits: people who want the by-hand result without typing each step.
The migration, step by step
The order is the same on every platform; the Heroku migration tutorial walks it with real files.
1. Take stock
List the platform's jobs for your app from the table above, plus:
- every environment variable, and which ones the platform set for you (database URLs, add-on keys);
- processes: web, workers, the release or pre-deploy command;
- scheduled jobs, with their exact schedules and time zones;
- domains, redirects and headers (on Vercel, in
vercel.json); - platform packages in your code:
@vercel/*imports, platform SDKs, storage APIs; - the database: engine, version, size, extensions.
2. Make the app portable
The app should build into one Docker image and read everything that differs between environments from variables. Fix what ties it to the platform: a hard-coded database TLS setting (Heroku Postgres requires TLS; a PostgreSQL container on your server's private network has none by default), Vercel-only packages, absolute *.vercel.app or *.herokuapp.com URLs in OAuth callbacks and webhooks. For Next.js, standalone output and the build-time NEXT_PUBLIC_ variables are the main points; the v0 guide lists what changes when Next.js is not on Vercel.
3. Prepare the server
Choose a provider and a location near your users (Hetzner vs DigitalOcean compares two for a small app), create the server with SSH keys and a firewall at the provider that allows only SSH, HTTP and HTTPS, and harden it before it holds data: how to harden an Ubuntu 24.04 server for production covers SSH, updates and the rest. On a Docker host, published ports bypass ufw, so the provider's firewall is the one that counts (Docker ignores your UFW firewall).
4. Move the data
For PostgreSQL, the tools are the same everywhere: a custom-format pg_dump from the platform, pg_restore --no-acl --no-owner into the new database. On Heroku, heroku pg:backups:capture and heroku pg:backups:download give you the dump; on other platforms, run pg_dump against the database's connection string. Restore into the same or a newer PostgreSQL major version. Rehearse it once with the app still on the platform: you learn how long it takes and catch errors when they cost nothing.
Files in object storage (Vercel Blob, S3 buckets) are a separate copy; an app that keeps using its bucket by URL needs no move at all.
5. Recreate workers, cron and previews
Each worker becomes a container from the same image. Each scheduled job becomes a line in a crontab run by a cron made for containers, such as supercronic, in UTC. A server has no preview deployments by default, so plan them before you move if you rely on them: a preview of every pull request, on your own server shows a tested setup.
6. Rehearse on a temporary hostname
Point a spare subdomain at the server, start everything, and use the app there: sign in, create data, watch the worker.
7. Cut over
A day ahead, lower the TTL of the DNS records you will change to 300 seconds or less. In the window: stop writes on the old platform (Heroku has a maintenance mode; elsewhere, scale the app down or show a maintenance page), take the final dump, restore it, run migrations, start the stack, and switch the DNS records to the server. Start Caddy (or restart it) after the switch: when a certificate request fails, it retries with growing pauses, up to a day apart.
8. Keep the way back open, then clean up
Leave the old app and its database untouched for some days. Once you are confident, and once you have restored a backup on the new side (backups you can restore), remove the old app, its add-ons and its domains, and set up monitoring for the new server (monitoring a small server).
Notes per platform
Leaving Vercel
Next.js runs on any Node.js (opens in a new tab) server, so the app itself rarely changes. What you replace is around it: functions become one long-running server (no 300-second limit), vercel.json redirects, rewrites and headers move to next.config or the proxy, Vercel cron routes need something to call them on schedule, and image optimisation and caching run on your server. If your users are global and your pages are cacheable, consider keeping a CDN in front. Our page comparing your own server and Vercel goes through that one choice in detail.
Leaving Heroku
The Procfile maps directly: web behind the proxy, each other process as a container, release as a one-off container before each deploy. Config vars export with heroku config --shell. The traps are small: the database TLS setting, pg_restore --clean on an empty database, and Scheduler jobs that keep running during maintenance mode. All three are in the migration tutorial.
Leaving Render or Railway
Both already run your app as a long-running service, often from a Dockerfile, so the image usually moves as it is. Render's pre-deploy command, background workers and cron job services map to the same three pieces as on Heroku. Railway keeps service settings as config as code (TOML or JSON), and a cron job is a schedule set on a service; read those settings for the commands and schedules to carry over.
Users in Europe
For users in the EU, where your app runs and where the platform processes its own data both matter, and they are not the same thing: some platforms run your code in Frankfurt but say their primary processing is in the United States. A server in an EU location keeps the most in one place. Hosting a Next.js app in the EU without Vercel sets out what eight providers say, with a tested EU setup; it is not legal advice.
Doing this with OpsCrew
OpsCrew, the open-source tool we build, is a deploy tool for this move: AI agents on your computer that read your repository and do the server side, showing every change first and applying nothing until you approve the plan by its hash (how it works). It creates a server at Hetzner Cloud or DigitalOcean, or uses a server you already have, and hardens it. For an app coming off a platform:
- a
Procfile's process types other thanwebandreleasebecome workers, and cron jobs run with supercronic in a container of their own; thecronsof avercel.jsonbecome scheduled calls of the same routes with aCRON_SECRET, as Vercel sends (workers and cron jobs); - the redirects, rewrites and headers of a
vercel.jsonare carried into the reverse proxy's configuration (the reverse proxy); - the database runs next to the app with a generated password and no public port, or your hosted database is kept (databases), and a busy one can move to a server of its own (split placement);
- each pull request gets a preview;
opscrew adviseproposes a better size or a cheaper provider (advice on size and cost); a site with no server side can go to Cloudflare's hosting, free for static files.
OpsCrew does not read from Vercel, Heroku, Render or Railway: copying the data out of them and switching DNS away from them stay with you. Once the app runs under OpsCrew, opscrew retarget moves it with its data between the places OpsCrew deploys to (moving your app). It is free and in alpha (setup); you pay the provider for the server. How it compares with the self-hosted panels is on OpsCrew vs Coolify and Dokploy.
Key facts
| Fact | Value | Source |
|---|---|---|
| Heroku, web + worker + Postgres (smallest always-on) | 19 USD per monthTwo Basic dynos at $7 and Postgres Essential-0 at $5. | Heroku pricing (opens in a new tab)Verified on |
| Render, web + worker + Postgres (smallest always-on) | 20.30 USD per monthTwo Starter instances at $7, Postgres at $6 plus $0.30 for 1 GB of storage, on the $0 Hobby workspace. | Render pricing (opens in a new tab)Verified on |
| Vercel Pro | 20 USD per monthOne developer seat and $20 of usage credit; databases come from Marketplace providers. Hobby is for personal, non-commercial use. | Vercel pricing (opens in a new tab)Verified on |
| Railway Hobby | 5 USD per month, minimumIncludes $5 of usage; memory about $10 per GB-month and CPU about $20 per vCPU-month at its per-second rates. | Railway pricing (opens in a new tab)Verified on |
| Hetzner CPX22 in Helsinki (2 vCPU, 4 GB, 80 GB, 20 TB) | 16.99 EUR per month, excl. VAT€19.99 in Nuremberg. | Hetzner Cloud, Regular Performance (opens in a new tab)Verified on |
Frequently asked questions
How long does it take to move an app to my own server?
The cutover itself can be minutes for a small database: the time to dump and restore it, plus the DNS TTL. The preparation takes longer: containerising the app, setting up and hardening the server, and one rehearsal of the data move. Plan a day for a simple app the first time.
Can I move back to the platform if it goes wrong?
Yes, if you keep the old app and its database untouched until the new server has run for a while. Before any writes on the new server, rolling back is pointing DNS back. After writes, you copy the new data back with pg_dump and pg_restore first.
Sources
- Vercel pricing (opens in a new tab)
- Vercel Hobby plan (opens in a new tab)
- Heroku pricing (opens in a new tab)
- An Update on Heroku (opens in a new tab)
- Importing and exporting Heroku Postgres databases (opens in a new tab)
- Render pricing (opens in a new tab)
- Railway pricing (opens in a new tab)
- Hetzner Cloud, Regular Performance plans (opens in a new tab)
- Coolify repository (opens in a new tab)
- Dokploy repository (opens in a new tab)
- Kamal (opens in a new tab)
- Automatic HTTPS (opens in a new tab)
Related articles
- Deploying
How to deploy a web app to a VPS: the complete guide
From an empty server to a production app: server size, Docker, a reverse proxy with HTTPS, DNS, CI/CD, secrets, backups, zero-downtime updates, previews, logs and hardening.
- Security
Backups for a small production server that you can restore
What to back up on a single-server app, how to send an encrypted copy off the server with pg_dump and restic, what the provider's backups add, and the restore drill that proves it works. Every command tested.
- Deploying
Deploy a Docker Compose app to Hetzner with GitHub Actions
A Hetzner Cloud server set up by a tested cloud-init file, behind Hetzner's firewall, updated by a GitHub Actions workflow that builds your image, pushes it to GHCR and deploys it over SSH.