How to Deploy Static Sites on DigitalOcean App Platform

beginner 8 min read Updated 2026-03-24
Quick Answer

Deploy static sites on DigitalOcean App Platform by linking your GitHub repo via the web console, selecting the main branch, enabling autodeploy, and launching on the free Starter plan. Verify deployment success and access your live site. Use CLI for automation with doctl.

Get DigitalOcean App PlatformPartner

Prerequisites

  • GitHub account with static site files in a repository
  • DigitalOcean account
  • Basic Git knowledge
  • Personal access token for CLI (optional)

Step-by-Step Instructions

1

Access App Platform

Visit the DigitalOcean App Platform portal and click the blue Launch Your App button to begin deployment.[1]
2

Connect GitHub Account

On the repository selection page, click Link Your GitHub Account. Sign into GitHub, select your account, and proceed to grant permissions.[1]
3

Grant Repository Permissions

Select Only select repositories, choose the repository with your static site files, and click Save at the bottom.[1]
For private repos you don't own, ensure proper GitHub app permissions are granted via GitHub Settings > Applications.[7]
4

Select Repository and Configure

Back in App Platform, select your repository from the dropdown. Click Next, then set App name, Branch (typically main), and check Autodeploy for automatic pushes. Click Next.[1][4]
Autodeploy triggers rebuilds on every push to the selected branch.
5

Review App Configuration

App Platform auto-detects Static Site as the component type. Verify no changes needed, scroll down, and click Next.[1][5]
If it defaults to Web Service, manually change to Static Site.[5]
6

Select Pricing Plan

Choose the Starter plan (includes three free static sites), then click Launch Your Starter App.[1]
7

Verify Deployment

On the app's admin page, wait for Deployed Successfully! message. Click the app link to confirm your site loads correctly.[1]
If site doesn't appear, check deployment logs for errors.
8

Install doctl for CLI (Optional)

For CLI deployment, install doctl, create a personal access token, and authenticate with doctl auth init
9

Prepare App Spec for CLI

Update your app spec YAML with github repo, branch: main, source_dir if needed (e.g., for monorepos), and deploy_on_push: true
Use <pre><code>doctl apps create app.yaml --app-spec app.yaml</code></pre> to deploy.
10

Post-Deployment Management

Access Settings in the app admin panel to update config, enable autodeploys, or add custom domains.[2]

Common Issues & Troubleshooting

Site not appearing after deployment

Check deployment logs for errors in the app admin page and verify component type is set to Static Site, not Web Service.[1][5]

Cannot access private GitHub repo

Grant App Platform read permissions via GitHub Settings > Applications, or use repo owner to authorize.[7]

Build fails in subdirectory or monorepo

Set source_dir in app spec to the subdirectory path (e.g., /public).[2]

Autodeploy not triggering

Ensure Autodeploy checkbox is enabled and pushes are to the correct branch like main

Wrong component type detected

Manually select Static Site during configuration; App Platform may default to Web Service.[5]

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official DigitalOcean App Platform website before purchasing.
Special Offer

Affiliate link. We may earn a commission at no extra cost to you.