Deploy your Astro Site to Sevalla
Questi contenuti non sono ancora disponibili nella tua lingua.
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
Section titled “Prerequisites”- A Sevalla account.
- Your Astro project pushed to a public or supported private Git repository (GitHub, GitLab, or Bitbucket).
Static Site Deployment
Section titled “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.
Astro defaults to output: 'static', so no additional configuration is required for static deployment.
SSR Deployment
Section titled “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.Terminal window npx astro add node -
Configure the adapter in
astro.config.mjs. Setmode: 'standalone'and ensurehost: trueis set so the server listens on all addresses (required for containerized environments).astro.config.mjs 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:package.json "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
Section titled “Troubleshooting”Build Failures
Section titled “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
Section titled “Node Version”Ensure the Node.js version selected in Sevalla matches your local development version (check node -v).