|
| 1 | +--- |
| 2 | +title: Deploy your Astro Site to Seenode |
| 3 | +description: How to deploy your Astro site to the web on Seenode. |
| 4 | +sidebar: |
| 5 | + label: Seenode |
| 6 | +type: deploy |
| 7 | +i18nReady: true |
| 8 | +--- |
| 9 | +import { Steps } from '@astrojs/starlight/components'; |
| 10 | +import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; |
| 11 | +import ReadMore from '~/components/ReadMore.astro'; |
| 12 | + |
| 13 | +[Seenode](https://seenode.com) is a deployment platform for building and deploying web applications with databases, built-in observability, and auto-scaling. Astro sites can be deployed to Seenode using server-side rendering (SSR). |
| 14 | + |
| 15 | +This guide includes instructions for deploying to Seenode through the web interface. |
| 16 | + |
| 17 | +## Project Configuration |
| 18 | + |
| 19 | +### Adapter for SSR |
| 20 | + |
| 21 | +To enable on-demand rendering in your Astro project and deploy to Seenode, add [the Node.js adapter](/en/guides/integrations-guide/node/) with the following `astro add` command. This will install the adapter and make the appropriate changes to your `astro.config.mjs` file in one step. |
| 22 | + |
| 23 | +<PackageManagerTabs> |
| 24 | + <Fragment slot="npm"> |
| 25 | + ```shell |
| 26 | + npx astro add node |
| 27 | + ``` |
| 28 | + </Fragment> |
| 29 | + <Fragment slot="pnpm"> |
| 30 | + ```shell |
| 31 | + pnpm astro add node |
| 32 | + ``` |
| 33 | + </Fragment> |
| 34 | + <Fragment slot="yarn"> |
| 35 | + ```shell |
| 36 | + yarn astro add node |
| 37 | + ``` |
| 38 | + </Fragment> |
| 39 | +</PackageManagerTabs> |
| 40 | + |
| 41 | +After installing the adapter, update your `astro.config.mjs` to configure the server for Seenode's requirements: |
| 42 | + |
| 43 | +```js title="astro.config.mjs" ins={6-11} |
| 44 | +import { defineConfig } from 'astro/config'; |
| 45 | +import node from '@astrojs/node'; |
| 46 | + |
| 47 | +export default defineConfig({ |
| 48 | + output: 'server', |
| 49 | + adapter: node({ |
| 50 | + mode: 'standalone' |
| 51 | + }), |
| 52 | + server: { |
| 53 | + port: process.env.NODE_ENV === 'production' ? (Number(process.env.PORT) || 80) : 4321, |
| 54 | + host: true |
| 55 | + } |
| 56 | +}); |
| 57 | +``` |
| 58 | + |
| 59 | +Update your `package.json` to include a start script that runs the built server: |
| 60 | + |
| 61 | +```json title="package.json" ins={6} |
| 62 | +{ |
| 63 | + "scripts": { |
| 64 | + "dev": "astro dev", |
| 65 | + "build": "astro build", |
| 66 | + "preview": "astro preview", |
| 67 | + "start": "NODE_ENV=production node ./dist/server/entry.mjs" |
| 68 | + } |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +<ReadMore>See [Seenode's Astro deployment guide](https://seenode.com/docs/frameworks/javascript/astro/) for more configuration options and troubleshooting.</ReadMore> |
| 73 | + |
| 74 | +## How to Deploy |
| 75 | + |
| 76 | +You can deploy to Seenode through the web interface by connecting your Git repository. |
| 77 | + |
| 78 | +### Web Interface Deployment |
| 79 | + |
| 80 | +<Steps> |
| 81 | +1. Create a [Seenode account](https://cloud.seenode.com) and sign in. |
| 82 | + |
| 83 | +2. Push your code to your Git repository (GitHub or GitLab). |
| 84 | + |
| 85 | +3. From the [Seenode Dashboard](https://cloud.seenode.com/dashboard/applications/web/create), create a new **Web Service** and connect your repository. |
| 86 | + |
| 87 | +4. Seenode will automatically detect your Astro project. Configure the deployment settings: |
| 88 | + |
| 89 | + - **Build Command:** `npm ci && npm run build` (or use `pnpm` / `yarn` equivalents) |
| 90 | + - **Start Command:** `npm start` |
| 91 | + - **Port:** `80` (required for web services) |
| 92 | + |
| 93 | +5. Select your preferred instance size and click **Create Web Service**. |
| 94 | + |
| 95 | +6. Your application will be built and deployed. Once complete, you'll receive a URL to access your live Astro site after which you can link your domain. |
| 96 | +</Steps> |
| 97 | + |
| 98 | +## Official Resources |
| 99 | + |
| 100 | +- [Seenode Cloud](https://cloud.seenode.com) — Seenode dashboard |
| 101 | +- [Seenode Documentation](https://seenode.com/docs) — complete platform documentation |
| 102 | +- [Seenode Astro Guide](https://seenode.com/docs/frameworks/javascript/astro/) — detailed deployment guide and troubleshooting |
| 103 | +- [Seenode Astro Template](https://github.com/seenode/example-astro) — pre-configured starter template |
0 commit comments