docker.recipes

Wiki.js Knowledge Base

beginner

Wiki.js modern wiki platform with PostgreSQL.

Overview

Wiki.js is a modern, lightweight wiki engine built on Node.js that transforms how teams create, manage, and share documentation. Launched in 2017, it offers a sleek web interface with markdown support, real-time editing, and extensive customization options that make it ideal for technical documentation, knowledge bases, and collaborative content creation. Unlike traditional wikis, Wiki.js provides a Git-based storage system, multiple authentication providers, and a plugin architecture that adapts to diverse organizational needs. This stack combines Wiki.js with PostgreSQL to create a robust documentation platform where PostgreSQL's ACID compliance and advanced querying capabilities ensure data integrity for wiki content, user management, and search indexing. PostgreSQL's full-text search features enhance Wiki.js's built-in search functionality, while its JSON support efficiently stores the platform's metadata and configuration settings. The database's reliability ensures that documentation remains accessible and consistent, even under heavy concurrent editing loads. This combination is perfect for development teams needing reliable documentation workflows, IT departments building internal knowledge repositories, and organizations requiring professional wiki solutions with enterprise-grade data persistence. The PostgreSQL backend provides the scalability and performance needed for large content repositories while maintaining the flexibility that makes Wiki.js appealing for both small teams and large enterprises.

Key Features

  • Real-time collaborative editing with live preview and conflict resolution
  • Git synchronization for version control and backup of wiki content
  • Multiple authentication methods including LDAP, OAuth, and SAML integration
  • Advanced search capabilities powered by PostgreSQL's full-text indexing
  • Page templating system with custom layouts and reusable content blocks
  • Multi-language content support with automatic translation workflows
  • Comprehensive permission system with page-level access controls
  • Theme customization with CSS injection and logo branding options

Common Use Cases

  • 1Software development teams creating API documentation and technical guides
  • 2IT departments building internal knowledge bases for procedures and troubleshooting
  • 3Educational institutions developing course materials and student resources
  • 4Open source projects maintaining community documentation and contribution guides
  • 5Customer support teams creating searchable FAQ and help desk resources
  • 6Remote teams establishing centralized information hubs for company policies
  • 7DevOps teams documenting infrastructure, deployment processes, and runbooks

Prerequisites

  • Minimum 1GB RAM for optimal PostgreSQL and Wiki.js performance
  • Port 3000 available for Wiki.js web interface access
  • Basic understanding of markdown syntax for content creation
  • Git repository access if planning to use Git synchronization features
  • SMTP server details for email notifications and user registration
  • SSL certificate configuration knowledge for production deployments

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:16-alpine
4 container_name: wikijs-postgres
5 restart: unless-stopped
6 environment:
7 POSTGRES_USER: ${POSTGRES_USER:-wikijs}
8 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wikijs}
9 POSTGRES_DB: ${POSTGRES_DB:-wikijs}
10 volumes:
11 - postgres_data:/var/lib/postgresql/data
12 networks:
13 - wikijs-network
14
15 wikijs:
16 image: ghcr.io/requarks/wiki:2
17 container_name: wikijs
18 restart: unless-stopped
19 ports:
20 - "${WIKIJS_PORT:-3000}:3000"
21 environment:
22 - DB_TYPE=postgres
23 - DB_HOST=postgres
24 - DB_PORT=5432
25 - DB_USER=${POSTGRES_USER:-wikijs}
26 - DB_PASS=${POSTGRES_PASSWORD:-wikijs}
27 - DB_NAME=${POSTGRES_DB:-wikijs}
28 depends_on:
29 - postgres
30 networks:
31 - wikijs-network
32
33volumes:
34 postgres_data:
35
36networks:
37 wikijs-network:
38 driver: bridge

.env Template

.env
1# Wiki.js
2WIKIJS_PORT=3000
3POSTGRES_USER=wikijs
4POSTGRES_PASSWORD=wikijs
5POSTGRES_DB=wikijs

Usage Notes

  1. 1Wiki.js at http://localhost:3000
  2. 2Complete setup wizard
  3. 3Supports Git sync
  4. 4Multiple auth methods

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

postgres
postgres:
  image: postgres:16-alpine
  container_name: wikijs-postgres
  restart: unless-stopped
  environment:
    POSTGRES_USER: ${POSTGRES_USER:-wikijs}
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wikijs}
    POSTGRES_DB: ${POSTGRES_DB:-wikijs}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - wikijs-network
wikijs
wikijs:
  image: ghcr.io/requarks/wiki:2
  container_name: wikijs
  restart: unless-stopped
  ports:
    - ${WIKIJS_PORT:-3000}:3000
  environment:
    - DB_TYPE=postgres
    - DB_HOST=postgres
    - DB_PORT=5432
    - DB_USER=${POSTGRES_USER:-wikijs}
    - DB_PASS=${POSTGRES_PASSWORD:-wikijs}
    - DB_NAME=${POSTGRES_DB:-wikijs}
  depends_on:
    - postgres
  networks:
    - wikijs-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 postgres:
5 image: postgres:16-alpine
6 container_name: wikijs-postgres
7 restart: unless-stopped
8 environment:
9 POSTGRES_USER: ${POSTGRES_USER:-wikijs}
10 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wikijs}
11 POSTGRES_DB: ${POSTGRES_DB:-wikijs}
12 volumes:
13 - postgres_data:/var/lib/postgresql/data
14 networks:
15 - wikijs-network
16
17 wikijs:
18 image: ghcr.io/requarks/wiki:2
19 container_name: wikijs
20 restart: unless-stopped
21 ports:
22 - "${WIKIJS_PORT:-3000}:3000"
23 environment:
24 - DB_TYPE=postgres
25 - DB_HOST=postgres
26 - DB_PORT=5432
27 - DB_USER=${POSTGRES_USER:-wikijs}
28 - DB_PASS=${POSTGRES_PASSWORD:-wikijs}
29 - DB_NAME=${POSTGRES_DB:-wikijs}
30 depends_on:
31 - postgres
32 networks:
33 - wikijs-network
34
35volumes:
36 postgres_data:
37
38networks:
39 wikijs-network:
40 driver: bridge
41EOF
42
43# 2. Create the .env file
44cat > .env << 'EOF'
45# Wiki.js
46WIKIJS_PORT=3000
47POSTGRES_USER=wikijs
48POSTGRES_PASSWORD=wikijs
49POSTGRES_DB=wikijs
50EOF
51
52# 3. Start the services
53docker compose up -d
54
55# 4. View logs
56docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/wikijs-knowledge-base/run | bash

Troubleshooting

  • Wiki.js shows database connection error: Verify PostgreSQL container is running and POSTGRES_PASSWORD matches DB_PASS environment variable
  • Setup wizard loops or won't complete: Clear browser cache and ensure no existing Wiki.js data in postgres_data volume
  • Git sync fails with authentication error: Configure SSH keys or personal access tokens in Wiki.js admin panel under Storage settings
  • Search results incomplete or missing: Run database maintenance from Admin > System > Utilities to rebuild search indexes
  • Upload failures for images or files: Check available disk space and increase Docker volume size limits if necessary
  • Performance issues with large content: Enable PostgreSQL query optimization by increasing shared_buffers and work_mem in database configuration

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

Ad Space