• Docs
  • Changelog
Sign in
Get started
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Manage files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK reference
        • TypeScript SDK
        • Python SDK
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render

Deploy Astro on Render

Host your site for free in minutes.

You can deploy your Astro site on Render for free.

How you deploy depends on whether your site includes server-side logic (SSR, API routes, etc.):

See instructions for each service type below.

Not sure if you have a server-side component?

Check your project's astro.config.mjs file. If it sets output: 'server' or output: 'hybrid' (removed in Astro v5), deploy as a web service.

Static site (no server-side logic)

Sites without a server-side component use Render's static site service type.

Static sites are served over a global CDN. They include fully managed TLS certificates and support custom domains out of the box.

  1. In the Render Dashboard, click New > Static Site:

    Selecting Static Site from the New menu

  2. In the creation form, connect your Astro project's GitHub repository.

    • (GitLab and Bitbucket work too.)
  3. For your site's Build Command and Publish Directory, set the following:

    SettingValue

    Build Command

    npm install && npm run build

    If you use a different package manager (such as bun, pnpm, or yarn), use its equivalent command instead.

    Publish Directory

    dist

  4. Click Deploy Static Site. Render kicks off your site's first build and deploy.

That's it! Your site will be live at its onrender.com URL as soon as the deploy finishes:

An Astro static site's URL in the Render Dashboard

As next steps, you can add a custom domain to your site and set up pull request previews.

Web service

If your Astro site includes a server-side component, you deploy it as a web service.

Web services support both horizontal and vertical scaling. They include fully managed TLS certificates and support custom domains out of the box.

  1. If necessary, update your Astro project to use the @astrojs/node adapter if you currently use a different adapter:

    After making this change, push it to your repository.

  2. In the Render Dashboard, click New > Web Service:

    Selecting Web Service from the New menu

  3. In the creation form, connect your Astro project's GitHub repository.

    • (GitLab and Bitbucket work too.)
  4. For your web service's Build Command and Start Command, set the following:

    SettingValue

    Build Command

    npm install && npm run build

    If you use a different package manager (such as bun, pnpm, or yarn), use its equivalent command instead.

    Start Command

    node dist/server/entry.mjs

    If you've customized your site's builds, confirm this path by building your site locally and checking the output of the build command.

  5. Set your service's Compute Plan to Free.

    • You can upgrade to a paid compute plan at any time.
    • Learn more about free compute plans.
  6. Under Environment Variables, add the following variables:

    NameValue

    HOST

    0.0.0.0

    (By default, dynamic Astro sites bind to 127.0.0.1 (i.e., localhost). Render web services must bind to 0.0.0.0 instead.)

    NODE_VERSION (optional)

    Optionally set this to the version of Node.js you want to use for your site.

    Newly created services use Node.js 24.22.1 by default.

  7. Click Deploy Web Service. Render kicks off your service's first build and deploy.

That's it! Your site will be live at its onrender.com URL as soon as the deploy finishes:

An Astro web service's URL in the Render Dashboard

As next steps, you can add a custom domain to your site and set up pull request previews.

Deploy Astro on Render
  • Static site (no server-side logic)
  • Web service
All Systems Operational
© Render Inc. All rights reserved.