# Deploy Astro or Node.js on your own server

> Deploy an Astro site or a Node.js app to your own VPS with Vantuly: from the vantuly CLI, from Git on every push, or from your AI coding agent.

Source: https://vantuly.com/docs/guides/deploy-astro-nodejs

This guide puts an Astro site or a Node.js app on a server you own, with HTTPS, in three ways: one command from your laptop, Git on every push, or your AI coding agent. Pick the one that fits.

**You need:** a Vantuly account with a [connected server](/docs/start/connect-server). Pick the **Node.js** stack (NGINX and Node.js 24, no PHP or MariaDB) when you connect it; otherwise Node.js 24 is installed on the first deploy that needs it.

## How each kind of project runs

| | Astro (static output) | Node.js app |
|---|---|---|
| Build | `npm ci && npm run build` | `npm ci && npm run build` by default |
| Serves | NGINX serves `dist/` | Your app, as a systemd service behind NGINX |
| Node process | None stays running | Runs all the time on the port in `PORT` |
| Failed deploy | The live site keeps running | The app must listen within 30 seconds, or the deploy switches back to the previous release |

A server-rendered Astro site is a Node.js app: deploy it as a Node.js site.

## Option A: one command from your laptop

1. Install the CLI and sign in:

   ```sh
   npm install -g vantuly
   ```

   ```sh
   vantuly login
   ```

2. **Astro or another static site:** build it, then deploy the output folder:

   ```sh
   npm run build
   ```

   ```sh
   vantuly deploy dist
   ```

   **Node.js app:** deploy the project folder. It is uploaded as source and built on the server:

   ```sh
   vantuly deploy .
   ```

3. The CLI prints the live address, for example `https://my-blog.vantuly.site`. The first deploy creates the site; later deploys from the same folder update it.

`.git`, `node_modules` and `.env` files are never uploaded. Set secrets with `vantuly env set KEY=value` instead. If something breaks, `vantuly logs` shows the build log and `vantuly rollback` puts the previous release back. See [Deploy a site](/docs/cli/deploy) and [Commands](/docs/cli/commands).

## Option B: deploy from Git on every push

1. Click **New site** and choose **Astro** or **Node.js**.
2. Connect your repository: add the **Deploy key** and **Deploy webhook** Vantuly shows, or on GitHub [use a GitHub App](/docs/guides/github-app) and pick the repository from a list.
3. Turn on **Auto-deploy on push**.

Each push builds a new release next to the running one and switches over only when the build succeeds. Change the build in the deploy script and the start command in **Settings → App**. See [Deploy from Git](/docs/guides/git-deploy).

## Option C: let your AI agent deploy

Connect the vantuly MCP server to your coding agent. For Claude Code:

```sh
vantuly mcp install claude
```

Then ask the agent to build and deploy the project. It calls tools like `deploy` and `deployment_logs`, reads the build log if a deploy fails, fixes the cause and deploys again. Codex, Cursor, OpenCode, Gemini CLI and many others work too: see [AI agents](/docs/cli/ai-agents) and [MCP server](/docs/cli/mcp).

## Add your domain

Run `vantuly domains add example.com`, or add it on the site's **Domains** tab. If your DNS is on Cloudflare and connected to Vantuly, the records are created for you; otherwise point an A record at the server. HTTPS follows once DNS matches. See [Add your own domain](/docs/domains/own-domain).

## Good to know

- Node.js apps are limited to 512 MB of memory and can write only inside their home folder.
- Turn on **Worker** for apps that serve no HTTP, such as queue consumers or bots.
- While a Node.js app is down, visitors see a placeholder page instead of an error.
- Next.js deploys with the CLI as a static export (`output: "export"`, then `vantuly deploy out`). For server rendering, ship it with a Dockerfile as a [Docker site](/docs/apps/sites/docker).

## Next

- [Astro sites](/docs/apps/sites/astro)
- [Node.js sites](/docs/apps/sites/nodejs)
- [EmDash sites](/docs/apps/sites/emdash)
