Deploy Astro on Zeabur

Astro (opens in a new tab) is a modern website building tool with a powerful developer experience and lightweight output.

This guide will help you deploy your Astro site on Zeabur.

Step 1: Create an Astro Project

You can create an Astro project using the command below and follow the prompts for configuration.

npm create astro@latest

Step 2: Install the @zeabur/astro-adapter Package

Zeabur provides an adapter package for Astro, which you can install using the command below.

pnpm i @zeabur/astro-adapter

After installation, you need to configure the adapter in your astro.config.mjs.

import zeabur from '@zeabur/astro-adapter/serverless';
 
export default {
  // ...
  adapter: zeabur(),
  output: 'server'
  // ...
};

With that, your Astro project is ready to be deployed to Zeabur.

Step 3: Deploy to Zeabur

Method 1: Using the Zeabur CLI

First, ensure that you have installed the Zeabur CLI according to the guide Deploy in CLI.

Then, in your newly initialized Astro project, add uncommitted files to Git.

git add -A
git commit -m "Initial commit"

Next, deploy your service using the command below.

zeabur

Method 2: Using the Zeabur Dashboard

Navigate to the Zeabur Dashboard (opens in a new tab) and create a new project.

Then, click on the Deploy New Service button and choose to deploy from GitHub.

💡

If this is your first time deploying a project from GitHub on Zeabur, you will need to configure and install the GitHub App. You can view a more detailed guide here.

After selecting the repository and branch, Zeabur will automatically begin to build your service.

Zeabur will automatically detect that your service is built with Astro, so you don't need to make any additional configurations. Your deployment will be completed in a few minutes.

Step 4: Bind a Domain

After the deployment is complete, you may need to configure a domain for your Astro site.

Open the "Domain" tab on the service page and click on "Generate Domain" or "Custom Domain".

For more information on how to bind a domain to your service, please refer to Bind a domain.