Mark Ku's Blog
Open in ChatGPTOpen in Claude

Outline Wiki, a Notion-like open-source knowledge base, can be deployed using Docker Compose.

Podcast ConversationAI dialogue version of this article · Mandarin audio
Audio for this article is powered by VoAIVoAI

Background

In the pursuit of efficient data and knowledge sharing, many companies and teams face the challenge of choosing the right tools. We tried various knowledge base tools, but feedback from our engineers indicated they still had many limitations. After extensive evaluation and searching, we ultimately found Outline to be an excellent knowledge base solution for team collaboration, effectively boosting work efficiency and information management.


What is Outline?

Outline is a clean and powerful knowledge base management tool with an interface and user experience similar to Notion. It supports Markdown editing, full-text search, and various third-party login methods, making it ideal for companies or teams building a shared knowledge base. Outline is open-source, feature-complete, and designed for teams, significantly improving knowledge management and collaboration efficiency.


Setup Guide (Docker Compose Example)

Below is an example configuration for quickly setting up Outline using Docker Compose:

version: '3'

services:
  outline:
    image: outlinewiki/outline:latest
    ports:
      - "27777:3000"
    environment:
      - DATABASE_URL=postgres://postgres:postgres@postgres:5432/outline
      - REDIS_URL=redis://redis:6379
      - SECRET_KEY=你的隨機字串
      - UTILS_SECRET=你的隨機字串
      - URL=http://localhost:27777
      - NODE_ENV=production
      - FORCE_HTTPS=false
      - PORT=3000
      - AWS_ACCESS_KEY_ID=minio
      - AWS_SECRET_ACCESS_KEY=minio123
      - AWS_REGION=us-east-1
      - AWS_S3_UPLOAD_BUCKET_URL=http://localhost:9000
      - AWS_S3_UPLOAD_BUCKET_NAME=uploads
      - AWS_S3_FORCE_PATH_STYLE=true
      - AWS_S3_ACL=private
      - AWS_S3_UPLOAD_MAX_SIZE=26214400
      - PGSSLMODE=disable
      - OIDC_CLIENT_ID=你的OIDC客戶端ID
      - OIDC_CLIENT_SECRET=你的OIDC客戶端密鑰
      - OIDC_AUTH_URI=https://github.com/login/oauth/authorize
      - OIDC_TOKEN_URI=https://github.com/login/oauth/access_token
      - OIDC_SCOPES=read:user user:email
      - OIDC_USERINFO_URI=https://api.github.com/user
      - OIDC_USERNAME_CLAIM=name
      - OIDC_DISPLAY_NAME=GitHub
    depends_on:
      - postgres
      - redis
      - minio

  postgres:
    image: postgres:13
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=outline
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:6
    volumes:
      - redis_data:/data

  minio:
    image: minio/minio
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      - MINIO_ROOT_USER=minio
      - MINIO_ROOT_PASSWORD=minio123
    volumes:
      - minio_data:/data
    command: server /data --console-address ":9001"

volumes:
  postgres_data:
  redis_data:
  minio_data:

Command to start the services:

docker-compose up -d

P.S. If you can't upload, create a bucket named "uploads".

http://localhost:9001/

🚪 Login Methods

Outline does not support username/password login, only various third-party account logins. Here are the main options and things to note:

  • Google Login Requires a Google Workspace (business) account; personal Gmail accounts are not supported.

  • GitHub Login Supports personal GitHub accounts: GitHub Application Authorization Settings

  • Microsoft Login Supports Azure AD (business) accounts and personal Microsoft accounts. Reference


Fixing the Issue of MinIO Images Not Displaying Correctly

3. If article images fail to upload, log in to the MinIO Web UI and manually create a bucket named "uploads"

4. Profile pictures not displaying

# 1. 進入 Minio 容器
docker exec -it outline-wiki-minio-1 sh

# 2. 設定 mc 別名
mc alias set myminio http://localhost:9000 account password


# 3. 設定 uploads bucket 為匿名可讀
mc anonymous set download myminio/uploads

# 4. 檢查設定是否成功
mc anonymous get myminio/uploads

# 5. 離開容器
exit

💾 Data Backup Essentials

Outline data consists of two main parts:

  1. PostgreSQL database: Stores page content, user information, and version history
  2. MinIO storage: Stores all images and files uploaded by users, acting as a local Amazon S3 equivalent.

Access

http://localhost:27777/
Editing interface
Editing interface

Minor Bug

After logging out, you need to close the browser tab to be able to log in again.

✅ Backup

Step 1: Back up the PostgreSQL Database

docker exec -t $(docker ps -qf name=postgres) pg_dump -U postgres outline > outline_backup.sql

Note:

  • The exported file will be in SQL format and saved in the current directory.
  • If your container name is not postgres, use docker ps to find it and replace accordingly.

Step 2: Back up MinIO Data

docker run --rm -v minio_data:/volume -v $(pwd):/backup alpine tar czf /backup/minio_backup.tar.gz -C /volume .

Note:

  • This will compress all files in the MinIO volume into .tar.gz.
  • minio_data is the name of the MinIO volume. Adjust it according to your actual setup.

♻️ Restore Process

Restore the PostgreSQL Database

cat outline_backup.sql | docker exec -i $(docker ps -qf name=postgres) psql -U postgres -d outline

Restore MinIO Data

docker run --rm -v minio_data:/volume -v $(pwd):/backup alpine sh -c "cd /volume && tar xzf /backup/minio_backup.tar.gz"

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··645

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··552

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··331

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··265

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··231

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··222

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11