What Happens When You Deploy to Cloud Foundry? From cf push to Routing
Learn how Cloud Foundry stages, runs, and routes an app after cf push, and how to choose buildpacks and diagnose deployment issues.
Cloud Foundry is an open-source platform as a service (PaaS). Instead of preparing servers and operating systems yourself, you upload application code and let the platform manage execution, routing, and logs. With cf push, the Cloud Controller records the app and receives its files, Diego stages and runs it in containers, and routers send requests to running instances. This overview is based on official Cloud Foundry documentation reviewed on 18 November 2026; commands and features vary with the operator’s version and configuration.
What the platform provides
Cloud Foundry is a platform, not a single application server. It provides deployment automation, app lifecycle management, a runtime, and routing. Developers submit an app and its desired state through the CLI. The platform stages it, keeps the requested instances running, and organizes access with organizations, spaces, and roles. Service brokers can provision databases or other services and bind them to apps; those services may be operated by the platform or an outside provider. Runtime components
This differs from deploying a general-purpose virtual machine: developers specify app files, how it starts, memory, instance count, and routes rather than configuring the operating system. In exchange, they must work within supported runtimes, filesystem and networking rules, and operator settings.
What happens during cf push
For a buildpack app, the flow is:
**Register and upload.** The cf CLI creates an app record with the Cloud Controller and uploads source files. The controller stores metadata and an app package.
**Stage.** The controller asks Diego to prepare the app. The platform detects or uses a specified buildpack; the buildpack helps identify dependencies and a start command. Staging packages the app and its runtime dependencies into a droplet.
**Schedule and start.** Diego tries to match desired and actual instance counts and schedules containers on suitable Diego Cells. App processes run in Garden containers.
**Route and report.** Route emitters send instance-location information to the routing tier. Gorouter sends HTTP requests for the app’s route to current instances. Loggregator provides app logs and metrics.
Upload, staging, and startup are distinct phases. A completed upload does not mean the app is already serving requests, and staging can succeed while process startup or health checks fail. Staging apps, Diego architecture, Runtime components
Buildpack or Docker image?
With a buildpack, Cloud Foundry can detect one that matches the app files and stage the app in the platform runtime. This delegates language dependencies and startup setup, provided the deployment supports that language and runtime. If detection fails, check the supported buildpacks and specify one only if the operator permits it. Buildpacks
A Docker image gives more direct control over userspace and startup, but the operator must enable Docker support and configure registry access. The image must fit platform disk quotas and port rules, and the team must manage image tags and port/start settings. Docker does not remove platform routing, resource limits, access control, or lifecycle management. Confirm support on the specific deployment first. Deploying Docker images, Using Docker
Verify a deployment and narrow failures
First target the organization and space, log in, and prepare files and settings for the chosen deployment method. The following illustrative commands are documented by Cloud Foundry:
cf push sample-app
cf apps
cf logs sample-app --recent
cf events sample-appThe first command pushes the app from the current directory. For a real project, use a manifest when you need stable settings such as app name, memory, instance count, environment variables, or routes. Check status and instances with cf apps; review recent logs and events. A running process may still be unreachable if a route is not mapped or the app does not listen on the platform-assigned PORT.
**Buildpack detection fails:** If logs show `NoAppDetectedError`, check the app file structure, supported runtime, and selected buildpack.
**Staging completes but startup fails:** Check the start command, required environment variables, dependencies, and app errors. `cf logs sample-app --recent` and `cf events sample-app` show different diagnostic information.
**The app runs but cannot be reached:** App status alone does not prove route access. Check domain and route mapping, network policy, port configuration, and the address on which the app listens. Escalate infrastructure or routing issues that need operator access.
Official troubleshooting guidance recommends logs and events. Documented upload, staging, and start time limits can be changed by administrators, so ask the operator about the actual limits. This is an illustrative procedure based on official docs, not a command run against a particular deployment. Deployment troubleshooting, App lifecycle
When does Cloud Foundry fit?
Cloud Foundry’s app-focused flow can help teams that want to focus on deploying applications rather than provisioning servers, and can accept the platform’s supported runtimes and operating model. Direct virtual machines or another container platform may fit better when teams need kernel or host-level control, unrestricted system packages, or an unsupported runtime. Cloud Foundry abstracts execution and routing; it does not automatically solve data design, secret handling, app security, or coordination with operators over capacity.
The key point is that cf push is more than copying files. The Cloud Controller tracks deployment state, Diego stages, runs, and reconciles app instances, and the routing tier maintains access paths. Separating these stages helps distinguish a deployment failure from a later connectivity problem.