/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
Guides Deployment Self-Hosted

Self-Hosted

Deploy Syntext documentation to your own infrastructure

3 min read

While Syntext provides managed hosting with global CDN and SSL, you can also deploy the generated static files to your own infrastructure.

Info

Self-hosted deployment is available on Enterprise plans. Contact us to learn more.

Build for Self-Hosting

Generate the static site with the CLI. The build runs on Syntext and the finished files are downloaded to your machine:

bash
stx build --output ./dist --token "$SYNTEXT_API_KEY"

--token takes a project API key; on your own machine, stx login works instead. This creates a dist/ folder containing:

text
dist/
├── index.html
├── getting-started.html # one .html per page
├── guides/
│ └── *.html
├── api-reference/
│ └── *.html
├── ask.html # full-page AI chat route
├── 404.html
├── _assets/
│ └── search-index.json # static search index
├── sitemap.xml
├── robots.txt
└── (your public/ assets)

Pages are flat .html files — configure your host to resolve extensionless URLs (see the Nginx example below).

Hosting Options

Static Site Hosting

Deploy to any static file host:

AWS S3 + CloudFront

bash
# Sync to S3
aws s3 sync ./dist s3://your-docs-bucket --delete
# Invalidate CloudFront cache
aws cloudfront create-invalidation --distribution-id EXXX --paths "/*"

Cloudflare Pages

bash
# Using Wrangler
wrangler pages deploy ./dist --project-name=your-docs

Nginx

nginx
server {
listen 80;
server_name docs.yourcompany.com;
root /var/www/docs;
location / {
try_files $uri $uri/ $uri.html =404;
}
}

Docker

Build a containerized version:

dockerfile
FROM nginx:alpine
COPY ./dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
bash
docker build -t my-docs .
docker run -p 8080:80 my-docs

Self-Hosted Features

Every stx build includes a static search index:

1.
The build generates _assets/search-index.json automatically
2.
The client-side search library uses this index directly — no API calls needed
Warning

Client-side search works well for small-to-medium sites (< 500 pages). For larger sites, consider a dedicated search service.

AI Assistant

A self-hosted export has no built-in AI assistant, and the ai key in syntext.json has no effect. To give readers an assistant on pages you host, embed the chat widget.

Analytics

Self-hosted deployments don't include Syntext analytics by default. Options:

•
Custom code — add a tracking snippet (Plausible, PostHog and so on) as a pasted head snippet under Integrations › Custom code › Override (advanced) in the dashboard (Starter plan and up). Snippets are injected into every page at build time, so they're in the files stx build downloads. See also Custom code from your docs.
•
Post-process — add the snippet to the exported HTML in your own pipeline.

scripts in syntext.json is not applied by builds.

Continuous Deployment

GitHub Actions (Self-Hosted)

yaml
name: Deploy Docs
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install CLI
run: curl -fsSL https://get.syntext.dev | sh
- name: Build
run: stx build --output ./dist --token "$SYNTEXT_API_KEY"
env:
SYNTEXT_API_KEY: ${{ secrets.SYNTEXT_API_KEY }}
- name: Deploy to S3
run: aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }} --delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Limitations

Self-hosted deployments don't include:

FeatureSelf-HostedManaged
Global CDN❌✅
Automatic SSL❌✅
Preview deployments❌✅
Built-in analytics❌✅
AI assistant (default)❌✅
AI-powered search❌ (static search index only)✅

You can replicate these features with your own infrastructure, but it requires additional setup.

•
Custom Domains — Use your own domain with managed hosting
•
GitHub Actions — CI/CD with managed deployment
•
Configuration — Full configuration reference
Was this page helpful? Yes No
Product
Resources
Company
© 2026 SyntextBuilt with Syntext