Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 35 ยท App Platform and Functions

App Platform: Deploy Apps on DigitalOcean Without Managing Servers

Learn how App Platform builds and runs your code: components, buildpacks and Dockerfiles, deploy on push, HTTPS and domains, scaling, pricing model and when to choose it over Droplets.

With Droplets you manage a server. With App Platform you manage only your application. You connect a Git repository (or a container image), tell the platform how to build and run it, and it provides the servers, HTTPS certificate, load balancing, rolling deployments and logs. This is DigitalOcean's platform as a service (PaaS), in the same family as Heroku, Render and Vercel.

The big idea

flowchart LR
  G["Git push"] --> B["Build<br/>(buildpack or Dockerfile)"]
  B --> I["Container image"]
  I --> R["Run on managed<br/>containers"]
  R --> LB["HTTPS + load balancing<br/>+ custom domain"]
  LB --> U(("Users"))

You supply code; the platform handles build, runtime, TLS and routing.

When you push to the connected branch, App Platform clones the repository, builds a container image, deploys it next to the old version, checks the health of the new instances, and then switches traffic. If a build or health check fails, the previous version keeps running.

Components

An app is made of one or more components:

App Platform components

Service Long-running web process with a public route
Static site Built files served from a CDN
Worker Background process, no public port
Job Runs before, after or on a schedule
1 / 2
  • Service: your web server or API. It listens on an HTTP port and receives public traffic.
  • Static site: HTML, CSS and JavaScript generated by a build command (React, Vue, Hugo...) and served through a CDN. Static sites are often free or very cheap.
  • Worker: a process that consumes a queue or does background work; it has no public URL.
  • Job: a one-off task: run before a deploy (migrations), after it, or on a cron schedule.
  • Function: a serverless function deployed with the app (see Functions).
  • Database: a small development database, or a link to a managed cluster (Managed databases).

All of the components share one configuration document called the app spec (next lesson).

How code gets built

App Platform supports two main ways:

  1. Buildpacks (Cloud Native Buildpacks). The platform inspects your repository, detects the language from files such as package.json, requirements.txt, composer.json, go.mod or Gemfile, installs dependencies and creates an image. Supported languages include Node.js, Python, PHP, Go, Ruby, and static sites. You can add a build_command and must provide a run_command unless the language default fits.
  2. Dockerfile. If a Dockerfile exists, you may use it for complete control of the runtime. This is the best path for unusual dependencies; see the Docker tutorial for writing one.

Or skip building altogether and deploy a ready-made image from the DigitalOcean Container Registry or Docker Hub.

Build-time environment variables are available while building; run-time variables are available when the app runs; secrets are encrypted values you never see again in the panel.

Networking and HTTPS

Each app gets a free default URL on ondigitalocean.app. You can add custom domains; the platform provisions and renews TLS certificates automatically and handles redirects from HTTP to HTTPS. Routing uses paths: for example / goes to a static site and /api to a service, all on one domain, which avoids CORS issues.

Services can reach each other through internal names and, for databases, over a private connection. Inbound traffic is protected by the platform's edge; you can add rules such as CORS headers and redirects in the app spec.

Scaling and cost

You choose an instance size (shared or dedicated CPU, memory) and an instance count per component. Scale up by picking a bigger size and out by adding instances (App Platform can also autoscale on CPU for dedicated sizes). Billing is per component, per month, pro-rated by the second; check the pricing page for the free static-site allowance and current rates, since they change.

App Platform versus Droplets versus Kubernetes

App Platform Droplet Kubernetes (DOKS)
You manage Code and config OS, packages, patches, security Cluster workloads (plus nodes' sizing)
Deploy from Git push Built in You script it You build a pipeline
Custom system software Limited to your container Anything Anything in containers
Best for Web apps, APIs, sites, workers Full control, legacy stacks Many services, complex orchestration
Learning curve Low Medium High

Choose App Platform when your app is a normal web process and you value time over fine-grained control. Choose a Droplet when you need system-level software or very low cost at scale.

Stand-in: pick components and estimate cost

The programs below model the choice of components and a rough bill. Prices are invented; the structure mirrors how App Platform billing works (per component, per instance).

Python Stand-in: classify a repository into components

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Stand-in: estimate a monthly bill per component

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Limits to know

  • Ephemeral disk. The container's filesystem is wiped on every deploy and restart. Store uploads in Spaces and data in a database, never on local disk.
  • Stateless processes. Keep sessions in a database or cache, since several instances may serve alternate requests.
  • No SSH by default. You debug with logs, metrics and a console feature for running commands in a live container.
  • Build limits. Builds have memory and time limits; heavy builds may need a prebuilt image.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What happens when you push a commit to the branch connected to an app?

    Deploy on push builds a new image, starts new instances and only replaces the old version when the new one is healthy.
  2. 2. Which component runs background processing and has no public URL?

    Workers handle queues and background work without receiving HTTP traffic.
  3. 3. Why should uploads not be written to the container's local disk?

    Use Spaces or a database for anything that must persist.
  4. 4. When is a Droplet a better choice than App Platform?

    Droplets give root access and flexibility at the price of managing the server yourself.

Summary

  • App Platform builds and runs your code from Git or an image, with HTTPS, domains, scaling and rolling deploys handled for you.
  • An app has components: services, static sites, workers, jobs, functions and databases, all described by an app spec.
  • Builds use buildpacks or a Dockerfile; the filesystem is ephemeral, so keep state in databases and Spaces.
  • Choose App Platform for standard web workloads, Droplets for control, DOKS for complex container estates.

Next: The App Spec: Configure Apps as YAML