DigitalOceanTutorial2 min read

How Do I Deploy a Static Site on DigitalOcean App Platform?

Deploy a static HTML, React, or Next.js site on DigitalOcean App Platform — connect GitHub, auto-deploy on push, and get free SSL.

Server racks and cloud infrastructure

What Is App Platform?

App Platform is DigitalOcean's Platform-as-a-Service (PaaS). You connect a GitHub or GitLab repo, and DigitalOcean builds and hosts your app — no Droplet, no Nginx config, no PM2. Static sites on the Starter tier cost as little as $0/month (with usage limits) or $3/month for a custom domain with SSL.

Step 1 — Prepare Your Repository

Push your static site to GitHub. For plain HTML/CSS/JS, the repo root should contain an index.html. For frameworks:

  • React (Vite/CRA): build output goes to dist/ or build/
  • Next.js (static export): output in out/ with output: 'export' in config
  • Hugo/Jekyll: output in public/ or _site/

Step 2 — Create an App

In the control panel, go to Apps → Create App. Connect your GitHub account and select the repository and branch (usually main).

Step 3 — Configure the Build

App Platform auto-detects many frameworks. Verify or set:

  • Build command: npm run build (or leave empty for plain HTML)
  • Output directory: dist, build, out, or public
  • HTTP route: /

For a plain HTML site with no build step, select Static Site and set the output directory to /.

Step 4 — Choose a Plan and Deploy

Select the Starter tier for static sites. Review the settings and click Launch App. The first deploy takes a few minutes — App Platform installs dependencies, runs the build, and deploys the output to a global CDN.

Step 5 — Add a Custom Domain

Under Settings → Domains, add your domain. App Platform provides a CNAME target (e.g. my-app.ondigitalocean.app). Create a CNAME record at your DNS provider pointing your domain to this hostname. SSL is provisioned automatically.

Automatic Deploys

Every push to your connected branch triggers a new build and deploy. View build logs in the Activity tab. If a deploy fails, the previous version stays live — no downtime.

App Platform vs Droplets

  • App Platform: zero server management, auto-scaling, built-in CDN and SSL
  • Droplets: full root access, lower cost at scale, run any software

For portfolio sites, landing pages, and documentation, App Platform is the fastest path from Git push to live URL.