Video tutorial coming soon.
Deploy BookStack on Ubuntu with Docker — a self-hosted wiki organized into books, chapters, and pages with a WYSIWYG editor, Markdown support, and LDAP/SSO integration.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/tools/bookstack/bookstack-ubuntu.sh
chmod +x bookstack-ubuntu.sh
sudo bash bookstack-ubuntu.sh
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/tools/bookstack/bookstack-ubuntu.sh
chmod +x bookstack-ubuntu.sh
Script deploys BookStack with MariaDB via Docker Compose. A default admin account is created automatically.
sudo bash bookstack-ubuntu.sh
Open your browser and navigate to your server IP. Default login: admin@admin.com / password — change both the email and password immediately after first login.
http://<your-server-ip>
Click 'New Book' to create your first book, then organize content into chapters and individual pages within each chapter.
| Port | Purpose |
|---|---|
| 80 | HTTP Web UI |
| 443 | HTTPS Web UI |
BookStack is a mature, open-source self-hosted wiki platform built around a clear three-level hierarchy: Books contain Chapters, and Chapters contain Pages. This structured approach makes BookStack excellent for reference documentation, IT runbooks, company handbooks, and any knowledge base where hierarchical organization helps readers navigate. It includes a dual WYSIWYG/Markdown editor, full-text search, image management, diagrams (draw.io integration), code syntax highlighting, and robust user/role management. BookStack has been actively developed since 2015 and has one of the largest self-hosted wiki communities.
Most teams accumulate documentation in random Confluence spaces, Google Docs folders, and wiki pages with no consistent structure. BookStack's Books → Chapters → Pages model enforces just enough structure to keep things findable without the overwhelming complexity of Confluence's space management. The interface is clean and approachable for non-technical team members, the search is fast and accurate, and the built-in LDAP integration means you can tie user accounts to your existing Active Directory without configuring OAuth.
BookStack listens on port 80 internally, proxied to 80/443 by your reverse proxy. MariaDB uses port 3306 — this must remain internal to the Docker network. Only expose ports 80 and 443 publicly via Nginx or Traefik with a valid SSL certificate. The APP_URL in .env must match your public URL exactly for links and redirects to work correctly.
Outline Wiki is more modern with a Notion-like block editor and Slack integration, but requires SSO. Docmost is newer with similar features to BookStack but without the mature community. Confluence is the enterprise standard with more integrations but significant cost. DokuWiki is even simpler and file-based (no database). MediaWiki (Wikipedia's software) is powerful but complex to administer. BookStack's combination of structure, built-in auth, and LDAP support makes it the most practical self-hosted wiki for teams without existing SSO infrastructure.
Skip BookStack if your team wants a Notion-like freeform block editor — BookStack's WYSIWYG is more traditional and less flexible. If you need real-time collaborative editing (multiple people editing the same page simultaneously), BookStack does not support this natively — use Docmost or Outline instead. For public-facing developer documentation with versioning and code-focused features, dedicated tools like GitBook, Docusaurus, or MkDocs are better choices.
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
A Book is the top-level container — think of it as a manual, a project wiki, or a team handbook. A Book contains Chapters, which group related pages together (like sections in a manual). Each Chapter contains Pages, which are the actual content documents. You can also add Pages directly to a Book without a Chapter. Optionally, Shelves group multiple Books — useful for organizing by department or domain. This hierarchy enforces just enough structure to keep large documentation sets navigable.
Yes — BookStack has built-in LDAP support. Configure it in .env with LDAP_SERVER, LDAP_BASE_DN, LDAP_USER_FILTER, and related variables. Users authenticate with their LDAP username and password — BookStack validates the credentials against your LDAP server. You can also map LDAP groups to BookStack roles automatically. This makes BookStack the easiest self-hosted wiki to integrate with on-premise Active Directory environments without needing a full OAuth/SAML setup.
BookStack has a permission system at multiple levels: global roles (Admin, Editor, Viewer) and per-entity overrides (Book, Chapter, or Page level). To restrict a book to a specific team: create a Role for that team (Settings → Roles), set the book's permissions to override global settings, and grant read/write access only to that role. Users with no access to a book cannot see it in search results or the shelf view — it is effectively hidden from them.
Yes — the page editor has two modes: WYSIWYG (rich text with toolbar) and Markdown (raw text with live preview). You switch between modes per-page. Both modes produce the same underlying content — WYSIWYG writes Markdown behind the scenes. Code blocks support syntax highlighting for 100+ languages. You can paste Markdown content directly and it renders correctly. BookStack also supports CommonMark spec Markdown in API responses.
Yes — BookStack has a REST API for reading and writing books, chapters, pages, and shelves. Generate an API token in My Account → API Tokens. Use the token in the Authorization header: `Authorization: Token YOUR_TOKEN_ID:YOUR_TOKEN_SECRET`. The API accepts Markdown or HTML content for pages. This enables automating documentation generation from scripts, syncing with other tools, or building custom integrations.
Export your Confluence space as HTML (Space → Export → HTML ZIP). Use the BookStack Confluence importer (Settings → Import → Confluence) or a community script to convert the HTML to BookStack's API format. Confluence macros (JIRA links, status badges, etc.) will not transfer cleanly and need manual cleanup. A practical approach for small teams: export the most important pages as PDF, recreate the structure in BookStack, and copy-paste content page by page, using the HTML export as a reference.
You need to backup two things: the database and the files. Database: `docker exec bookstack_db mysqldump -u bookstack -p bookstack > bookstack_$(date +%Y%m%d).sql`. Files: backup the Docker volume that maps to `/var/www/html/storage` inside the container — this contains uploaded images, attachments, and draw.io diagrams. Also backup your `.env` file — the APP_KEY is used to encrypt data and must match when restoring.
Run `docker compose pull && docker compose up -d` in your BookStack directory. BookStack runs database migrations automatically on startup when a new version is deployed. Always backup the database before updating. After updating, check the BookStack release notes for any breaking changes or manual steps required. BookStack follows a monthly release cycle and is generally backward compatible within major versions.