Back to blog
Blog

BookStack Wiki On a VPS With Nginx and HTTPS

Self-host BookStack on a VPS with Docker Compose, Nginx + Let’s Encrypt, backups, and safe updates for your internal wiki.

By Anurag Singh
Updated on Nov 22, 2026
Category: Blog
Share article
BookStack Wiki On a VPS With Nginx and HTTPS

Most internal wikis fail for two reasons. They’re painful to maintain, or they live inside a hosted product you can’t control. self-host BookStack sits in the middle.

You get a clean documentation UI that non-technical staff will actually use. You also keep control on a VPS or dedicated server: storage, DNS, SSL, and backups.

This is an open-source spotlight, not a “copy/paste and you’re done” tutorial. It explains where BookStack shines, what it can replace, and how to run it on real infrastructure.

The stack here is practical: Docker Compose, Nginx, HTTPS, database backups, and repeatable updates.

Why self-host BookStack for internal documentation

BookStack is an open-source documentation platform built around a simple hierarchy: Books → Chapters → Pages. The structure looks basic. In practice, it maps well to real internal content.

Think runbooks, onboarding docs, customer support playbooks, and SOPs.

  • Editing feels familiar: you can use the WYSIWYG editor, and Markdown is supported if that fits your workflow.
  • Permissions are straightforward: roles plus per-content permissions cover the common “everyone can read, a few can edit” model.
  • Search is fast: if search is slow or unreliable, the wiki won’t get used. BookStack’s built-in search holds up for most teams without extra services.
  • It runs well on modest servers: a small VPS can support a surprisingly large doc set for a small-to-mid business.

The operational win is that BookStack isn’t a sprawling “platform.” On infrastructure you control, it’s a web app plus a database.

That makes backups, migrations, and upgrades more predictable.

If you want this on infrastructure you can size and monitor properly, start with a HostMyCode VPS.

If you’d rather not handle OS updates, reverse proxy maintenance, and backup plumbing, managed VPS hosting is the calmer route.

What BookStack replaces (and where it fits vs Confluence/Notion)

BookStack often replaces hosted knowledge bases and wiki tools like Confluence Cloud, Notion, and other proprietary “workspace” suites. The main difference is rarely a feature checklist.

It’s more about control, cost, and what happens after the rollout buzz fades.

  • BookStack vs Confluence: Confluence brings enterprise integrations and a huge plugin ecosystem. BookStack stays lighter, quicker to roll out, and easier to keep stable. If you don’t need an extension marketplace, BookStack is often the better fit.
  • BookStack vs Notion: Notion is flexible, but that flexibility can turn into wildly inconsistent docs across teams. BookStack’s book/chapter/page model nudges people toward a consistent structure. That makes your wiki easier to browse six months later.
  • Self-hosted vs hosted: self-hosting means you control retention and access patterns. It also means you own uptime, backups, and patching. A VPS makes that manageable because you can standardize the stack (Docker + Nginx + Let’s Encrypt) and keep it boring.

BookStack ships under the MIT License, which keeps commercial use and internal deployments uncomplicated.

Run it on a private network, publish it publicly for product docs, or do both. Either way, you decide where it lives.

Planning your VPS: resources, storage, and DNS

BookStack runs on small servers. Still, basic sizing up front prevents the “why is it slow?” thread later.

  • Small team (5–30 users): 1 vCPU, 2 GB RAM is workable; 2 vCPU, 4 GB RAM feels comfortable.
  • Growing team (30–200 users): 2–4 vCPU and 4–8 GB RAM, especially if you store lots of images/attachments.
  • Storage: prioritize NVMe. Docs are read-heavy, but attachments and thumbnails add up quickly. Plan for snapshots + offsite backups.

DNS is straightforward. Pick a hostname like wiki.example.com. Create an A record pointing to your server’s public IP.

If you host other apps on the same VPS, give each app its own subdomain. That keeps your reverse proxy rules readable.

Don’t skip disk monitoring. Wikis grow quietly until they don’t.

If the disk fills, database writes fail. You’ll usually find out at the worst time. If you need a refresher on cleanup under pressure, this guide helps: Disk full on VPS: find large files and free space safely.

Deploying BookStack with Docker Compose (a maintainable layout)

For most teams, Docker Compose is the sweet spot. Upgrades stay repeatable, and rollbacks remain possible.

It also separates app config from OS config. The goal isn’t cleverness. It’s consistency.

A practical layout on Ubuntu or Debian looks like this:

  • /opt/bookstack/compose.yml (or docker-compose.yml)
  • /opt/bookstack/.env for secrets and app settings
  • /opt/bookstack/data/ for persistent volumes
  • /var/log/nginx/ for proxy logs (outside containers)

BookStack is happy behind a reverse proxy. In most Compose deployments, you’ll run two containers:

  • BookStack (PHP/Laravel app + web server)
  • Database (commonly MariaDB)

Use named volumes or bind mounts for persistent data:

  • Database data directory
  • BookStack uploads/storage directory (attachments, images)

Two guardrails prevent a lot of avoidable pain:

  • Pin image tags instead of latest. Updates should be intentional, not accidental.
  • Keep secrets out of Git. Put DB passwords and app keys in .env and lock down permissions.

If you already run multiple Compose stacks, controlled auto-updates can be tempting. It can work, but treat it like production change management.

Read changelogs and watch the first upgrade closely. If you want a baseline to adapt, start here: Docker Compose auto-updates with Watchtower.

Reverse proxy with HTTPS: Nginx + Let’s Encrypt (production baseline)

You can publish BookStack straight from a container port. That approach falls apart once you need redirects, headers, or clean TLS handling.

Put Nginx on the host as the front door. Terminate HTTPS there. Then proxy to BookStack on a private Docker network or a localhost-published port.

At a minimum, your Nginx site should handle:

  • HTTP → HTTPS redirect (port 80 to 443)
  • TLS certificates via Let’s Encrypt (Certbot on Nginx is the common choice)
  • Proxy headers so BookStack sees the correct scheme and client IP
  • Upload limits that match your attachment policy (e.g., 25–100 MB)

Concrete settings you’ll likely touch in /etc/nginx/sites-available/wiki.example.com:

  • client_max_body_size 50m; to stop larger PDF uploads from failing
  • proxy_set_header X-Forwarded-Proto $scheme; so BookStack generates correct HTTPS URLs
  • proxy_set_header Host $host; to keep canonical hostnames stable

Let’s Encrypt can stay simple, or you can centralize TLS across multiple apps.

If you prefer a container-first approach, Traefik is a solid alternative. This guide walks through a clean Compose-based HTTPS setup: Traefik with Docker Compose for HTTPS on a VPS.

Authentication and access control: keep the wiki private (without making it painful)

Your internal wiki shouldn’t be indexed, scraped, or casually reachable from the public internet. It also has to stay usable day to day.

Common deployment patterns:

  • Public internet + SSO: expose wiki.example.com publicly, but enforce login and strong passwords. Many teams pair this with a corporate IdP if available.
  • Restricted by IP: Nginx allow/deny rules work if office IPs are stable. With remote teams, it gets messy fast.
  • VPN-only access: simple and secure. The wiki stays private, and your attack surface shrinks dramatically.

If you do expose the wiki to the internet, cover the basics first. Enforce strong passwords, use MFA where possible, and keep the host patched.

On an Nginx stack, Fail2ban remains one of the most practical controls for brute-force login noise and opportunistic scans: Set up Fail2ban for Nginx on Ubuntu VPS.

Backups that actually restore: database + uploads + config

Wikis feel like “just pages,” but recovery is always two-part. Treat BookStack like the app it is:

  • Database: page content, users, permissions, settings
  • Uploads: images, attachments, and stored files

On a VPS, the most dependable plan is simple and repeatable:

  • Nightly logical database dumps (for MariaDB/MySQL: mariadb-dump or mysqldump)
  • File-level backup of the uploads volume
  • Offsite copy (object storage or another server), plus retention (e.g., 7 daily, 4 weekly, 6 monthly)

Run backups from the host (not inside the application container). This keeps credentials tighter. It also makes logs easier to centralize.

If you’re using MariaDB, follow the same tested-restore discipline as any MySQL-family database: Set up automatic MySQL backups with tested restores.

A restore test that mirrors reality:

  1. Spin up a throwaway VM or a local Docker environment.
  2. Restore the database dump into an empty database.
  3. Restore the uploads directory to the expected path/volume.
  4. Bring the stack up and verify login, search, and at least one attachment download.

If you only do one thing this month, schedule a restore test. Backups don’t count until you’ve proven you can restore under time pressure.

Updates: how to keep BookStack current without breaking your wiki

Most BookStack updates are painless. Your process should still assume you’ll hit a breaking change eventually.

Database migrations are the usual source of surprises.

A safe, repeatable update routine for a Compose-based deployment:

  • Read release notes for both BookStack and the database image.
  • Take a backup right before you change anything (database + uploads).
  • Pull new images using your pinned tags, then increment tags intentionally.
  • Restart the stack and watch logs for migrations or permission errors.
  • Smoke test: login, create a page, upload a file, search, and confirm email notifications if enabled.

Two issues show up again and again in day-to-day ops:

  • File permissions drift on bind mounts after manual edits or restores. Fix it early, before uploads start failing.
  • Disk headroom disappears during updates because old images and logs pile up. Prune images carefully and keep an eye on /var/lib/docker.

Email delivery (optional): notifications that land in inboxes

If you want password resets and notifications, you’ll be configuring SMTP. Treat email as infrastructure, not a checkbox.

Email failures behave differently than app failures. They also tend to show up at inconvenient times.

Keep it basic:

  • Use a trusted SMTP provider or your own mail server.
  • Store SMTP credentials in environment variables (not in a tracked config file).
  • Test deliverability to multiple providers (Gmail, Microsoft, a corporate domain).

If you’re building a full mail stack and want control over DKIM/SPF/DMARC, self-hosting can be reasonable. For that setup, a dedicated VPS is usually the right call for reputation and isolation.

Operational checklist: what to watch after you go live

After launch, the work shifts from “deploy it” to “keep it boring.” A few routine checks prevent most surprises.

  • TLS renewal: confirm Certbot renewals and monitor for expiry.
  • Database growth: track database size and check slow queries if search feels laggy.
  • Attachment growth: watch the uploads volume and set a policy for large videos or binaries.
  • Access logs: look for brute-force patterns, odd user agents, and repeated 404s.
  • Backups: confirm jobs ran, confirm offsite copies exist, and run restore tests.

If you already monitor your server fleet, add BookStack to the same dashboard. The best monitoring is the one you actually look at daily.

If you’re building that now, this is a good starting point: Grafana on a VPS.

When a VPS is enough—and when you should move to dedicated

BookStack itself isn’t resource-hungry. Infrastructure upgrades usually come from scale, storage, or organizational requirements.

It’s rarely the app alone.

  • VPS is enough if the wiki is internal, you have a few hundred users, and uploads stay reasonable.
  • Consider a dedicated server if you’re consolidating many internal tools on one host, need more I/O headroom, or want stricter isolation for compliance.

HostMyCode covers both ends of that range, from a right-sized VPS to dedicated servers for higher-capacity internal platforms.

Summary: BookStack is “boring” in the best way

BookStack works best as a wiki people actually use. You get structure without the overhead of an enterprise suite.

If you host it yourself, you control where the data lives, how you back it up, and when upgrades happen.

If you want a stable home for internal tools like BookStack, pick hosting that matches how you run systems. A HostMyCode VPS gives you predictable performance and costs. managed VPS hosting offloads the routine work that tends to get ignored until it hurts.

If you’re rolling out an internal documentation wiki, choose a VPS with enough RAM for database cache and enough NVMe storage for attachments. HostMyCode VPS plans fit BookStack well, and managed VPS hosting is a good match if you want help with OS patching, backups, and keeping Nginx/SSL in shape.

FAQ: self-host BookStack on a VPS

Do I need Docker to self-host BookStack?

No, but Docker Compose makes upgrades and rollbacks more predictable. It also keeps the host cleaner by isolating PHP dependencies inside containers.

What should I back up for a BookStack server?

Back up both the database (pages, users, permissions) and the uploads/attachments directory. Store copies offsite and run periodic restore tests.

Can I run BookStack behind Nginx with Let’s Encrypt?

Yes. Nginx is a common front-end for BookStack, and Let’s Encrypt works well for automatic TLS. Make sure proxy headers are set so BookStack generates HTTPS links correctly.

Is BookStack suitable for public documentation?

It can be. Many teams use it publicly, but you’ll want tighter security headers, a clear permissions model, and a firm backup strategy before exposing it.