Cloud Run Alternatives: Free Self-Hosted Platforms
If you want to move away from Google Cloud Run but stay on a free, self-hosted platform, your best options are open-source PaaS tools like CapRover, Dokku, and Coolify. These let you deploy containerized apps with a simple Git push or web UI, run on your own hardware or a cheap VPS, and have no per-use fees. This article explains how they compare, what they cost in time and resources, and how to pick the right one for your projects.
What Cloud Run Does and Why You Might Leave
Cloud Run is Google’s serverless container platform. You give it a Docker image, and it scales instances from zero to thousands based on HTTP traffic. You pay only for the time requests are being processed (plus a small monthly free tier). The appeal is zero infrastructure management: no servers to patch, no Kubernetes to operate, and automatic TLS certificates.
However, Cloud Run has limitations that push some developers to self-host. The free tier is generous for low traffic but becomes expensive with sustained load. Cold starts can add latency. Vendor lock-in means you use Google-specific configuration (YAML files, IAM, and build triggers). And some workloads—long-running background jobs, WebSockets with high concurrency, or stateful services—don’t fit the serverless model well. Self-hosting gives you full control, predictable costs, and no per-request billing.
How Self-Hosted PaaS Works
These platforms are essentially a control panel that runs on your server and manages Docker containers for you. You install the platform (usually via a script or Docker Compose), connect your Git repository or upload an image, and it builds, runs, and exposes your app on a domain with HTTPS. They handle reverse proxying, load balancing, and restarting failed containers.
Most use Docker under the hood, so any app that can be containerized works. You get a web dashboard to view logs, set environment variables, and manage domains. Some, like CapRover, include one-click apps (databases, WordPress, etc.) for quick setup. Others, like Dokku, are more minimal and scriptable.
Top Free Self-Hosted Alternatives
- Dokku – The “mini-Heroku.” Runs on a single server, uses Git push to deploy, and supports Dockerfiles and buildpacks. Extremely stable and well-documented. Best for developers who like the command line and want a lightweight, no-frills platform.
- CapRover – A full web UI on top of Docker Swarm. Offers one-click apps, easy SSL, and a simple API. Good for teams or individuals who prefer a graphical interface and want to deploy multiple apps on one server.
- Coolify – A newer, open-source PaaS that supports multiple servers, Docker, and even Kubernetes. It has a polished UI and supports many languages. Great if you want a modern experience and are comfortable with a faster-moving project.
- Fly.io – Not fully self-hosted (it’s a commercial platform), but has a generous free tier and lets you run containers close to users. If you want serverless-like simplicity without managing hardware, it’s worth considering, but it’s not self-hosted.
How to Choose the Right One
Your choice depends on your comfort with servers and your deployment workflow.
- If you want the simplest possible setup and don’t mind the command line: choose Dokku. It’s one command to install, and deployment is just
git push dokku master. - If you want a web UI and one-click apps: choose CapRover. It’s easier for non-DevOps folks and has a friendly dashboard.
- If you want modern features and multi-server support: choose Coolify. It’s actively developed, but expect occasional breaking changes.
- If you already use Docker Compose: all three support it, but CapRover and Coolify have better integration.
Also consider your server resources. Dokku and CapRover run fine on a 1GB RAM VPS, while Coolify is a bit heavier (2GB recommended). All require a domain name pointing to your server for HTTPS to work.
Common Problems and How to Solve Them
The biggest issue people hit is getting HTTPS certificates. Let’s Encrypt requires your domain to point to your server’s IP. Make sure you set an A record (and AAAA for IPv6) before enabling SSL. If certificates fail, check DNS propagation and that port 80/443 are open in your firewall.
Another problem is persistent storage. Containers are ephemeral, so databases and user uploads must be stored in volumes. Each platform has a way to attach persistent storage (e.g., Dokku’s volumes plugin, CapRover’s “Persistent Directories”). Always back up these volumes—if you lose the server, you lose the data.
Scaling is also different. These platforms scale vertically (bigger server) or by running multiple containers on the same host, but they don’t auto-scale to zero like Cloud Run. If you need zero-idle scaling, you’ll need to add a load balancer or use a Kubernetes-based platform, which is more complex.
Cost Comparison: Free vs. Cloud Run
Self-hosting is “free” in software cost, but you pay for a server. A basic VPS with 1GB RAM costs around $5/month (or less with annual plans). That’s often cheaper than Cloud Run once you exceed the free tier. However, you also pay for your time: patching the OS, securing the server, and maintaining the platform. If your time is valuable, Cloud Run might be cheaper overall.
Hidden costs include bandwidth (most VPS providers charge for data transfer over a limit) and backups (you need to set them up manually). Cloud Run’s free tier includes 2 million requests/month, which is plenty for a hobby project. For production, self-hosting on a $5 VPS can handle moderate traffic without issue.
Security and Maintenance Considerations
Self-hosting puts security on you. You must keep the host OS updated, use SSH keys, and configure a firewall. The PaaS itself (Dokku, CapRover, Coolify) is generally secure if you follow their docs, but you’re responsible for applying updates. Set up automatic unattended upgrades for the OS, and regularly update the platform itself.
Also, consider isolation. If you run multiple apps on one server, a vulnerability in one app could compromise the others. Use Docker’s network isolation (each app gets its own container) and avoid running untrusted code. For high-value projects, a separate VPS per app is safer.
Frequently Asked Questions
Can I use these platforms on a Raspberry Pi at home? Yes, Dokku and CapRover run on ARM, but performance will be limited. They work fine for low-traffic personal projects, but don’t expect to handle much load. Coolify also supports ARM, but check its docs for current support.
Do I need to know Docker to use them? Not necessarily. You can deploy from a Git repo with buildpacks (Dokku) or use one-click apps (CapRover). But understanding Docker helps when you need custom configurations or persistent storage.
Can I migrate an existing Cloud Run service to these? Yes, if your service is already containerized. You’ll need to adjust environment variables and maybe rewrite the Dockerfile to expose the right port. The migration is straightforward if you use standard HTTP.
What about WebSockets and background jobs? All three support WebSockets (CapRover and Dokku need a small config change). For background jobs, you can run a separate container or use a queue like Redis. Cloud Run has limitations here, so self-hosting is often better.
Is there a free tier on these platforms themselves? The software is open-source and free. You only pay for the server. Some providers offer free tiers for VPS (e.g., Oracle Cloud’s Always Free), but those are separate from the PaaS software.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.