Wiki.js with PostgreSQL
Powerful and extensible open source wiki with modern interface.
Overview
Wiki.js is a modern, lightweight, and powerful wiki engine built on Node.js that provides a clean, intuitive interface for creating and managing documentation. Originally created by Nicolas Giard, Wiki.js has become one of the most popular self-hosted wiki solutions, offering features like real-time collaboration, Git synchronization, advanced search capabilities, and support for multiple authentication providers. Unlike traditional wikis with dated interfaces, Wiki.js provides a contemporary editing experience with support for Markdown, visual editing, and extensible functionality through modules.
This deployment combines Wiki.js with PostgreSQL as the database backend, creating a robust two-service architecture. The wikijs container runs the main application on port 3000, while the dedicated db container provides PostgreSQL 15 Alpine for data persistence. The services communicate over a private Docker network, with Wiki.js configured to connect to PostgreSQL using environment variables for database credentials and connection details. Both containers use persistent volumes to ensure data survives container restarts and updates.
This configuration is ideal for organizations and individuals who need a reliable, feature-rich wiki solution with enterprise-grade database capabilities. PostgreSQL's advanced features like full-text search, JSON support, and ACID compliance make it an excellent choice for Wiki.js deployments that expect growth, complex content structures, or integration with existing PostgreSQL infrastructure. The combination provides excellent performance, data integrity, and scalability compared to lighter database options.
Key Features
- Modern visual editor with live preview alongside traditional Markdown support
- Git synchronization for version control and backup of wiki content
- Advanced full-text search powered by PostgreSQL's search capabilities
- Multiple authentication providers including LDAP, OAuth, and SAML
- Page hierarchy and navigation with automatic breadcrumbs and tree structure
- Real-time collaborative editing with conflict resolution
- Asset management for images, documents, and media files
- Extensible module system for custom functionality and integrations
Common Use Cases
- 1Corporate knowledge bases and internal documentation for growing teams
- 2Technical documentation for software projects with Git workflow integration
- 3Educational institutions managing course materials and collaborative research
- 4Open source projects requiring professional documentation sites
- 5IT departments creating runbooks, procedures, and system documentation
- 6Startups building internal wikis that need to scale with company growth
- 7Personal knowledge management for researchers and content creators
Prerequisites
- Docker and Docker Compose installed on the host system
- Minimum 1GB RAM available (512MB for Wiki.js, 512MB for PostgreSQL)
- Port 3000 available for Wiki.js web interface access
- Environment variable DB_PASSWORD configured for database authentication
- Basic understanding of wiki markup and Markdown syntax
- Approximately 2GB disk space for initial installation and content growth
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 wikijs: 3 image: ghcr.io/requarks/wiki:24 container_name: wikijs5 environment: 6 - DB_TYPE=postgres7 - DB_HOST=db8 - DB_PORT=54329 - DB_USER=wiki10 - DB_PASS=${DB_PASSWORD}11 - DB_NAME=wiki12 volumes: 13 - wikijs-data:/wiki/data14 ports: 15 - "3000:3000"16 depends_on: 17 - db18 networks: 19 - wikijs-network20 restart: unless-stopped2122 db: 23 image: postgres:15-alpine24 container_name: wikijs-db25 environment: 26 - POSTGRES_USER=wiki27 - POSTGRES_PASSWORD=${DB_PASSWORD}28 - POSTGRES_DB=wiki29 volumes: 30 - postgres-data:/var/lib/postgresql/data31 networks: 32 - wikijs-network33 restart: unless-stopped3435volumes: 36 wikijs-data: 37 postgres-data: 3839networks: 40 wikijs-network: 41 driver: bridge.env Template
.env
1# Wiki.js2DB_PASSWORD=secure_wiki_passwordUsage Notes
- 1Web UI at http://localhost:3000
- 2Complete setup wizard on first visit
- 3Supports Markdown, HTML, visual editor
- 4Git sync, search, and analytics
- 5Multiple auth providers supported
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
wikijs
wikijs:
image: ghcr.io/requarks/wiki:2
container_name: wikijs
environment:
- DB_TYPE=postgres
- DB_HOST=db
- DB_PORT=5432
- DB_USER=wiki
- DB_PASS=${DB_PASSWORD}
- DB_NAME=wiki
volumes:
- wikijs-data:/wiki/data
ports:
- "3000:3000"
depends_on:
- db
networks:
- wikijs-network
restart: unless-stopped
db
db:
image: postgres:15-alpine
container_name: wikijs-db
environment:
- POSTGRES_USER=wiki
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=wiki
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- wikijs-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 wikijs:5 image: ghcr.io/requarks/wiki:26 container_name: wikijs7 environment:8 - DB_TYPE=postgres9 - DB_HOST=db10 - DB_PORT=543211 - DB_USER=wiki12 - DB_PASS=${DB_PASSWORD}13 - DB_NAME=wiki14 volumes:15 - wikijs-data:/wiki/data16 ports:17 - "3000:3000"18 depends_on:19 - db20 networks:21 - wikijs-network22 restart: unless-stopped2324 db:25 image: postgres:15-alpine26 container_name: wikijs-db27 environment:28 - POSTGRES_USER=wiki29 - POSTGRES_PASSWORD=${DB_PASSWORD}30 - POSTGRES_DB=wiki31 volumes:32 - postgres-data:/var/lib/postgresql/data33 networks:34 - wikijs-network35 restart: unless-stopped3637volumes:38 wikijs-data:39 postgres-data:4041networks:42 wikijs-network:43 driver: bridge44EOF4546# 2. Create the .env file47cat > .env << 'EOF'48# Wiki.js49DB_PASSWORD=secure_wiki_password50EOF5152# 3. Start the services53docker compose up -d5455# 4. View logs56docker 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/wikijs-complete/run | bashTroubleshooting
- Wiki.js shows database connection error: Verify DB_PASSWORD environment variable matches between wikijs and db services
- Setup wizard not accessible at localhost:3000: Check that port 3000 is not blocked by firewall or used by another service
- PostgreSQL container fails to start with data directory error: Ensure postgres-data volume has proper permissions or remove volume to reset
- Wiki.js container restarts continuously: Check logs with 'docker logs wikijs' and verify all required environment variables are set
- Git sync fails during Wiki.js operation: Ensure Wiki.js container has network access and valid Git credentials configured in admin panel
- Search functionality not working properly: Restart wikijs container to rebuild search indices after PostgreSQL connection issues
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
wikijspostgresql
Tags
#wiki#documentation#wikijs#knowledge-base#markdown
Category
Productivity & CollaborationAd Space
Shortcuts: C CopyF FavoriteD Download