Cloud and Deployment · Concept
Deployment and Cloud Servers: From Source Code to a Running Application
Follow source code into a production environment and separate builds, artifacts, processes, virtual machines, containers, managed platforms, configuration, health, and traffic.
On this page
The short answer
Deployment is the controlled process of placing a specific version of an application and its required configuration into an environment where it can run and receive traffic.
Source code alone is not a running service. Depending on the application, deployment may resolve dependencies, run checks, compile or bundle code, produce an artifact or container image, start a process with runtime configuration, verify readiness, and route traffic to it.
Cloud services change who operates each layer. They do not remove the layers: code still executes in a process, on an operating system or managed runtime, using compute, memory, networking, and storage somewhere.
What deployment means
During development, one person may edit code, start a local process, use a local database, and open localhost. Production introduces a shared environment that must be repeatable, observable, secure, and reachable by real clients.
A deployment answers questions such as:
- Which version should run?
- What artifact represents that version?
- Which runtime and operating-system assumptions does it have?
- Which configuration and secrets belong to this environment?
- How does the platform know the process is ready?
- When and how does traffic move to it?
- How can an unhealthy release be stopped or rolled back?
Deployment can be manual or automated, but the boundaries exist either way.
Source code, build output, and artifacts
Source code is the human-maintained input: application files, manifests, lockfiles, and configuration templates. A build transforms or packages those inputs for execution or delivery. The result is a deployment artifact: for example, compiled binaries, bundled frontend assets, an archive with dependencies, or a container image.
Compiled applications may produce machine code or bytecode. JavaScript or Python applications may not compile in the same sense, yet they can still transpile, bundle, resolve locked dependencies, generate assets, or package files. A static frontend commonly becomes HTML, CSS, JavaScript, fonts, and images that a host or CDN can serve.
An artifact should identify what was tested and deployed. Rebuilding from changing dependencies during production startup can produce something different from the version that passed checks.
Mental model
Separate four states:
source code → verified build inputs → versioned deployment artifact → running process in a configured environment
“The code is in the repository” proves none of the later states.
The runtime and application process
A runtime provides the machinery needed to execute an application: Node.js for JavaScript, a Java Virtual Machine for JVM bytecode, a Python interpreter, or native operating-system facilities for a compiled binary.
When the application starts, the operating system creates a process with memory, environment, files, permissions, and network access. That process may create several threads or use an event loop. It opens a listening socket or receives events through a managed platform.
A deployment can report that a process started even when the application cannot serve useful requests. Configuration may be invalid, a dependency may be unreachable, or initialization may still be running.
Operating systems, ports, and environment
An operating system schedules processes, manages memory and files, and exposes networking. A server application commonly listens on an IP interface and port, such as port 8080.
Listening on 127.0.0.1:8080 means only the same network host can normally reach that socket. Listening on an appropriate non-loopback interface can make it reachable from the surrounding container or network, subject to firewall and platform rules. Exact interfaces and security policy vary by environment.
The platform might provide the expected port through configuration. If the process ignores it and listens elsewhere, startup can appear successful while health checks and public traffic fail.
Development and production also differ in operating-system libraries, filesystem paths, case sensitivity, user permissions, clock settings, CPU architecture, and resource limits. Local success proves the code worked in one environment, not every target environment.
Physical machines and virtual machines
A physical server supplies processors, memory, network interfaces, and storage devices. Virtualization lets a hypervisor expose virtual hardware to one or more virtual machines. Each VM commonly runs its own guest operating-system kernel and processes.
Cloud providers let customers provision these virtualized resources through APIs. NIST defines cloud computing around on-demand network access to a shared pool of configurable resources that can be provisioned and released rapidly.The cloud model includes infrastructure, platform, and software service models rather than one required deployment topology.1
Amazon EC2 is one provider-specific example. AWS defines an EC2 instance as a virtual server in its cloud.An EC2 instance is not a physical data center; it is a compute resource launched within AWS location and network boundaries.4
VM users commonly manage more of the operating system, patches, runtime, service manager, firewall, and application process than users of a higher-level managed platform.
Containers
A container image packages a filesystem and execution configuration. A container runtime creates an isolated process environment from that image using operating-system capabilities. The OCI Runtime Specification standardizes the configuration, execution environment, and lifecycle expected of compatible runtimes.An image specification and runtime specification solve related but different packaging and execution concerns.2
Containers commonly share a host kernel rather than booting a separate guest kernel for every application. That makes “a lightweight VM” a useful first impression but not a fully equivalent technical model. Docker describes containers as isolated processes with their required files and contrasts them with VMs that include separate operating systems.VMs and containers are also commonly used together.3
A container does not automatically make an application portable across every CPU architecture, kernel capability, network policy, filesystem expectation, or managed platform. It creates a more explicit package and runtime boundary.
Managed application platforms
A managed application platform accepts source or an artifact and operates more of the surrounding infrastructure. It may select a runtime, build the application, create instances, restart failed processes, terminate TLS, collect logs, and route traffic.
This resembles the platform-as-a-service boundary in NIST's cloud service models: the consumer deploys an application while the provider manages more of the network, servers, operating systems, and storage underneath.The exact division of responsibility is product-specific.1
Managed does not mean unconfigured. The application still needs correct build commands, startup commands, ports, environment settings, health checks, resource sizing, and dependencies. The provider still runs underlying physical and virtual infrastructure even when the developer does not operate it directly.
Serverless execution
Serverless platforms run application functions or services in response to requests or events while the provider manages capacity and execution infrastructure. AWS Lambda Functions are one vendor example that runs code in response to events or API calls while AWS manages the execution infrastructure.Other products and providers use different lifecycle, runtime, concurrency, and billing models.10
“Serverless” means the application team does not manage servers in the same way; it does not mean that no servers exist. Processes may be created, reused, paused, or replaced under provider rules. Startup latency, execution limits, stateless instances, networking, and external persistent storage still matter.
Static frontend hosting is another distinct model: prebuilt assets can be served from object storage or an edge network without running application backend code for each request. The frontend and backend can be deployed separately and can use several models together.
Configuration and secrets
Configuration supplies environment-specific values: port, database address, allowed origins, log level, service URLs, feature policy, and credentials. Build-time values are embedded while producing an artifact; runtime values are supplied when a process starts or while it runs. Confusing the two can deploy stale or exposed values.
Environment variables are one configuration mechanism, not a complete secrets system. They can be inherited by processes, exposed in diagnostics, or included accidentally in logs and dumps. Secrets such as database passwords, API keys, signing keys, and certificates require controlled storage, delivery, access, rotation, and auditing.
OWASP warns against hardcoding secrets in source or container definitions and describes managed stores, mounted files, and runtime injection as possible delivery patterns.The correct mechanism depends on the target platform and threat model.8
Dependencies and database connectivity
A running backend may still depend on a database, cache, queue, object store, or external API. Production failures often come from the boundary between the application and those services:
- the hostname or port belongs to another environment;
- network policy blocks the connection;
- credentials lack permission or have expired;
- TLS trust or service identity is wrong;
- a schema migration has not run;
- connection limits or timeouts differ from local development.
Databases are commonly operated separately from application processes so their persistence, backups, availability, and scaling can be managed independently. A container image should not be treated as durable database storage merely because data exists inside its writable filesystem while it runs.
Domains, TLS, and traffic routing
After the application is healthy internally, public traffic still needs a path:
- DNS gives clients destination information.
- A CDN, load balancer, gateway, or reverse proxy may accept the connection.
- TLS credentials must cover the requested service identity.
- Routing rules must select the intended deployment.
- Network policy must allow the next hop.
- The application must listen on the expected interface and port.
Not every architecture includes every component. A small VM can terminate TLS and run the application directly. A larger platform may terminate TLS at an edge service and create several private hops before an application instance.
Deployment success and public reachability are therefore different claims.
Health checks and deployment readiness
A startup check can allow initialization to finish. A readiness check asks whether an instance should receive traffic. A liveness check asks whether the platform should restart a stuck or irrecoverable instance.
Kubernetes documents these as separate probes: failed readiness removes a Pod from Service traffic while the container continues running; liveness can trigger a restart; startup can delay the other probes for slow initialization.These names are Kubernetes-specific, but the responsibility distinction applies more broadly.5
A process can be alive but not ready because its database is unavailable or required configuration has not loaded. Conversely, making liveness depend on every downstream service can create restart loops during a dependency outage. Health endpoints need deliberate semantics and inexpensive, bounded checks.
- ResolveUse locked and verified dependencies
- CheckRun tests, types, lint, and security checks as applicable
- PackageCreate a versioned artifact or container image
- PlaceDeliver it to the target environment
- ConfigureInject environment settings and authorized secrets
- StartLaunch the runtime and application process
- ProbeConfirm startup and readiness on the expected network boundary
- RouteSend production traffic to ready instances
This flow is qualified. An interpreted application may package rather than compile. A managed platform may perform several steps. Static hosting may publish assets without starting a long-running application process.
Regions, Availability Zones, and data centers
Cloud geography is provider terminology, so use the provider's definitions:
- A region is a broad geographic area in which resources are provisioned.
- An Availability Zone is an isolated location within a region under a provider's design.
- A data center is a physical facility housing computing and network equipment.
In AWS's model, a region contains multiple Availability Zones, and an Availability Zone consists of one or more discrete data centers.An Availability Zone should not be described universally as exactly one building.6
Deploying across zones can reduce exposure to one location failure, but it does not automatically make an application highly available. Traffic distribution, database topology, capacity, state, and failure testing must also support the design.
CDNs and edge locations
An edge location is a provider-defined site closer to users that offers selected edge services. A CDN can cache static or eligible dynamic responses there, terminate connections, apply policy, or forward requests to an origin.
For CloudFront, AWS describes points of presence—also called edge locations—that serve content to viewers, with regional edge caches between those locations and an origin in applicable request paths.Do not assume that every edge location runs the complete application. Other CDNs use their own topology and terms.7
Scaling at a high level
Vertical scaling gives one instance more CPU, memory, or other capacity. Horizontal scaling runs more instances and distributes work among them.
Horizontal scaling requires shared assumptions to be explicit. Session state in one process, files written to one instance, scheduled jobs, database connection counts, and cache invalidation can behave differently with several replicas.
Autoscaling changes capacity based on signals or schedules. It cannot compensate for an inefficient query, a hard database limit, or an unavailable dependency without moving the bottleneck.
Deployment strategies at a high level
- A rolling deployment replaces instances in portions, so old and new versions may run together.
- A blue-green deployment prepares a separate environment and then moves traffic between the old and new environments.
- A canary deployment first sends a limited share of traffic to the new version and expands it after observation.
- A rollback restores a previously known version or routes traffic back when the release fails its acceptance criteria.
AWS's deployment guidance documents these patterns as examples and notes their different infrastructure, traffic, and rollback behavior.They are general techniques, not AWS-only requirements.9
Database migrations, queues, caches, and external contracts can make rollback more complex than selecting an older artifact. Compatibility must be planned before traffic moves.
Why applications work locally but fail in production
Common differences include:
- missing or incorrect runtime configuration;
- secret or permission errors;
- a process listening on the wrong port or interface;
- different runtime, operating-system, or CPU versions;
- case-sensitive paths or missing build files;
- blocked database or external-service connections;
- production origins rejected by CORS or redirect allowlists;
- proxy timeouts or request-size limits;
- insufficient memory or file permissions;
- a health check that exercises the wrong path.
“Works locally” is evidence about the code in the local environment. Reproduce production inputs and boundaries before deciding which layer is defective.
Common misconceptions
Deployment means uploading source code
Deployment places an identified application version into a configured runtime environment and makes it eligible for traffic. Uploading files may be one step.
A container is a smaller virtual machine
Containers commonly isolate processes while sharing a host kernel. VMs expose virtual hardware and commonly run separate guest kernels. They can be used together.
Serverless means no servers
Servers and processes still execute the code. The provider manages their provisioning and lifecycle behind a higher-level execution model.
A started process is a healthy application
The process can exist while initialization, dependencies, networking, or request handling fails. Startup, readiness, liveness, and public reachability are separate signals.
Debugging scenario
Debugging scenario
The application builds successfully. The platform reports that its process started, but the readiness check fails and no production traffic reaches it. The platform expects HTTP on 0.0.0.0:8080; logs show that the application listens on 127.0.0.1:3000.
Which boundaries succeeded? Source resolution and build succeeded, the artifact reached the target, and the operating system created the process. None of those proves readiness.
Where is the failure? At the process-to-platform network contract. The process listens on a different port and only on its own loopback interface, while the health checker targets the platform-provided address and port.
Inspect the documented runtime port, startup configuration, listening sockets, health-check target, and logs. Change the application to honor the platform's supplied port and appropriate interface, redeploy one identified artifact, then verify readiness before testing the public URL. A firewall, wrong path, slow startup, or dependency failure could cause a similar symptom, so confirm the actual listener rather than assuming this cause.
Knowledge check
Reflect, then reveal each answer.
How do source code, an artifact, and a running process differ?
Source code is the maintained input. An artifact is the versioned build or package selected for deployment. A process is an executing instance of that artifact in a configured environment.
Why is a container not fully equivalent to a virtual machine?
A container commonly isolates processes while sharing a host kernel. A VM exposes virtual hardware and commonly runs its own guest operating-system kernel.
What does readiness prove that process startup does not?
Readiness indicates that the instance should receive traffic under the platform's defined check. A process can start while still initializing or unable to serve correctly.
Is an Availability Zone always one data center?
No. Provider definitions vary. In AWS, an Availability Zone consists of one or more discrete data centers within a region.
A build passes and a process starts, but the health check cannot reach its expected port. Which boundary failed?
The runtime network and readiness boundary failed. Inspect the application's listening interface and port, platform configuration, health target, and network policy.
What to learn next
How this connects
- Reverse proxies and production debugging
Follow public traffic through the deployed boundaries and identify which component actually returned an error.
- Cloud reliability
Continue into redundancy, autoscaling, failure domains, backups, capacity, and recovery objectives.
- Container orchestration
Study scheduling, service discovery, resource limits, probes, and rollout control beyond the container itself.
- Delivery engineering
Explore reproducible builds, provenance, staged releases, database migrations, and rollback design.
Key takeaway
References & further reading
References & further reading10 sourcesPrimary standards and official documentation used for this lesson.
- NIST SP 800-145: The NIST Definition of Cloud Computing (opens in a new tab)
National Institute of Standards and Technology (NIST)
Cloud characteristics and infrastructure, platform, and software service models
- Open Container Initiative Runtime Specification (opens in a new tab)
Open Container Initiative
Container execution environment, configuration, and lifecycle
- What is a container? (opens in a new tab)
Docker
Practical distinction between isolated container processes and virtual machines
- What is Amazon EC2? (opens in a new tab)
Amazon Web Services
EC2 instances as virtual servers with compute, memory, network, and storage resources
- Configure Liveness, Readiness and Startup Probes (opens in a new tab)
Kubernetes
Operational distinction among startup, readiness, and liveness checks
- AWS Regions and Availability Zones (opens in a new tab)
Amazon Web Services
AWS-specific definitions of Regions, Availability Zones, and their data-center relationship
- How CloudFront delivers content (opens in a new tab)
Amazon Web Services
CloudFront points of presence, regional edge caches, cache behavior, and origin requests
- Secrets Management Cheat Sheet (opens in a new tab)
OWASP Foundation
Secret provisioning, rotation, access control, and environment-variable limitations
- Deployment methods (opens in a new tab)
Amazon Web Services
Rolling, canary, immutable, blue-green, and rollback-oriented deployment models
- What is AWS Lambda? (opens in a new tab)
Amazon Web Services
A provider-specific example of managed event-driven serverless execution