# Deploy your Astro site to BitHut

BitHut builds a static Astro site from its code and serves the pages at its own address with HTTPS. You can send the code from your AI, from a GitHub or GitLab repository, or as a folder from your computer.

## Tell your AI

1. Connect BitHut to your AI (Claude, ChatGPT or Codex): add the address `https://api.bithut.app/mcp`. How: https://bithut.app/connect.md
2. Then tell it:

```
Put my Astro site on BitHut
```

## Prerequisites

- An Astro project that builds to static pages: the default, without `output: "server"` in `astro.config.mjs`.
- A `build` script in `package.json`. A new Astro project already has `"build": "astro build"`.
- A BitHut account with a plan. Start costs $5 a month; there is no free plan.

## How BitHut builds an Astro site

BitHut builds code with [Railpack](https://railpack.com/languages/node). Railpack sees Astro, runs the `build` script, and serves the `dist` folder with the Caddy web server. No adapter and no Dockerfile are needed for a static site.

To serve another folder, set the `RAILPACK_SPA_OUTPUT_DIR` variable to its name.

## Deploy from your AI

1. Connect BitHut to Claude, ChatGPT, Codex or Cursor once: [connect your AI](https://app.bithut.app/connect).
2. In the chat where your AI sees the project, write: “Put my Astro site on BitHut”.
3. The AI packs the project folder, sends it, and answers with the address, for example `my-site-anna.up.bithut.app`.

To publish a change later, ask the AI to deploy again. Each deploy is a new version, and the previous one can be restored.

## Deploy from GitHub or GitLab

1. In the [BitHut cabinet](https://app.bithut.app/new), create a project with a name.
2. Choose **From GitHub** or **From GitLab** and connect your account.
3. Pick the repository and press **Connect**. BitHut builds its default branch.

## Deploy a folder from your computer

1. Create a project in the [BitHut cabinet](https://app.bithut.app/new).
2. Choose **From your computer** and drop the project folder. The `.env` file is not sent.

## Environment variables

Astro puts variables with the `PUBLIC_` prefix into the pages at build time. Add them in the project settings in the cabinet, or ask your AI to set them.

Secret values, such as API keys, are entered in the cabinet by you, not sent through the AI chat. Your AI gives you a link to the right field.

## Who can open the site

A new site opens with a password. After the first deploy, BitHut asks once whether everyone can open it; until you answer, it stays closed.

## Your own domain

Add a domain in the project settings and create the DNS record BitHut shows. HTTPS is issued for the domain automatically.

At its `up.bithut.app` address a site is hidden from search engines. To appear in Google, connect your own domain.

## Limits

- Checked on 25 November 2026 with a static Astro 7.4 site. A site with `output: "server"` and the Node adapter has not been checked on BitHut.
- Addresses that do not exist return the home page with status 200 instead of your `404.html`.

## Official resources

- [Finished Astro sites on BitHut](/examples/astro), with their source code and a prompt to make one like them.
- [BitHut prices](/pricing).
