Website Deployment
Deploy static websites to IPFS — index.html auto-detected, custom domains, analytics, and version history.
Storage vs Deployments
Any file can be pinned (storage). A deployment is a pinned folder containing index.html. Glashaus auto-detects this and marks it eligible for deployment features.
Storage
Any file or directory. Accessible via gateway URL. No index.html required.
Deployment
Folder with index.html. Gets subdomain URL, analytics, custom domains, Showcase listing.
How to Deploy a Website
Four simple steps from code to live website:
Build
Run your static site builder (npm run build, vite build, hugo, etc.) to generate optimised output.
Upload
Upload the output directory via MCP tool upload_files or CLI glsh deploy ./out.
Configure
Set entry point, SPA mode, 404 page, display name via setup_and_deploy_website (interactive) or deploy_as_website (headless).
Live
Site is immediately available at https://<cid>.glashaus.xyz/.
Example: Next.js static export
# Next.js static export
npm run build # outputs to ./out
glsh deploy ./out # upload + deploy in one commandSubdomain URLs
Each deployment gets a unique subdomain (<cid>.glashaus.xyz) instead of a path URL. This fixes useSearchParams() and other browser APIs that rely on the origin.
Unique origin per deployment
localStorage, cookies, and auth tokens are isolated per site.
No useSearchParams() issues
Required for Next.js static export and other frameworks.
Shareable URL
Permanent and content-addressed. Share the full subdomain URL.
Custom Domains
Point any domain at a deployment CID. DNS verification required. No re-verification when updating to a new CID — domains transfer automatically.
Add domain
Use MCP tool add_domain or Console setup_and_attach_domain.
Create DNS record
Add CNAME record pointing to glashaus.xyz (or TXT record for apex domains).
Verify
Glashaus API verifies ownership. Live within minutes after DNS propagates.
Analytics
Opt-in per deployment. When enabled, a lightweight JS beacon is injected into served HTML. Tracks page views, referrers, devices, session duration, and UTM campaigns.
Page views & bandwidth
Track visits and data transferred.
Top referrers
See which sites send you traffic.
Device breakdown
Mobile, tablet, desktop distribution.
Session duration
Average time users spend on site.
UTM campaigns
Track campaign and source parameters.
Entry pages
Most visited pages on your site.
View analytics at /deployment/{cid}/analytics. No cookies. No personal data stored.
API Secrets & Proxy
Static sites cannot safely hold API keys — any credential in the HTML/JS bundle is publicly readable. Glashaus stores credentials encrypted (AES-256-GCM) server-side and injects them into proxy calls.
Your static site calls the proxy, never the real API:
// Your static site calls the proxy — never the real API
const res = await fetch(proxyUrl + '/v2/checkout/orders', {
method: 'POST',
body: JSON.stringify(order)
})Full setup guide and all supported injection methods in the API documentation.