Deploy your Astro Site to Kinsta Application Hosting
Ta treść nie jest jeszcze dostępna w Twoim języku.
You can use Kinsta Application Hosting to host an Astro site on their cloud hosting.
Configuring your Astro project
Section titled Configuring your Astro projectStatic hosting
Section titled Static hostingCheck out the official Kinsta Application Hosting Starter project for Astro!
To host your project on Kinsta Application Hosting, you need to:
- Include a
namefield in yourpackage.json. (This can be anything, and will not affect your deployment.) - Include a
buildscript in yourpackage.json. (Your Astro project should already include this.) - Install the
servepackage and set thestartscript toserve dist/.
Here are the necessary lines in your package.json file:
{ "name": "anything", // This is required, but the value does not matter. "scripts": { "dev": "astro dev", "start": "serve dist/", "build": "astro build", "preview": "astro preview", "astro": "astro" }, "dependencies": { "astro": "^2.2.0", "serve": "^14.0.1" },}Check out the official Kinsta Application Hosting Starter project for Astro SSR!
To host your project on Kinsta Application Hosting, you need to:
- Include a
namefield in yourpackage.json. (This can be anything, and will not affect your deployment.) - Include a
buildscript in yourpackage.json. (Your Astro project should already include this.) - Install the
@astrojs/nodepackage and set thestartscript tonode ./dist/server/entry.mjs. - Set the
astro.config.mjsto use@astrojs/nodeand to usehost: true.
Here are the necessary lines in your package.json file:
{ "name": "anything", // This is required, but the value does not matter. "scripts": { "dev": "astro dev", "start": "node ./dist/server/entry.mjs", "build": "astro build", "preview": "astro preview", "astro": "astro" }, "dependencies": { "astro": "^2.2.0", "@astrojs/node": "^5.1.1" },}Here are the necessary lines in your astro.config.mjs file:
import { defineConfig } from 'astro/config'; import node from "@astrojs/node";
export default defineConfig({ output: 'server', adapter: node({ mode: "standalone" }), server: { host: true } });How to deploy
Section titled How to deployOnce your project’s GitHub repository is connected, you can trigger manual deploys to Kinsta Application Hosting in the MyKinsta Admin Panel. You can also set up automatic deployments in your admin panel.
Configuring a new Kinsta application
Section titled Configuring a new Kinsta application-
Go to the My Kinsta admin panel.
-
Go to the Applications tab.
-
Connect your GitHub repository.
-
Press the Add service > Application button.
-
Follow the wizard steps.
-
Your application is deployed.