CursorDigitalOceanBeginner7 min read

How to Deploy Your Cursor App to DigitalOcean

Deploy your Cursor-built app to DigitalOcean App Platform with automatic deploys, managed databases, and scaling.

Before you start

  • A Cursor project on GitHub
  • A DigitalOcean account

Step by step

1

Create a new App Platform app

Go to DigitalOcean → App Platform → Create App. Connect your GitHub account and select your repository.

# DigitalOcean → App Platform → Create App
# Source: GitHub → Select your repo
# Branch: main
2

Configure the build settings

DigitalOcean auto-detects most frameworks. Verify the build and run commands.

# For Next.js:
# Build: npm run build
# Run: npm start
# HTTP Port: 3000

# For static sites:
# Build: npm run build
# Output: out (or dist)
3

Add environment variables

Click Edit next to your component and add all required environment variables.

# App-level environment variables:
# Click your component → Environment Variables
# Add all vars from your .env.local
4

Choose your plan and deploy

Select the Basic plan (starts at $5/month) or use the free tier for static sites. Click Create Resources.

# Plans:
# Static Site: Free
# Basic: $5/month (512MB RAM)
# Professional: $12/month (1GB RAM)
5

Add a custom domain

In your app settings, go to Domains and add your custom domain. DigitalOcean provides the DNS records.

# Settings → Domains → Add Domain
# Add a CNAME record:
# Name: @ or www
# Value: your-app.ondigitalocean.app
Get $200 free credit on DigitalOcean →

Common errors

Build fails with 'out of memory'

The app runs out of memory during the build step.

Fix: Upgrade to the Professional plan or optimize your build. For Next.js, disable image optimization if not needed.

App crashes on startup

Missing environment variables or wrong port configuration.

Fix: Check Logs in App Platform. Set the HTTP port to match what your app listens on (usually 3000).

Static assets return 404

The build output directory is wrong.

Fix: Check your framework's build output folder. For Vite it's 'dist', for Next.js static export it's 'out'.

Related guides