Zum Inhalt springen

Deploy your Astro Site to Sevalla

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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

Static Site Deployment

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.

:::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.

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

    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).

    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:

    "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.

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).

Weitere Veröffentlichungs-Anleitungen

Wirke mit Community Sponsor