From e8c472f914e93f342dcd129d1eb26aeabe0fab71 Mon Sep 17 00:00:00 2001 From: nmakarevich-prog Date: Fri, 16 Oct 2026 13:42:19 +0300 Subject: [PATCH 01/18] Expand is*hosting deployment guide for static and SSR Astro sites Expand the existing is*hosting deployment guide with step-by-step instructions for deploying static and server-side rendered (SSR) Astro sites on a VPS. The update covers: - VPS prerequisites and Node.js installation - Astro SSR configuration with the Node.js adapter - Running SSR applications with PM2 and Nginx - Static site deployment using Nginx - HTTPS configuration with Certbot - Updating deployed Astro sites The guide also includes properly formatted code blocks and links to relevant resources. --- .../docs/en/guides/deploy/ishosting.mdx | 266 ++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 212033b568e98..7e404784000e9 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -10,7 +10,273 @@ i18nReady: true --- [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. +--- + + You can deploy your Astro project to an [is\*hosting VPS](https://ishosting.com/vps), where you can host either a static site or a server-side rendered (SSR) site. + + A VPS is suitable when your Astro site uses SSR and requires a persistent server, database connections, background jobs, cron jobs, or API routes. + + ## Project Configuration + + Your Astro project can be deployed to an is\*hosting VPS as a static site or as a server-side rendered site (SSR). + + ### Static Site + + Your Astro project is a static site by default. You don't need any extra Astro configuration to deploy a static site to an is\*hosting VPS. + + ### Adapter for SSR + + To enable on-demand rendering in your Astro project and deploy it to an is\*hosting VPS, add [the Node.js adapter](/en/guides/integrations-guide/node/). + + ## Prerequisites + + To deploy your Astro site to an is\*hosting VPS, you will need: + + - An Astro project + - An is\*hosting VPS running Ubuntu 22.04 or 24.04 with SSH access and `root` or `sudo` privileges + - A domain name pointing to your VPS if you want to enable HTTPS + - For SSR, [an adapter configured for on-demand rendering](/en/guides/on-demand-rendering/#server-adapters) + + Connect to your VPS using SSH and update the installed packages: + + ```shell + ssh root@YOUR_VPS_IP + apt update && apt upgrade -y + ``` + + Install Node.js 22 and Nginx: + + ```shell + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - + apt install -y nodejs nginx + ``` + + Verify the Node.js installation: + + ```shell + node --version + npm --version + ``` + + The server commands in this guide assume you are logged in as `root`. If you use another account, run administrative commands with `sudo`. The installation commands require `curl` to be available, and cloning a repository requires `git`. + + ## Deploy an SSR Astro Site + + For an Astro site using on-demand rendering, configure the Node.js adapter in `standalone` mode and run the generated server behind an Nginx reverse proxy. + + 1. Add the Node.js adapter to your Astro project. Run the appropriate command in your local Astro project, then commit the configuration changes before deploying. + + Choose your package manager: + + **npm:** + + ```shell + npx astro add node + ``` + + **pnpm:** + + ```shell + pnpm astro add node + ``` + + **yarn:** + + ```shell + yarn astro add node + ``` + + 2. Configure the adapter to use `standalone` mode in `astro.config.mjs`: + + ```js + import { defineConfig } from 'astro/config'; + import node from '@astrojs/node'; + + export default defineConfig({ + output: 'server', + adapter: node({ + mode: 'standalone', + }), + }); + ``` + + 3. Copy or clone your Astro project to the VPS and install its dependencies: + + ```shell + cd /var/www + git clone YOUR_REPOSITORY_URL astro + cd astro + npm install + ``` + + Replace `YOUR_REPOSITORY_URL` with the URL of your repository. + + 4. Build your Astro site: + + ```shell + npm run build + ``` + + The standalone Node.js server entry point will be generated at `dist/server/entry.mjs`. + + 5. Install PM2: + + ```shell + npm install -g pm2 + ``` + + 6. Start the Astro server with PM2: + + ```shell + HOST=127.0.0.1 PORT=4321 pm2 start dist/server/entry.mjs --name astro-app + ``` + + 7. Verify that the process is running: + + ```shell + pm2 status + ``` + + 8. Configure PM2 to restore the process after a server restart: + + ```shell + pm2 startup + ``` + + Run the command printed by PM2, then save the current process list: + + ```shell + pm2 save + ``` + + 9. Create an Nginx configuration for your Astro site: + + ```shell + nano /etc/nginx/sites-available/astro + ``` + + 10. Add the following configuration, replacing `your.domain.com` with your domain: + + ```nginx + server { + listen 80; + server_name your.domain.com; + + location / { + proxy_pass http://127.0.0.1:4321; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + ``` + + 11. Enable the Nginx configuration and reload Nginx: + + ```shell + ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/astro + nginx -t + systemctl reload nginx + ``` + + + Your Astro SSR site is now served through Nginx, which forwards incoming requests to the Node.js process running on `127.0.0.1:4321`. + + ## Deploy a Static Astro Site + + For a static Astro site, build your project and serve the generated `dist/` directory directly with Nginx. A persistent Node.js process is not required. + + 1. Copy or clone your Astro project to the VPS, install its dependencies, and build the site: + + ```shell + cd /var/www + git clone YOUR_REPOSITORY_URL astro + cd astro + npm install + npm run build + ``` + + 2. Create an Nginx configuration: + + ```shell + nano /etc/nginx/sites-available/astro + ``` + + 3. Add the following configuration, replacing `your.domain.com` with your domain: + + ```nginx + server { + listen 80; + server_name your.domain.com; + + root /var/www/astro/dist; + index index.html; + + location / { + try_files $uri $uri/ $uri.html =404; + } + } + ``` + + 4. Enable the configuration and reload Nginx: + + ```shell + ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/astro + nginx -t + systemctl reload nginx + ``` + + + Your static Astro site is now served directly from the generated `dist/` directory. + + ## Add HTTPS + + After your domain points to the VPS, you can use Certbot to configure HTTPS for either a static or SSR deployment. Make sure ports 80 and 443 are accessible. + + 1. Install Certbot and its Nginx plugin: + + ```shell + apt install -y certbot python3-certbot-nginx + ``` + + 2. Request a certificate for your domain: + + ```shell + certbot --nginx -d your.domain.com + ``` + + Replace `your.domain.com` with your domain and follow the prompts. + + 3. Test automatic certificate renewal: + + ```shell + certbot renew --dry-run + ``` + + + ## Update Your Astro Site + + To update an SSR deployment, pull the latest changes, install dependencies, rebuild the project, and restart the PM2 process: + + ```shell + cd /var/www/astro + git pull + npm install + npm run build + pm2 restart astro-app + ``` + + For a static deployment, rebuild the site and reload Nginx: + ```shell + cd /var/www/astro + git pull + npm install + npm run build + systemctl reload nginx + ``` ## Official Resources - [is\*hosting guide: deploy Astro on a VPS (static and SSR)](https://blog.ishosting.com/en/astro-on-vps) From c143374c2adebba31fc593c6d3f9f5a01f13013c Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:02:13 +0300 Subject: [PATCH 02/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 7e404784000e9..b67499537cd81 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -8,6 +8,8 @@ logo: ishosting supports: ['ssr', 'static'] i18nReady: true --- +import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; +import { Steps } from '@astrojs/starlight/components'; [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. --- From d900bb154669740c3dce120c211de97525ea9461 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:03:24 +0300 Subject: [PATCH 03/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index b67499537cd81..485289a699094 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -12,8 +12,6 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; import { Steps } from '@astrojs/starlight/components'; [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. ---- - You can deploy your Astro project to an [is\*hosting VPS](https://ishosting.com/vps), where you can host either a static site or a server-side rendered (SSR) site. A VPS is suitable when your Astro site uses SSR and requires a persistent server, database connections, background jobs, cron jobs, or API routes. From e84c8cc7207e6373ec852170080b5ff1a4a0da4f Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:05:26 +0300 Subject: [PATCH 04/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 485289a699094..f7132eafc8ed5 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -12,8 +12,6 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; import { Steps } from '@astrojs/starlight/components'; [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. - You can deploy your Astro project to an [is\*hosting VPS](https://ishosting.com/vps), where you can host either a static site or a server-side rendered (SSR) site. - A VPS is suitable when your Astro site uses SSR and requires a persistent server, database connections, background jobs, cron jobs, or API routes. ## Project Configuration From 3156735eee8d9188c2c05ad4e54917c8d148fefd Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:06:08 +0300 Subject: [PATCH 05/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index f7132eafc8ed5..7f48a7fa03e00 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -16,7 +16,7 @@ import { Steps } from '@astrojs/starlight/components'; ## Project Configuration - Your Astro project can be deployed to an is\*hosting VPS as a static site or as a server-side rendered site (SSR). + Your Astro project can be deployed to an is\*hosting VPS as a static site or as an on-demand rendered site. ### Static Site From 12aa8b10e473d5bf0e56f932b88931ab2129e312 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:06:40 +0300 Subject: [PATCH 06/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 7f48a7fa03e00..2c4704dcfcd56 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -22,7 +22,7 @@ import { Steps } from '@astrojs/starlight/components'; Your Astro project is a static site by default. You don't need any extra Astro configuration to deploy a static site to an is\*hosting VPS. - ### Adapter for SSR + ### Adapter for on-demand rendering To enable on-demand rendering in your Astro project and deploy it to an is\*hosting VPS, add [the Node.js adapter](/en/guides/integrations-guide/node/). From aaed9a680d09cfb0da2a3904764ebc12a56d18ac Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:08:47 +0300 Subject: [PATCH 07/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- .../docs/en/guides/deploy/ishosting.mdx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 2c4704dcfcd56..e5a01cc63f990 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -233,26 +233,27 @@ import { Steps } from '@astrojs/starlight/components'; After your domain points to the VPS, you can use Certbot to configure HTTPS for either a static or SSR deployment. Make sure ports 80 and 443 are accessible. - 1. Install Certbot and its Nginx plugin: + +1. Install Certbot and its Nginx plugin: - ```shell - apt install -y certbot python3-certbot-nginx - ``` + ```shell + apt install -y certbot python3-certbot-nginx + ``` - 2. Request a certificate for your domain: +2. Request a certificate for your domain: - ```shell - certbot --nginx -d your.domain.com - ``` + ```shell + certbot --nginx -d your.domain.com + ``` - Replace `your.domain.com` with your domain and follow the prompts. + Replace `your.domain.com` with your domain and follow the prompts. - 3. Test automatic certificate renewal: - - ```shell - certbot renew --dry-run - ``` +3. Test automatic certificate renewal: + ```shell + certbot renew --dry-run + ``` + ## Update Your Astro Site From 20efac79422ca0e68a55f082ecf2c812850d5f62 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:09:57 +0300 Subject: [PATCH 08/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- .../docs/en/guides/deploy/ishosting.mdx | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index e5a01cc63f990..476669edfcc02 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -255,27 +255,22 @@ import { Steps } from '@astrojs/starlight/components'; ``` - ## Update Your Astro Site +### Update your site - To update an SSR deployment, pull the latest changes, install dependencies, rebuild the project, and restart the PM2 process: +To deploy changes to your site, pull the latest changes, install dependencies, and rebuild your site: - ```shell - cd /var/www/astro - git pull - npm install - npm run build - pm2 restart astro-app - ``` +```shell +cd /var/www/astro +git pull +npm install +npm run build +``` - For a static deployment, rebuild the site and reload Nginx: +If your site is on-demand rendered, restart the PM2 process for the changes to take effect: - ```shell - cd /var/www/astro - git pull - npm install - npm run build - systemctl reload nginx - ``` +```shell +pm2 restart astro-app +``` ## Official Resources - [is\*hosting guide: deploy Astro on a VPS (static and SSR)](https://blog.ishosting.com/en/astro-on-vps) From c5e5dc162025d67250ae61109b1c902c9a26e284 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:26:39 +0300 Subject: [PATCH 09/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 476669edfcc02..77b45f9b0aa9e 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -229,7 +229,7 @@ import { Steps } from '@astrojs/starlight/components'; Your static Astro site is now served directly from the generated `dist/` directory. - ## Add HTTPS + ### Add HTTPS After your domain points to the VPS, you can use Certbot to configure HTTPS for either a static or SSR deployment. Make sure ports 80 and 443 are accessible. From 3889f2750abdacfe861329c71830b51c2efb7419 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:26:56 +0300 Subject: [PATCH 10/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 77b45f9b0aa9e..38c44ce263e8e 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -14,7 +14,7 @@ import { Steps } from '@astrojs/starlight/components'; [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. A VPS is suitable when your Astro site uses SSR and requires a persistent server, database connections, background jobs, cron jobs, or API routes. - ## Project Configuration + ## Project configuration Your Astro project can be deployed to an is\*hosting VPS as a static site or as an on-demand rendered site. From 2c1f129a80db804543b134d2e201b0e5c4836a43 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:27:33 +0300 Subject: [PATCH 11/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 38c44ce263e8e..12f839e7cdb58 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -18,7 +18,7 @@ import { Steps } from '@astrojs/starlight/components'; Your Astro project can be deployed to an is\*hosting VPS as a static site or as an on-demand rendered site. - ### Static Site + ### Static site Your Astro project is a static site by default. You don't need any extra Astro configuration to deploy a static site to an is\*hosting VPS. From 1d758d63108cc52c252f2391bdaa540ab490d100 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:40:48 +0300 Subject: [PATCH 12/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 12f839e7cdb58..00581a58c8a7b 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -33,7 +33,7 @@ import { Steps } from '@astrojs/starlight/components'; - An Astro project - An is\*hosting VPS running Ubuntu 22.04 or 24.04 with SSH access and `root` or `sudo` privileges - A domain name pointing to your VPS if you want to enable HTTPS - - For SSR, [an adapter configured for on-demand rendering](/en/guides/on-demand-rendering/#server-adapters) +- A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS Connect to your VPS using SSH and update the installed packages: From acf183616ab86fee9e49e9d07b45f21072fdd479 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:47:18 +0300 Subject: [PATCH 13/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 00581a58c8a7b..2395d28fc86b0 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -32,7 +32,7 @@ import { Steps } from '@astrojs/starlight/components'; - An Astro project - An is\*hosting VPS running Ubuntu 22.04 or 24.04 with SSH access and `root` or `sudo` privileges - - A domain name pointing to your VPS if you want to enable HTTPS + - A domain name pointing to your VPS - A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS Connect to your VPS using SSH and update the installed packages: From a2ada98cc2296ea9579ba3e07ec278c2bba3805f Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 11:49:09 +0300 Subject: [PATCH 14/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 2395d28fc86b0..c0cfc099c87c9 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -274,3 +274,4 @@ pm2 restart astro-app ## Official Resources - [is\*hosting guide: deploy Astro on a VPS (static and SSR)](https://blog.ishosting.com/en/astro-on-vps) +- [is\*hosting help center for VPS](https://help.ishosting.com/en/virtual-private-servers) From f908b0f3e3b5d76f4397bf730ac7b837f5d31a26 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 12:05:24 +0300 Subject: [PATCH 15/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- src/content/docs/en/guides/deploy/ishosting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index c0cfc099c87c9..991e2f885aa4b 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -31,7 +31,7 @@ import { Steps } from '@astrojs/starlight/components'; To deploy your Astro site to an is\*hosting VPS, you will need: - An Astro project - - An is\*hosting VPS running Ubuntu 22.04 or 24.04 with SSH access and `root` or `sudo` privileges + - An is\*hosting VPS running Ubuntu with SSH access and `root` or `sudo` privileges - A domain name pointing to your VPS - A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS From 338565df6985c15bb1be3bfa93dbc6c6975c8109 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 12:06:12 +0300 Subject: [PATCH 16/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- .../docs/en/guides/deploy/ishosting.mdx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index 991e2f885aa4b..b3261907957a1 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -24,7 +24,25 @@ import { Steps } from '@astrojs/starlight/components'; ### Adapter for on-demand rendering - To enable on-demand rendering in your Astro project and deploy it to an is\*hosting VPS, add [the Node.js adapter](/en/guides/integrations-guide/node/). +To enable on-demand rendering in your Astro project, add [the Node.js adapter](/en/guides/integrations-guide/node/) with the following `astro add` command. This will install the adapter and configure it in `standalone` mode in your `astro.config.mjs` file in one step. + + + + ```shell + npx astro add node + ``` + + + ```shell + pnpm astro add node + ``` + + + ```shell + yarn astro add node + ``` + + ## Prerequisites From 3f943a33eabfcab840be28141f51b4660ebe9929 Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 16:33:13 +0300 Subject: [PATCH 17/18] Update src/content/docs/en/guides/deploy/ishosting.mdx Co-authored-by: Armand Philippot --- .../docs/en/guides/deploy/ishosting.mdx | 247 ++++++------------ 1 file changed, 77 insertions(+), 170 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index b3261907957a1..f117a6ad9ac16 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -53,199 +53,106 @@ To enable on-demand rendering in your Astro project, add [the Node.js adapter](/ - A domain name pointing to your VPS - A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS - Connect to your VPS using SSH and update the installed packages: +## How to deploy - ```shell - ssh root@YOUR_VPS_IP - apt update && apt upgrade -y - ``` +You can deploy to an is\*hosting VPS by building your site on the server and serving it with a web server. - Install Node.js 22 and Nginx: +The following instructions use [Nginx](https://nginx.org/) as the web server, and [PM2](https://pm2.keymetrics.io/) to keep the Node.js server of an on-demand rendered site running. - ```shell - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - - apt install -y nodejs nginx - ``` +### Set up your VPS - Verify the Node.js installation: - - ```shell - node --version - npm --version - ``` - - The server commands in this guide assume you are logged in as `root`. If you use another account, run administrative commands with `sudo`. The installation commands require `curl` to be available, and cloning a repository requires `git`. - - ## Deploy an SSR Astro Site - - For an Astro site using on-demand rendering, configure the Node.js adapter in `standalone` mode and run the generated server behind an Nginx reverse proxy. - - 1. Add the Node.js adapter to your Astro project. Run the appropriate command in your local Astro project, then commit the configuration changes before deploying. - - Choose your package manager: - - **npm:** - - ```shell - npx astro add node - ``` - - **pnpm:** - - ```shell - pnpm astro add node - ``` - - **yarn:** - - ```shell - yarn astro add node - ``` - - 2. Configure the adapter to use `standalone` mode in `astro.config.mjs`: - - ```js - import { defineConfig } from 'astro/config'; - import node from '@astrojs/node'; - - export default defineConfig({ - output: 'server', - adapter: node({ - mode: 'standalone', - }), - }); - ``` - - 3. Copy or clone your Astro project to the VPS and install its dependencies: - - ```shell - cd /var/www - git clone YOUR_REPOSITORY_URL astro - cd astro - npm install - ``` - - Replace `YOUR_REPOSITORY_URL` with the URL of your repository. - - 4. Build your Astro site: - - ```shell - npm run build - ``` - - The standalone Node.js server entry point will be generated at `dist/server/entry.mjs`. - - 5. Install PM2: - - ```shell - npm install -g pm2 - ``` - - 6. Start the Astro server with PM2: - - ```shell - HOST=127.0.0.1 PORT=4321 pm2 start dist/server/entry.mjs --name astro-app - ``` - - 7. Verify that the process is running: - - ```shell - pm2 status - ``` - - 8. Configure PM2 to restore the process after a server restart: - - ```shell - pm2 startup - ``` - - Run the command printed by PM2, then save the current process list: - - ```shell - pm2 save - ``` - - 9. Create an Nginx configuration for your Astro site: - - ```shell - nano /etc/nginx/sites-available/astro - ``` - - 10. Add the following configuration, replacing `your.domain.com` with your domain: - - ```nginx - server { - listen 80; - server_name your.domain.com; + +1. Connect to your VPS using SSH and install both the web server and Git: - location / { - proxy_pass http://127.0.0.1:4321; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } - ``` + ```shell + apt update + apt install nginx git + ``` - 11. Enable the Nginx configuration and reload Nginx: + The server commands in this guide assume you are logged in as `root`. If you use another account, run administrative commands with `sudo`. - ```shell - ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/astro - nginx -t - systemctl reload nginx - ``` +2. Clone your Astro project to your VPS, install its dependencies, and build your site: + ```shell + cd /var/www + git clone YOUR_REPOSITORY_URL astro + cd astro + npm install + npm run build + ``` + - Your Astro SSR site is now served through Nginx, which forwards incoming requests to the Node.js process running on `127.0.0.1:4321`. +### Deploy a static site - ## Deploy a Static Astro Site + +1. Create an Nginx configuration file at `/etc/nginx/sites-available/astro` to serve the generated `dist/` folder: - For a static Astro site, build your project and serve the generated `dist/` directory directly with Nginx. A persistent Node.js process is not required. + ```nginx title="/etc/nginx/sites-available/astro" + server { + listen 80; + server_name your.domain.com; - 1. Copy or clone your Astro project to the VPS, install its dependencies, and build the site: + root /var/www/astro/dist; + index index.html; + error_page 404 /404.html; - ```shell - cd /var/www - git clone YOUR_REPOSITORY_URL astro - cd astro - npm install - npm run build - ``` + location / { + try_files $uri $uri/ $uri.html =404; + } + } + ``` - 2. Create an Nginx configuration: +2. Enable the Nginx configuration and reload Nginx: - ```shell - nano /etc/nginx/sites-available/astro - ``` + ```shell + ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/ + nginx -t + systemctl reload nginx + ``` + - 3. Add the following configuration, replacing `your.domain.com` with your domain: +### Deploy an on-demand rendered site - ```nginx - server { - listen 80; - server_name your.domain.com; + +1. Install PM2 and use it to start the Node.js server: - root /var/www/astro/dist; - index index.html; + ```shell + npm install -g pm2 + HOST=127.0.0.1 PORT=4321 pm2 start dist/server/entry.mjs --name astro-app + ``` - location / { - try_files $uri $uri/ $uri.html =404; - } - } - ``` +2. Configure PM2 to restart the Node.js server after a reboot: - 4. Enable the configuration and reload Nginx: + ```shell + pm2 startup && pm2 save + ``` - ```shell - ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/astro - nginx -t - systemctl reload nginx - ``` +3. Create an Nginx configuration file at `/etc/nginx/sites-available/astro` to forward requests to the Node.js server: + + ```nginx title="/etc/nginx/sites-available/astro" + server { + listen 80; + server_name your.domain.com; + + location / { + proxy_pass http://127.0.0.1:4321; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + ``` +4. Enable the Nginx configuration and reload Nginx: - Your static Astro site is now served directly from the generated `dist/` directory. + ```shell + ln -s /etc/nginx/sites-available/astro /etc/nginx/sites-enabled/ + nginx -t + systemctl reload nginx + ``` + ### Add HTTPS From f0e654711a08faac7b1d1087fb0ea13e65570b2d Mon Sep 17 00:00:00 2001 From: natashamakarevich Date: Tue, 20 Oct 2026 17:47:31 +0300 Subject: [PATCH 18/18] Apply suggestion from @ArmandPhilippot Co-authored-by: Armand Philippot --- .../docs/en/guides/deploy/ishosting.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/content/docs/en/guides/deploy/ishosting.mdx b/src/content/docs/en/guides/deploy/ishosting.mdx index f117a6ad9ac16..62ee6f2a96866 100644 --- a/src/content/docs/en/guides/deploy/ishosting.mdx +++ b/src/content/docs/en/guides/deploy/ishosting.mdx @@ -14,6 +14,15 @@ import { Steps } from '@astrojs/starlight/components'; [is\*hosting](https://ishosting.com/) is a hosting provider offering VPS and dedicated servers in 40+ locations that you can use to self-host a static or server-rendered (SSR) Astro site. A VPS is suitable when your Astro site uses SSR and requires a persistent server, database connections, background jobs, cron jobs, or API routes. + ## Prerequisites + + To deploy your Astro site to an is\*hosting VPS, you will need: + + - An Astro project + - An is\*hosting VPS running Ubuntu with SSH access and `root` or `sudo` privileges + - A domain name pointing to your VPS +- A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS + ## Project configuration Your Astro project can be deployed to an is\*hosting VPS as a static site or as an on-demand rendered site. @@ -44,15 +53,6 @@ To enable on-demand rendering in your Astro project, add [the Node.js adapter](/ - ## Prerequisites - - To deploy your Astro site to an is\*hosting VPS, you will need: - - - An Astro project - - An is\*hosting VPS running Ubuntu with SSH access and `root` or `sudo` privileges - - A domain name pointing to your VPS -- A Node.js version that meets [Astro's minimum requirements](/en/install-and-setup/#prerequisites) installed on your VPS - ## How to deploy You can deploy to an is\*hosting VPS by building your site on the server and serving it with a web server.