Leaving a hosted PaaS is less a leap than a sequence. The usual surprises are not "Docker is hard". They are an environment variable nobody listed, a release-phase migration that only the old platform ran, a Postgres add-on that was never dumped, or a DNS cut that happened before the new health check passed.
You can move an app onto a server you own and keep the old side running until the new one has proved itself. This is the order that makes that boring.
1. Inventory what the platform is doing for you
Write down everything the current platform provides, not just the web process:
- Process types: web, workers, cron or scheduled jobs, and any one-off release command.
- The datastore: Postgres, Redis or something else, including the major version, and whether you have a recent backup you have restored.
- Environment variables, and which of them are secrets.
- Domains and certificates, and who owns the DNS.
- File storage, email, background queues and other add-ons you will have to replace or point at a new host.
- How the app is built: a Dockerfile, a buildpack, or a
compose.yaml.
On Heroku:
heroku ps --app your-app heroku addons --app your-app heroku config -s --app your-app > prod.env heroku domains --app your-app heroku pg:info --app your-app Treat prod.env as secret. It does not belong in git, in a chat or in a ticket. For Render or Railway, export the same list from the dashboard or from the infrastructure file you already use. The names differ; the inventory should not.
Lower the TTL on your production records now, while nothing else is changing, so the later cutover is not waiting on a day-old cache.
2. Get a server that will still be yours after you leave
Pick a Linux VPS in an account you control. You will need Docker Engine 28 or newer, and a current Ubuntu, Debian, RHEL-family, Fedora or Amazon Linux release. The app, the database and the proxy will run there. If the control plane you use later goes away, those workloads should keep running on that server.
Do not point production DNS at this machine yet. Give it a hostname you can hit for tests, and open only 80 and 443 (plus SSH, until you have another path in).
3. Make the app build in a way that is not tied to the old platform
A Dockerfile is the portable unit. If you already have one, use it. If you do not, this is the moment to add one, or to use a builder that takes the same repository and produces an image on your server.
Pin the image you deploy by digest, not only by a tag. Record the digest when you pull or build, so a rollback is a redeploy of the same image, not a rebuild that may not match.
docker build -t web:move . docker images --digests --no-trunc web:move Set a health check the new side can run before it takes traffic: an HTTP path such as GET /healthz, or a TCP check if you have nothing else. If the app has a release-phase migration, run that command from the new image, with a time limit, before any switch. If it fails, stop; the old platform is still serving.
4. Move the configuration, then the data
Load the non-secret variables onto the new service. Set secrets in a way that does not leave them in your shell history, or in a control plane that does not need them in plaintext.
Then copy the database. Take a fresh dump from the current primary, restore it to a Postgres on the new server, and compare. Leave the old database running. A typical Postgres path looks like this:
# from the current platform, into a custom-format dump pg_dump "$SOURCE_DATABASE_URL" --format=custom --no-owner --no-acl --file=app.dump # onto the new server's database pg_restore --no-owner --no-acl --dbname="$TARGET_DATABASE_URL" app.dump On Heroku you can also use heroku pg:backups:capture --app your-app and heroku pg:backups:download --app your-app. Restore into a database that is not yet serving production traffic. Check row counts, a few known records, and that the app can boot against the copy.
If the app writes continuously, plan a short freeze or a follow-up sync for the final cut.
5. Prove the new side before you cut DNS
Deploy the image on the new server, run migrations from that image, start it, and hit the health check on the new hostname. Click through the real user paths: sign in, a write, and a background job if you have one.
Only then attach the domain. Keep the old platform live so you can send traffic back if you need to. When you are ready, point the records at the new servers, wait until you see traffic and healthy checks, and watch logs before you tear anything down.
How Unrent fits
Unrent is a hosted control plane that deploys apps and Postgres onto servers you already own. An agent on the server connects out, so Unrent holds no SSH key and opens no inbound port. Your app keeps running if Unrent is down.
You can connect a server you already have, or have Unrent create one in your own account on Hetzner, DigitalOcean, Vultr, Akamai (Linode), Scaleway, UpCloud, AWS EC2, Amazon Lightsail, Google Cloud, Azure or OVHcloud.
Add the app as an image, or from a GitHub, GitLab, Bitbucket or Gitea/Forgejo repository. If the repository has a Dockerfile, Unrent builds it on your server and deploys the image by digest. If it has a compose.yaml and no Dockerfile, it deploys as a stack. Otherwise Railpack can detect the language; you can also choose Cloud Native Buildpacks. Set the port and a health check. Values you mark as secret are sealed in your browser to the server, so Unrent stores only ciphertext.
Create a Postgres 17 or 18 database on the same server and link it to the service. Linking writes DATABASE_URL and the usual PG* variables into the service's config. Restore your dump into that database, then deploy. The run view shows pull or build, the pre-deploy command, start, health check and the switch. A release that fails its health check never receives traffic.
For the domain, add it to the service and create the TXT and A/AAAA (or CNAME) records Unrent shows you. The TXT record on _unrent-challenge proves the name is yours. Once the checks pass, the domain goes live and gets a Let's Encrypt certificate on its first visit. Every service also gets an HTTPS address on unrent.page that you can use as the test hostname, before you touch production DNS.
After the cut, add an S3-compatible bucket for backups (Amazon S3, Cloudflare R2, Backblaze B2 or another compatible service) and check that a restore works. The old platform can stay up as a fallback until you are sure you will not need it.
The order, one more time
- Inventory processes, add-ons, config, domains and the database. Lower DNS TTLs.
- Put a server in an account you control. Do not cut DNS yet.
- Build a pinned image, with a health check and a migration command.
- Copy config, then restore a fresh database dump into a new Postgres, and verify it.
- Deploy, pass the health check, and exercise the app on a temporary hostname.
- Point DNS at the new side, watch it, and only then take the old platform down.
The move is done when the app, the data and the domain are on infrastructure you can keep without the old platform, and you have already seen the new side serve real traffic.
More at unrent.dev.