Wiki.js Knowledge Base
Modern wiki platform with Wiki.js, Git sync, and full-text search.
Overview
Wiki.js is a modern, lightweight wiki engine built on Node.js that revolutionizes knowledge management with its Git-native approach to content versioning and sleek, responsive interface. Originally created by Nicolas Giard in 2017, Wiki.js addresses the limitations of traditional wiki platforms by offering native Markdown support, extensive authentication integrations, and powerful search capabilities while maintaining simplicity for content creators. This production stack combines Wiki.js with PostgreSQL for robust relational data storage and Elasticsearch for enterprise-grade full-text search functionality. PostgreSQL serves as the primary database, storing user accounts, page metadata, and configuration data with ACID compliance, while Elasticsearch indexes all wiki content to provide lightning-fast search results with relevance scoring and advanced query capabilities. The synergy between these components creates a knowledge base platform that scales from small team documentation to enterprise-wide knowledge repositories. This configuration is ideal for organizations that need professional documentation management with Git workflow integration, teams requiring advanced search across large content volumes, and businesses wanting to migrate from legacy wiki platforms while maintaining data integrity and search performance.
Key Features
- Native Git synchronization for content versioning and backup with support for GitHub, GitLab, and Bitbucket repositories
- Advanced full-text search powered by Elasticsearch with relevance scoring, faceted search, and content highlighting
- WYSIWYG and Markdown editors with real-time preview and collaborative editing capabilities
- PostgreSQL JSONB storage for flexible page metadata and custom field management
- Multi-authentication support including LDAP, SAML, OAuth2, and local authentication with role-based access control
- Elasticsearch aggregations for content analytics including page views, search trends, and user activity metrics
- Automated page tree management with PostgreSQL hierarchical queries for complex documentation structures
- Real-time content indexing with Elasticsearch bulk operations for immediate search availability
Common Use Cases
- 1Software development teams needing technical documentation with Git workflow integration and code snippet management
- 2Enterprise organizations migrating from Confluence or SharePoint while maintaining advanced search capabilities
- 3Educational institutions creating searchable knowledge bases for course materials and research documentation
- 4Customer support teams building comprehensive help centers with fast content retrieval and user feedback tracking
- 5Open source projects requiring collaborative documentation with public access and contributor management
- 6IT departments creating internal runbooks and procedures with role-based access and audit trails
- 7Consulting firms managing client documentation with project-based access control and content versioning
Prerequisites
- Minimum 4GB RAM available (2GB for Elasticsearch, 1GB for PostgreSQL, 1GB for Wiki.js and system overhead)
- Docker and Docker Compose installed with support for named volumes and custom networks
- Port 3000 available for Wiki.js web interface access
- Basic understanding of PostgreSQL administration for backup and maintenance procedures
- Git repository access if planning to use Git synchronization features for content versioning
- SSL certificate and reverse proxy knowledge for production HTTPS deployment
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 postgres: 3 image: postgres:15-alpine4 environment: 5 - POSTGRES_USER=wiki6 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}7 - POSTGRES_DB=wiki8 volumes: 9 - postgres_data:/var/lib/postgresql/data10 networks: 11 - wiki_net1213 elasticsearch: 14 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1515 environment: 16 - discovery.type=single-node17 - xpack.security.enabled=false18 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"19 volumes: 20 - es_data:/usr/share/elasticsearch/data21 networks: 22 - wiki_net2324 wiki: 25 image: ghcr.io/requarks/wiki:226 ports: 27 - "3000:3000"28 environment: 29 - DB_TYPE=postgres30 - DB_HOST=postgres31 - DB_PORT=543232 - DB_USER=wiki33 - DB_PASS=${POSTGRES_PASSWORD}34 - DB_NAME=wiki35 depends_on: 36 - postgres37 - elasticsearch38 networks: 39 - wiki_net4041volumes: 42 postgres_data: 43 es_data: 4445networks: 46 wiki_net: .env Template
.env
1# Wiki.js2POSTGRES_PASSWORD=secure_postgres_password34# Wiki.js at http://localhost:30005# Complete setup wizard on first accessUsage Notes
- 1Wiki.js at http://localhost:3000
- 2Complete setup wizard first
- 3Git storage for version control
- 4Elasticsearch for full-text search
- 5Multiple auth providers
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
postgres
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_USER=wiki
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=wiki
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- wiki_net
elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.15
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- wiki_net
wiki
wiki:
image: ghcr.io/requarks/wiki:2
ports:
- "3000:3000"
environment:
- DB_TYPE=postgres
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=wiki
- DB_PASS=${POSTGRES_PASSWORD}
- DB_NAME=wiki
depends_on:
- postgres
- elasticsearch
networks:
- wiki_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 postgres:5 image: postgres:15-alpine6 environment:7 - POSTGRES_USER=wiki8 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}9 - POSTGRES_DB=wiki10 volumes:11 - postgres_data:/var/lib/postgresql/data12 networks:13 - wiki_net1415 elasticsearch:16 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1517 environment:18 - discovery.type=single-node19 - xpack.security.enabled=false20 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"21 volumes:22 - es_data:/usr/share/elasticsearch/data23 networks:24 - wiki_net2526 wiki:27 image: ghcr.io/requarks/wiki:228 ports:29 - "3000:3000"30 environment:31 - DB_TYPE=postgres32 - DB_HOST=postgres33 - DB_PORT=543234 - DB_USER=wiki35 - DB_PASS=${POSTGRES_PASSWORD}36 - DB_NAME=wiki37 depends_on:38 - postgres39 - elasticsearch40 networks:41 - wiki_net4243volumes:44 postgres_data:45 es_data:4647networks:48 wiki_net:49EOF5051# 2. Create the .env file52cat > .env << 'EOF'53# Wiki.js54POSTGRES_PASSWORD=secure_postgres_password5556# Wiki.js at http://localhost:300057# Complete setup wizard on first access58EOF5960# 3. Start the services61docker compose up -d6263# 4. View logs64docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/wiki-js-complete/run | bashTroubleshooting
- Wiki.js shows 'Database connection failed': Verify POSTGRES_PASSWORD environment variable matches between postgres and wiki services, and ensure postgres container is fully started before wiki container attempts connection
- Elasticsearch container exits with 'max virtual memory areas vm.max_map_count too low': Run 'sysctl -w vm.max_map_count=262144' on Docker host and add 'vm.max_map_count=262144' to /etc/sysctl.conf for persistence
- Search functionality returns no results: Check Elasticsearch container logs for indexing errors and verify ES_JAVA_OPTS memory allocation doesn't exceed available container memory
- Wiki.js setup wizard shows database error: Ensure PostgreSQL container has completed initialization by checking logs for 'database system is ready to accept connections' message before accessing Wiki.js
- High memory usage from Elasticsearch: Reduce ES_JAVA_OPTS heap size from 512m to 256m for smaller deployments, but expect slower search performance with large content volumes
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
wikijspostgresqlelasticsearch
Tags
#wikijs#wiki#knowledge-base#documentation#markdown
Category
Productivity & CollaborationAd Space
Shortcuts: C CopyF FavoriteD Download