# What is a platform as a service (PaaS)? A platform as a service (PaaS) runs your application code for you. You hand it the code, and it builds, starts, routes and restarts the app. **On Runtime, [Apps](/docs/apps) are a PaaS on a Linux machine of your own. An App starts the code in `/app` from its Procfile's `web:` line, else `npm start`, else `python3 app.py`, keeps it running on port 8080 and serves it over HTTPS.** Because each App is a whole machine, you can also `sudo` into it, install system packages and run anything Linux runs. ## What the platform does and what you do The NIST definition of cloud computing describes PaaS as deploying your own applications onto infrastructure you do not manage, built with languages and tools the provider supports. You control the app and its settings. The provider controls the servers, the operating system, storage and the network. | Layer | You manage it on IaaS | You manage it on PaaS | You manage it on FaaS | | --- | --- | --- | --- | | Physical servers, networks, storage | No | No | No | | Operating system and runtime | Yes | No | No | | Starting, restarting and routing | Yes | No | No | | A long-running process | Yes | Yes | No, one handler per request | | Application code | Yes | Yes | Yes | On [infrastructure as a service](/glossary/infrastructure-as-a-service) you rent the machines and run everything on them yourself. On [function as a service](/glossary/function-as-a-service) you hand over a single handler. A PaaS sits between them: a whole app, kept running, with the machine work done for you. ## How a PaaS knows what to run Most platforms read the same signals from the repository: - **A Procfile.** One line per process type, such as `web: node server.js`. Heroku introduced it, and on Heroku the `web` process is the only one that receives HTTP traffic from its routers. - **The language's own convention.** `npm start` for Node.js, a `requirements.txt` or `pyproject.toml` for Python. - **A port in an environment variable.** The platform sets `PORT` and sends traffic there. - **Configuration in the environment.** Keys and database URLs come from variables the platform injects, so one build runs in every environment. This is one of the rules of the twelve-factor app. ## Run a Procfile on Runtime This script creates an App, writes a Procfile and one page to `/app`, restarts the App's server, and reads the page through a [preview](/glossary/preview-url). ```bash check api=https://api.withruntime.com/v2 auth="Authorization: Bearer $RUNTIME_API_KEY" put() { curl -sf -X PUT "$api/apps/$app/files?path=$1" -H "$auth" \ -H "Content-Type: application/octet-stream" --data-binary @- > /dev/null; } app=$(curl -sf -X POST "$api/apps" -H "$auth" -H "Content-Type: application/json" -d '{}' | jq -r .id) trap 'curl -sf -X DELETE "$api/apps/$app" -H "$auth" > /dev/null' EXIT # The Procfile names the web process, as on Heroku. echo 'web: python3 -m http.server 8080 --directory /app/public' | put /app/Procfile echo '