Publii is a unique desktop-based static site CMS that generates fast, secure static HTML websites. Unlike web-based CMSs, Publii runs on your local computer as a desktop application and deploys static files to your VPS. This gives you the editing experience of a CMS with the performance and security of a static site.
Why Publii?
- Desktop app: Full-featured CMS running locally — no server-side software needed
- Static output: Generates pure HTML/CSS — no PHP, no database on the server
- WYSIWYG and Markdown: Choice of visual editor, Markdown editor, or block editor
- SEO built-in: Automatic meta tags, sitemaps, Open Graph, and schema.org markup
- Themes: Professional themes with customization options
Install Publii
# Download Publii for your desktop OS
# Linux (AppImage):
wget https://getpublii.com/download/Publii-linux.AppImage
chmod +x Publii-linux.AppImage
./Publii-linux.AppImage
# macOS: Download .dmg from getpublii.com
# Windows: Download .exe installer from getpublii.com
Configure VPS Deployment
In Publii, go to Server settings and configure SFTP deployment:
# Publii Server Settings:
# Protocol: SFTP
# Server: your-vps-ip-or-domain
# Port: 22
# Username: your-ssh-user
# Authentication: SSH Key (recommended) or Password
# Remote Path: /var/www/my-publii-site
# Prepare the VPS directory
sudo mkdir -p /var/www/my-publii-site
sudo chown www-data:www-data /var/www/my-publii-site
# Set up SSH key authentication
# On your desktop, copy your public key to the VPS:
ssh-copy-id your-user@your-vps-ip
Nginx Configuration for Static Site
server {
listen 443 ssl http2;
server_name yourdomain.com www.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
root /var/www/my-publii-site;
index index.html;
# Custom 404 page (generated by Publii)
error_page 404 /404.html;
location / {
try_files $uri $uri/ $uri.html =404;
}
# Cache static assets
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Gzip compression
gzip on;
gzip_types text/html text/css application/javascript application/json image/svg+xml;
gzip_min_length 1000;
}
Theme Customization
# Publii themes are stored in:
# ~/Documents/Publii/themes/ (or equivalent on your OS)
# To customize a theme, override files:
# 1. Go to Theme settings in Publii
# 2. Use Custom CSS for style changes:
.hero-section {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 6rem 2rem;
}
.post-card {
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
transition: transform 0.2s;
}
.post-card:hover {
transform: translateY(-4px);
}
# 3. Use Custom HTML for header/footer injections
# 4. For deeper changes, create a child theme
Workflow and Deployment
# Typical Publii workflow:
# 1. Write and edit content in the desktop app
# 2. Preview locally (built-in preview server)
# 3. Click "Sync your website" to deploy
# For automated workflows, use the CLI:
# Publii also supports deployment to:
# - SFTP (your VPS)
# - Amazon S3
# - GitHub Pages
# - Netlify
# - Google Cloud Storage
# Backup your Publii site data
# Desktop data location:
# Linux: ~/.local/share/Publii/
# macOS: ~/Library/Application Support/Publii/
# Windows: %APPDATA%/Publii/
# Create a backup script
tar czf publii-backup-$(date +%Y%m%d).tar.gz \
~/.local/share/Publii/sites/
Performance Optimization
# Since Publii generates static HTML, your site is already fast.
# Additional optimizations:
# 1. Enable Brotli compression (if available)
brotli on;
brotli_types text/html text/css application/javascript;
# 2. Add a CDN (Cloudflare)
# Point your domain through Cloudflare for global caching
# 3. Optimize images in Publii settings
# - Enable responsive images
# - Set maximum image width
# - Enable lazy loading
# 4. Preload critical resources
# In Publii Custom HTML (head):
<link rel="preload" href="/css/style.css" as="style">
<link rel="preload" href="/fonts/main.woff2" as="font" type="font/woff2" crossorigin>
Best Practices
- Back up your Publii data directory regularly — it contains all your content and settings
- Use SSH keys for SFTP deployment instead of passwords
- Enable responsive images in Publii settings for automatic srcset generation
- Add a CDN like Cloudflare for global edge caching of your static site
- Use Publii's built-in SEO tools to set meta descriptions and Open Graph tags per page
- Test with Lighthouse — static Publii sites typically score 95-100