Deploy Astro on Your Own Server

Deploy Astro sites as static HTML or with server-side rendering using the Node adapter. Perfect for content-heavy sites, blogs, and documentation.


Quickstart

From your project root, deploy with your preferred package manager:

npx @temps-sdk/cli up

Temps detects your astro.config.*, runs npm run build, and serves the output. Static sites are live in about 2 minutes.


Static Astro

FeatureHow Temps handles it
Buildnpm run build
OutputServes dist/
HTTPSLet's Encrypt, auto-renewed
CacheHashed assets get long-lived cache headers

SSR with Node Adapter

For SSR, configure the Node adapter first:

npx astro add node
// astro.config.mjs
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';

export default defineConfig({
  output: 'server',
  adapter: node({ mode: 'standalone' }),
});

Temps detects the server output and starts it as a Node.js container on port 4321 (or PORT env var).


Content Collections

Content collections work identically on Temps — your MDX, Markdown, and JSON content is bundled at build time and served statically or via SSR as configured.


Environment Variables

npx @temps-sdk/cli environments vars set PUBLIC_SITE_URL "https://yourdomain.com" -e production

Compression & caching

Static Astro output is served directly by the Temps proxy with these optimizations applied automatically.

The Temps proxy applies performance optimizations to all static file responses automatically:

  • Gzip compression for text-based files over 1 KB (HTML, CSS, JavaScript, JSON, XML, SVG) when the browser supports it.
  • ETags based on each file's content hash, so unchanged files return 304 Not Modified.

Cache-Control headers are set based on the file path:

PatternCache-ControlUse case
/assets/*, /static/*, /_next/static/*, .chunk.*, .hash.*public, max-age=31536000, immutableHashed assets that never change
Everything elsepublic, max-age=0, must-revalidateHTML files and non-hashed resources

Your hashed JS and CSS bundles are cached for a year, while index.html is always revalidated so new deployments are picked up immediately.


Next Steps

Was this page helpful?