Deploy / Astro
Deploy Astro to Your Own Server
To deploy an Astro site to your own server, install Temps on a Linux VPS and run up --preset vite from the project root. Temps runs your build script (astro build) and serves dist/ from its proxy with automatic HTTPS; no container runs. For on-demand rendering, add the Node adapter in standalone mode and deploy with up --preset nixpacks-node and a Procfile that starts the server.
Last updated
Preset required
Choose the Vite preset (vite) for a static site, or the Autopack (Node.js) preset (nixpacks-node) for on-demand rendering with @astrojs/node. An astro.config.* isn't a detection signal. A project that also has a vite.config.* is picked up as a static Vite build; otherwise the build stops until you set a preset.
A static Astro site also builds under the Node.js preset, where a web server inside the app's container serves dist/; with the Vite preset no container runs.
How to deploy Astro with Temps
Commands run on your machine unless they say otherwise. The CLI runs with bunx or npx.
- 1
Install Temps on a Linux server
On a VPS with at least 2 CPU cores and 4 GB of RAM, download the installer, read it, then run it. It installs Docker if needed, the Temps binary and its database, and asks how the console is reached: an sslip.io address or your own domain.
curl -fsSL https://temps.sh/deploy.sh -o deploy.sh less deploy.sh bash deploy.sh
- 2
Log in from your machine
Point the CLI at your Temps console. It opens a browser to approve the login.
bunx @temps-sdk/cli login https://console.example.com
- 3
SSR only: add the Node adapter
Run
npx astro add node, then set the adapter to standalone mode.astro.config.mjsimport { defineConfig } from "astro/config"; import node from "@astrojs/node"; export default defineConfig({ output: "server", adapter: node({ mode: "standalone" }), }); - 4
SSR only: start the standalone server
Deploy with
up --preset nixpacks-nodeand tell Temps to run the server entry with aProcfileweb:line. The standalone server readsHOSTandPORT, and Temps injects both (HOSTis0.0.0.0), so it's reachable by the health check without extra settings.Procfileweb: node ./dist/server/entry.mjs
- 5
Deploy Astro
From the project root, run
upwith the preset that matches your build, or set it under Project → Settings → Build & deploy → Build → Framework. If the directory isn't linked to a project yet,upwalks you through creating one first. For a project created from a Git repository, pushes to the tracked branch deploy automatically.# Static site bunx @temps-sdk/cli up --preset vite # On-demand rendering with @astrojs/node bunx @temps-sdk/cli up --preset nixpacks-node
How Temps builds and runs Astro
Every app runs in a Docker container on your server, behind the Temps proxy. Before traffic switches to a new deployment, Temps health-checks it; if the check fails, the deployment is marked failed and the current version keeps serving.
| Build | Your build script (astro build) |
|---|---|
| Static | dist/ served by the Temps proxy with no container; hashed assets get long-lived cache headers |
| Routes | /about serves dist/about/index.html; unknown paths fall back to the root index.html |
| SSR | With the Node.js preset, @astrojs/node in standalone mode; the server reads the HOST (0.0.0.0) and PORT Temps injects |
| Content | Content collections are bundled at build time |
What works with Astro on Temps
- Static output in
dist/, served by the Temps proxy - SSR with
@astrojs/nodein standalone mode - Content collections bundled at build time
- Islands hydrate as in development
- Preview environments per branch (opt-in)
- Built-in web analytics
Environment variables for Astro
Set your own with environments vars set or in the project settings; values are encrypted at rest.
| Variable | What it does |
|---|---|
| PUBLIC_* | Exposed to client code at build time |
| HOST | Set to 0.0.0.0 by Temps; the standalone SSR server reads it |
| PORT | Set by Temps |
What it costs to self-host Astro
Temps is free to self-host under MIT / Apache 2.0, with no per-seat fee and nothing metered, so hosting Astro costs what the server costs. A Hetzner CX23 (2 shared vCPU, 4 GB RAM, 40 GB NVMe, 20 TB traffic) meets the minimum Temps needs and is €5.49/month excluding VAT, plus €0.50/month for an IPv4 address; Hetzner sells it in Germany and Finland only. Prices checked October 10, 2026.
| Temps | Free and open source (MIT / Apache 2.0) |
|---|---|
| Server | Hetzner CX23: €5.49/month excluding VAT, plus €0.50/month for IPv4 |
| What Astro runs | A static site runs no container: the Temps proxy serves it. On-demand rendering runs one Node.js container. |
| Observability | Web analytics, error tracking, session replay and uptime monitoring are included and run on the same server |
| Temps Premium | Optional: $399 per organisation per month for SAML SSO, SCIM, custom roles, approval gates and a tamper-evident audit log |
For one to three production apps, the server guide recommends 4 vCPU and 8 GB RAM: a Hetzner CX33 is €8.49/month excluding VAT. Any Linux VPS that meets the minimum works; sizes and other providers are in Choosing a server. For what the same app costs on Netlify, see Temps vs Netlify.
Astro on Temps: frequently asked questions
Does Temps auto-detect Astro?
No. astro.config.* isn't a detection signal, so choose a preset: Vite (vite) for a static site, or Autopack (Node.js) (nixpacks-node) for on-demand rendering with the Node adapter. Projects that also contain a vite.config.* are picked up as static Vite builds.
Do I need the Node adapter to deploy Astro on Temps?
Only for on-demand rendering. A fully static Astro site builds to dist/, needs no adapter, and is served by the Temps proxy with the Vite preset. Don't use astro preview as a production server; it's meant for checking a build locally.
Why does my Astro SSR deploy fail its health check?
Usually because the server never started: on-demand rendering needs the Node.js preset (nixpacks-node), and without a Procfile web: line such as web: node ./dist/server/entry.mjs, Temps has no command for the standalone server. If you override HOST with your own project variable, keep it at 0.0.0.0, or the health check can't reach the app.
Included with every Temps project
Deployments, analytics, error tracking, session replay and uptime monitoring run in the same self-hosted platform, so your Astro app doesn't need separate subscriptions for them.
Automatic HTTPS
Let's Encrypt certificates for every domain, issued and renewed for you.
Preview deployments
Turn on preview environments and each branch gets its own URL on your domain.
Web analytics
First-party analytics stored on your server. Add the React provider or a script tag.
Error tracking
Sentry-compatible: any Sentry SDK can report to the SENTRY_DSN Temps injects.
Session replay
Off by default. When on, it records the DOM with every input masked.
Uptime monitoring
HTTP monitors for your apps, with alerts through your notification channels.
Related guides
- Every setting for this stack is in the Astro deployment reference.
- Which stacks are detected and which need a preset is listed in supported languages and frameworks.
- How health checks, cutover and rollbacks work is covered in Deployments.
- Hosting on Netlify today? See Temps vs Netlify.
- Or compare with Temps vs Cloudflare Pages.
Deploy another framework
Deploy Astro on a server you own
Temps is free and open source to self-host (MIT / Apache 2.0). You pay only for the server.