How to Deploy Static Sites on DigitalOcean App Platform
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.
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
Access App Platform
Connect GitHub Account
Grant Repository Permissions
Select Repository and Configure
main), and check Autodeploy for automatic pushes. Click Next.[1][4]Review App Configuration
Select Pricing Plan
Verify Deployment
Install doctl for CLI (Optional)
doctl, create a personal access token, and authenticate with doctl auth init Prepare App Spec for CLI
github repo, branch: main, source_dir if needed (e.g., for monorepos), and deploy_on_push: true Post-Deployment Management
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]