Deploy your Astro Site to Sevalla
此内容尚不支持你的语言。
Sevalla is an all-in-one hosting and management platform for static sites, applications, and databases.
This guide details how to deploy your Astro project to Sevalla.
Prerequisites
- A Sevalla account.
- Your Astro project pushed to a public or supported private Git repository (GitHub, GitLab, or Bitbucket).
Static Site Deployment
Sevalla's Static Site Hosting deploys your site directly to a global edge network.
Create a new Static Site in the Sevalla dashboard.
Connect your Git repository (GitHub, GitLab, or Bitbucket).
Select your repository and branch (e.g.,
main).Configure the build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
Click Create Static Site to deploy.
:::noteAstro defaults to output: 'static', so no additional configuration is required for static deployment.:::
SSR Deployment
Sevalla's Application Hosting supports full-stack applications. You can deploy Astro projects using on-demand rendering (server-side rendering) via the Node.js adapter.
Add the
@astrojs/nodeadapter to your Astro project.npx astro add nodeConfigure the adapter in
astro.config.mjs. Setmode: 'standalone'and ensurehost: trueis set so the server listens on all addresses (required for containerized environments).import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; export default defineConfig({ output: 'server', adapter: node({ mode: 'standalone' }), server: { host: true } });Ensure your
package.jsonhas astartscript that runs the built server:"scripts": { "start": "node ./dist/server/entry.mjs" }Create a new Application in the Sevalla dashboard.
Connect your Git repository.
Configure the build settings:
- Build Method: Sevalla automatically detects Node.js projects (via Nixpacks).
- Build command:
npm run build - Start command:
npm run start
Click Create Application to deploy.
Troubleshooting
Build Failures
Check the Build Logs in the Sevalla dashboard for error messages. Ensure all dependencies are in dependencies (not devDependencies if needed at runtime).
Node Version
Ensure the Node.js version selected in Sevalla matches your local development version (check node -v).