Docs / Deployment / Self-Hosted

Self-Hosted

Deploy your Dustavez site to your own server using Nginx or Apache.

Since Dustavez builds to static HTML, you can host it on any web server. This guide covers Nginx and Apache configuration.

Build your site

Terminal window
npm run build

This generates a dist/ directory containing your complete static site. Upload its contents to your server’s web root.

Nginx

nginx.conf
server {
listen 80;
server_name docs.example.com;
root /var/www/dustavez;
index index.html;
# Clean URLs — serve /path/index.html for /path
location / {
try_files $uri $uri/ $uri/index.html =404;
}
# Cache static assets
location ~* \.(css|js|jpg|jpeg|png|gif|svg|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Gzip compression
gzip on;
gzip_types text/html text/css application/javascript application/json image/svg+xml;
}

Apache

.htaccess
RewriteEngine On
# Clean URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1/index.html [L]
# Cache static assets
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
</IfModule>
# Gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>

Docker

You can also serve with a simple Docker container:

Dockerfile
FROM nginx:alpine
COPY dist/ /usr/share/nginx/html/
Terminal window
docker build -t dustavez-docs .
docker run -p 8080:80 dustavez-docs
HTTPS

Use Let’s Encrypt with Certbot to add free HTTPS to your self-hosted deployment: sudo certbot --nginx -d docs.example.com

Last updated: April 4, 2026
Edit this page on GitHub