Back to Withastro

Deploy your Astro Site to Surge

src/content/docs/en/guides/deploy/surge.mdx

latest717 B
Original Source

import { Steps } from '@astrojs/starlight/components';

You can deploy your Astro project to Surge, a single-command web publishing platform designed for front-end developers.

How to deploy

<Steps> 1. Install [the Surge CLI](https://www.npmjs.com/package/surge) globally from the terminal, if you haven't already.
```shell
npm install -g surge
```

2. Build your Astro site from your project’s root directory.

```shell
npm run build
```

3. Deploy to Surge using the CLI.

```shell
surge dist
```

You can [use a custom domain with Surge](http://surge.sh/help/adding-a-custom-domain) when deploying by running `surge dist yourdomain.com`.
</Steps>