Background reading · 9 min read

Hosting Platforms Explained

Vercel, Railway, Render, Dokploy, Coolify, AWS and Kubernetes. See where each one fits and what it can and cannot do. The choice depends on one simple idea: stateless or persistent.

What this reading covers

  1. The hosting ladder
  2. Platform by platform: Vercel, Railway, Dokploy, AWS, Kubernetes
  3. Which platform runs what
  4. The real deciding factor: stateless vs persistent
  5. How to choose, practically

The hosting ladder

All hosting options sit on one ladder. As you go down the ladder, your control grows, and so does your responsibility for setup. At large scale, the cost usually goes down as well.

  1. Vercel / Railway / Render
    Managed PaaS (a service that runs your app for you). Almost no setup. You push code and they run everything.
  2. Dokploy / Coolify / CapRover
    Self-hosted PaaS. The same easy experience, but you install it on your own server.
  3. Raw AWS (this course)
    Full control over every layer. You build and secure everything yourself.
  4. Kubernetes / ECS
    Container orchestration (software that runs and manages many containers) for very large systems and big teams.
← Less work, less controlMore work, more control →

Platform by platform

1. Vercel

Vercel is built mainly for frontend code and for Next.js (a framework for building React websites that can also run backend code). You push to GitHub, and it builds and deploys your app automatically. It gives you free HTTPS and a global CDN (a network of servers around the world that keep copies of your files close to users). The developer experience is excellent.

Many people get one point wrong: Vercel can run backend code. Next.js API routes run as serverless functions. A serverless function is a small piece of backend code that the platform starts when a request arrives and stops afterwards. So “Vercel is frontend only” is not correct.

Where Vercel is a poor fit:

  • Long-running work. Every function has a time limit. The default is short, and the maximum depends on your plan and settings. The maximum is minutes, not hours. A heavy PDF job or a long calculation can be stopped half way. Check the current limits in Vercel's documentation.
  • WebSockets and other always-open connections. A WebSocket is a connection that stays open so the server and the browser can send messages to each other at any time. Vercel now has some WebSocket support, but a normal always-on server is simpler for this.
  • Background workers that keep running all the time. Vercel can run short background tasks and scheduled jobs (cron jobs, which are tasks that run at set times). It does not run a worker that never stops.
  • Some languages and frameworks. Python works. PHP and Laravel are not officially supported. Only a community runtime exists for PHP.
Vercel · free plan
10s
Vercel · paid plan
60s
Persistent server
no limit →
How long one request may keep running before the platform stops it.

2. Railway and Render

These are also managed PaaS, but they are made for full-stack applications, not only frontend. They run a real always-on server process for you. A process is a running program. They also offer managed PostgreSQL and Redis as add-ons (a managed database is one that the provider runs and backs up for you).

The price is based on usage, which means compute hours plus resources. For a long-running Node.js backend this is often cheaper than Vercel. Setup stays very easy. But you still do not own or control the machine underneath.

Good fit when

You want to launch fast and you need a real backend with background jobs. You do not want to learn about servers right now.

3. Dokploy, Coolify, CapRover

These are a different kind of thing, not just another step on the ladder. They are self-hosted PaaS software. Self-hosted means you run it yourself. They are open-source tools that give you an experience like Vercel: git push, automatic build, automatic deploy and automatic SSL (HTTPS certificates). But you install them on your own server. The server can be an AWS EC2 instance, a Hostinger VPS (a rented virtual server) or a DigitalOcean droplet (DigitalOcean's name for a rented virtual server). Any server that runs Linux will do.

So Dokploy is not a hosting company. It is a dashboard that you run on servers you already have.

Key insight

Dokploy needs exactly what this course teaches: a Linux server, networking, DNS (the system that turns a domain name into a server address), HTTPS (web traffic encrypted with a certificate) and Docker (a tool that packs an app into a container). If you learn raw AWS first, Dokploy is easy later. It is only software installed on an EC2 server that you already know how to secure and debug.

4. Raw AWS

Raw AWS gives you the most flexibility. You can put your frontend on S3 plus CloudFront (S3 stores the files and CloudFront delivers them fast and cheaply). Your backend runs on EC2, which is a virtual server. At the start you can also run both on one single EC2 server. That is simpler, and it is what we build first in this course.

The cost is mostly fixed for each resource, not for each request. A small EC2 server plus a small RDS database costs roughly $15 to $25 per month, whether you have 10 users or 500. (RDS is a database that AWS runs for you. Prices change by region, so check the current price list.)

5. Kubernetes and ECS

This is the advanced end. Kubernetes and ECS (the AWS container service) start, stop and connect many containers for teams that run many services at large scale. A container is a packaged app that runs the same everywhere. It is good to know these tools exist. But do not learn them yet. For a new SaaS (a product sold as an online subscription) they are too much.

Which platform runs what

PlatformFrontendBackendPHPMain catch
VercelExcellentServerless functionsNot officiallyNo always-on server process. Functions have time limits
Railway / RenderYesYes, real serverYesManaged, so less raw control than AWS
AWSYesYesYesYou set up every part yourself
DokployYesYesYesYou look after the server underneath it

So if your project is in PHP, Vercel is not a good choice. Railway, AWS, Dokploy or classic shared PHP hosting are better options.

The real deciding factor: stateless vs persistent

People often think the question is “frontend or backend”. That is not the real question. The real question is stateless or persistent.

Stateless

The server remembers nothing from before this request. Each request is handled on its own, from a clean start. Anything that happened during it is gone once the answer is sent.

Persistent

The server is one process that keeps running. It can hold things in memory, such as a variable, a cache or an open connection. That memory stays across many requests.

Simple analogy

Stateless is like a food truck that drives away after every customer. A fresh truck comes for the next customer and has no idea what the last person ordered. Persistent is like a restaurant that stays open all day. It has the same kitchen and the same staff. It knows what is cooking and keeps a running bill.

Stateless · Vercel
Request 1→
instance Acounter = 1
Request 2→
instance Bcounter = 1
Request 3→
instance Ccounter = 1

Each instance disappears after answering. Nothing carries over.

Persistent · EC2 / Railway
Request 1Request 2Request 3
→→→
one process, 24/7counter = 1
counter = 2
counter = 3

Same process every time, so memory survives between requests.

Three requests, same counter code. Stateless: each request starts from a fresh instance. Persistent: one process remembers.

Same code, two different results

On Vercel (stateless)

Each request may run on a different, separate instance of your code. So this counter can go back to 0 at any time.

// pages/api/counter.js
let counter = 0;   // not reliable

export default function handler(req, res) {
  counter++;
  res.json({ counter });
}

On EC2 or Railway (persistent)

The same process answers every request, so the counter really does go up every time.

// server.js — runs all the time
let counter = 0;   // reliable

app.get('/counter', (req, res) => {
  counter++;
  res.json({ counter });
});
The rule to remember

On a stateless platform, never keep important data (state) in a variable. Always save it in a database or in Redis (a fast in-memory store). On a persistent server you can choose. That choice is why we learn EC2. Even on a persistent server, remember this: if you run more than one server, a variable in one server is not seen by the others.

How to choose, practically

  • Only a frontend, or small API routes with quick database queries? Vercel is fine. Keep it simple.
  • Need long background jobs, PDF generation, WebSockets or PHP? A persistent server is the easier choice: Railway, Dokploy or AWS.
  • Want to launch fast without learning servers today? Use Railway. Move later, when you have paying customers.
  • Want full control and the lowest cost at scale? Use raw AWS. This course builds it step by step.

Many solo SaaS builders launch first on Railway or on self-hosted Dokploy. Launching fast matters more at the start. Later, when real users and real scale arrive, they move to raw AWS. This course gives you the raw AWS foundation in both cases. It is the skill that lets you set up, secure and debug every option above it, including Dokploy, instead of guessing.


Background reading for the AWS DevOps course. Read Lesson 0 — The Big Picture: Vercel vs AWS Mindset first if you have not already.