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
| Feature | How Temps handles it |
|---|---|
| Build | npm run build |
| Output | Serves dist/ |
| HTTPS | Let's Encrypt, auto-renewed |
| Cache | Hashed 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:
| Pattern | Cache-Control | Use case |
|---|---|---|
/assets/*, /static/*, /_next/static/*, .chunk.*, .hash.* | public, max-age=31536000, immutable | Hashed assets that never change |
| Everything else | public, max-age=0, must-revalidate | HTML 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.