跳到內容

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.

Sevalla’s Static Site Hosting deploys your site directly to a global edge network.

  1. Create a new Static Site in the Sevalla dashboard.

  2. Connect your Git repository (GitHub, GitLab, or Bitbucket).

  3. Select your repository and branch (e.g., main).

  4. Configure the build settings:

    • Build command: npm run build
    • Publish directory: dist
  5. Click Create Static Site to deploy.

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.

  1. Add the @astrojs/node adapter to your Astro project.

    Terminal window
    npx astro add node
  2. Configure the adapter in astro.config.mjs. Set mode: 'standalone' and ensure host: true is 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
    }
    });
  3. Ensure your package.json has a start script that runs the built server:

    package.json
    "scripts": {
    "start": "node ./dist/server/entry.mjs"
    }
  4. Create a new Application in the Sevalla dashboard.

  5. Connect your Git repository.

  6. Configure the build settings:

    • Build Method: Sevalla automatically detects Node.js projects (via Nixpacks).
    • Build command: npm run build
    • Start command: npm run start
  7. Click Create Application to deploy.

Check the Build Logs in the Sevalla dashboard for error messages. Ensure all dependencies are in dependencies (not devDependencies if needed at runtime).

Ensure the Node.js version selected in Sevalla matches your local development version (check node -v).

更多部署指南

貢獻 社群 贊助