JavaScript Frameworks

The following are examples of how to set up applications using JavaScript frameworks to deploy on Kinsta’s Hosting services from a GitHub repository. This includes:

We also have examples of Node.js applications.

Astro SSR

This is an example of how to set up an Astro site with server-side rendering (SSR) on Kinsta’s Application Hosting services from a GitHub repository.

By default, Astro is a static site builder focusing on content-rich websites to deliver faster load times with less JavaScript. Enabling SSR in Astro makes it possible to add dynamic features like sessions for login, connecting with a database, and more to your site. More information is available on the Astro website.

During the deployment process, Kinsta automatically installs dependencies defined in your package.json file.

  1. Log in to GitHub and create a new repository from this template (Use this template > Create a new repository): Kinsta – Hello World – SSR Site With Astro.
  2. In MyKinsta, add an application with the Hello World Astro SSR repository. The Start command can be left blank for the web process as Kinsta automatically detects the required command during the first deployment.

The site is available as soon as the build finishes and the Kinsta Welcome page loads at your application’s URL.

Kinsta Welcome page after successful installation of Astro.
Kinsta Welcome page after successful installation of Astro.

Prefer to watch the video version?

Web Server Setup

Port

Kinsta automatically sets the PORT environment variable. You should not define it yourself or hard-code it into the application.

Start Command

When you deploy the application, Kinsta automatically creates a web process with npm start as the Start command. Make sure to use this command to run your server.

Deployment Lifecycle

Whenever a deployment is initiated (through creating an application or re-deploying due to an incoming commit), the npm build command is run, followed by the npm start command.

Deno

This is an example of how to set up a Deno application to deploy on Kinsta’s Application Hosting services from a GitHub repository.

Deno is a JavaScript, TypeScript, and WebAssembly runtime that allows you to run code outside of a web browser that allows you to build secure server-side applications. More information is available at the Deno website.

During the deployment process, Kinsta automatically installs dependencies defined in your package.json file.

  1. Log in to GitHub and create a new repository from this template (Use this template > Create a new repository): Kinsta – Hello World – Deno.
  2. In MyKinsta, add an application with the Hello World – Deno. The Start command can be left blank for the web process as Kinsta automatically detects the required command during the first deployment.

The app is available as soon as the build finishes, and a Hello World page loads at your application’s URL.

Deno Hello World page after successful installation.
Deno Hello World page after successful installation.

Web Server Setup

Port

Kinsta automatically sets the PORT environment variable. You do not need to define it or hard-code it into the application.

Start Command

When you deploy the application, Kinsta automatically creates a web process with npm start as the Start command.

Deployment Lifecycle

Whenever a deployment is initiated (through creating an application or re-deploying due to an incoming commit), the npm build command is run, followed by the npm start command.

Next.js With Prisma ORM

This is an example of how to set up a Next.js and Prisma application to deploy on Kinsta’s Application Hosting and Database Hosting services from a GitHub repository.

Prisma is an open-source database toolkit that simplifies database access for developers by providing a type-safe and intuitive API. It supports multiple databases and generates efficient, optimized SQL queries for faster performance. More information is available on the prisma.io website.

Kinsta automatically installs dependencies defined in your package.json file during the deployment process. This application requires a PostgreSQL database to work.

  1. In MyKinsta, add a database and choose PostgreSQL as the database type.
  2. Log in to GitHub and create a new repository from this template (Use this template > Create a new repository): Kinsta – Hello World – Prisma. Make sure you choose the same Data center location for your application as you did for your database.
  3. In MyKinsta, add an application with the Hello World – Prisma repository.
  4. Once the database is ready for connections (a green check mark is shown next to it), add the internal connection between your application and database from either the application’s Settings page or the database’s Info page.
    1. Select the Add environment variables… checkbox.
    2. Select the Add environment variables to the application checkbox.
    3. Click Add connection.
  1. Go to the application’s Deployments page and click Deploy now > Deploy application.

The app is available as soon as the build finishes, and the Kinsta Welcome page loads at your application’s URL.

Kinsta Welcome page after successful installation of Next.js and Prisma.
Kinsta Welcome page after successful installation of Next.js and Prisma.

Web Server Setup

Port

Kinsta automatically sets the PORT environment variable. You should not define it yourself, and you should not hard-code it into the application.

Start Command

Kinsta automatically creates a web process when deploying an application with npm start as the Start command. Make sure to use this command to run your server.

Deployment Lifecycle

Whenever a deployment is initiated (through creating an application or redeploying due to an incoming commit), the npm build command is run, followed by the npm start command.

React

This is an example of how to set up a React application to deploy on Kinsta’s Application Hosting services from a GitHub repository.

React is a popular JavaScript library for building user interfaces. It allows developers to create reusable UI components and efficiently update the UI in response to data changes. More information is available on the React website.

Kinsta automatically installs dependencies defined in your package.json file during the deployment process.

  1. Log in to GitHub and create a new repository from this template (Use this template > Create a new repository): Kinsta – Hello World – React.
  2. In MyKinsta, add an application with the Hello World – React repository. The Start command can be left blank for the web process as Kinsta automatically detects the required command during the first deployment.

The app is available as soon as the build finishes, and the Kinsta Welcome page loads at your application’s URL.

Kinsta Welcome page after successful deployment of React.

Web Server Setup

Port

Kinsta automatically sets the PORT environment variable. You should not define it yourself, and you should not hard-code it into the application.

Start Command

Kinsta automatically creates a web process based on the npm start command in the package.json file when deploying an application.

Deployment Lifecycle

Whenever a deployment is initiated (through creating an application or redeploying due to an incoming commit), the npm start and npm build commands are run.

React With Vite

This is an example of how to set up a React application with Vite to deploy on Kinsta’s Application Hosting services from a GitHub repository.

Vite is a tool that helps you build decentralized applications; it provides developer tools and APIs to simplify the development process and supports multiple programming languages. More information can be found on the Vite website.

React is a popular JavaScript library for building user interfaces. It allows developers to create reusable UI components and efficiently update the UI in response to data changes. More information is available on the React website.

Kinsta automatically installs dependencies defined in your package.json file during the deployment process.

  1. Log in to GitHub and create a new repository from this template (Use this template > Create a new repository): Kinsta – Hello World – Vite + React.
  2. In MyKinsta, add an application with the Hello World – Vite + React repository. The Start command can be left blank for the web process as Kinsta automatically detects the required command during the first deployment.

The app is available as soon as the build finishes, and the Kinsta Welcome page loads at your application’s URL.

Kinsta Welcome page after successful deployment of React with Vite.

Web Server Setup

Port

Kinsta automatically sets the PORT environment variable. You should not define it yourself, and you should not hard-code it into the application.

Start Command

Kinsta automatically creates a web process based on the npm start command in the package.json file when deploying an application.

Deployment Lifecycle

Whenever a deployment is initiated (through creating an application or redeploying due to an incoming commit), the npm install and npm build commands are run.

Was this article helpful?