# Deploy your Astro Site to Juno

> How to deploy your Astro site to the web using Juno.

[Juno](https://juno.build) is an open-source serverless platform for hosting static websites, building web applications, and running serverless functions with the privacy and control of self-hosting.

## Create your container

[Section titled “Create your container”](#create-your-container)

1. Log in to the [Juno Console](https://console.juno.build).

2. Click the **Launch a new satellite** button (the container for your project) from the launchpad

3. Enter a **name** and select **Website**

4. Confirm with **Create a Satellite**

5. The platform will then provision its resources.

6. Once the process is complete, click Continue to access the overview page.

## Configure your project

[Section titled “Configure your project”](#configure-your-project)

Your Astro project can be deployed to Juno as a static site.

Create a `juno.config.mjs` file at the root of your project, and replace the `PROD_SATELLITE_ID` with the ID of the Satellite you created earlier.

juno.config.mjs

```javascript
import { defineConfig } from '@junobuild/config';


/** @type {import('@junobuild/config').JunoConfig} */
export default defineConfig({
  satellite: {
    ids: {
      production: '<PROD_SATELLITE_ID>'
    },
    source: 'dist',
    predeploy: ['npm run build']
  }
});
```

## How to deploy

[Section titled “How to deploy”](#how-to-deploy)

You can deploy using either GitHub Actions or CLI (command line interface).

### GitHub Actions deployment

[Section titled “GitHub Actions deployment”](#github-actions-deployment)

1. From your Satellite’s overview, navigate to the **Setup** tab.

2. Click on **Add an access key**.

3. Generate a new key with the default option. Click **Submit**.

4. Upon successful creation, a **Secret token** will be displayed. Copy the value and save it as an [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in your GitHub repository or organization, using the key `JUNO_TOKEN`.

5. Create a `deploy.yml` file in the `.github/workflows` subfolder of your repo.

6. Add the following workflow configuration:

   .github/workflows/deploy.yml

   ```yaml
   name: Deploy to Juno


   on:
     workflow_dispatch:
     push:
       branches: [main]


   jobs:
     deploy:
       runs-on: ubuntu-latest
       steps:
         - name: Check out the repo
           uses: actions/checkout@v4


         - uses: actions/setup-node@v4
           with:
             node-version: 24
             registry-url: "https://registry.npmjs.org"


         - name: Install Dependencies
           run: npm ci


         - name: Deploy to Juno
           uses: junobuild/juno-action@main
           with:
             args: hosting deploy
           env:
             JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
   ```

### CLI deployment

[Section titled “CLI deployment”](#cli-deployment)

1. Install the CLI

   * npm

     ```shell
     npm i -g @junobuild/cli
     ```

   * pnpm

     ```shell
     pnpm add -g @junobuild/cli
     ```

   * Yarn

     ```shell
     yarn global add @junobuild/cli
     ```

2. Authenticate the CLI. This will open the Juno Console.

   ```bash
   juno login
   ```

   Tip

   An access token is used to identify your terminal. That’s why the CLI asks whether you want to encrypt it with a password. For security reasons, it’s recommended that you do so.

3. In the browser window, click **Authorize** to grant permission.

4. Deploy your site:

   ```bash
   juno hosting deploy
   ```

## Guides

[Section titled “Guides”](#guides)

* [Use Juno with Astro](https://juno.build/docs/guides/astro)
* [Deployment with GitHub Actions](https://juno.build/docs/category/deployment)
* [Manual Deployment](https://juno.build/docs/guides/manual-deployment)

## Examples

[Section titled “Examples”](#examples)

Quickly scaffold a website with a ready-made Astro template.

* npm

  ```shell
  npm create juno@latest -- --template astro-starter
  ```

* pnpm

  ```shell
  pnpm create juno -- --template astro-starter
  ```

* Yarn

  ```shell
  yarn create juno -- --template astro-starter
  ```