Step-by-Step Guide: Installing and Configuring Wiki.js with Docker on Ubuntu 26.04

Wiki.js is a powerful and modern wiki application that runs on Node.js. It features a user-friendly interface, Markdown support with live preview, version control, powerful search, customizable themes, and plugin extensibility.

Common uses include internal documentation, knowledge base management, project wikis, educational resources, and event planning.

This guide walks you through installing Wiki.js on Ubuntu 26.04 using Docker, along with PostgreSQL 15, Wiki.js Update Companion, and UFW firewall configuration.

Update the system

Before installing Wiki.js and Docker, update the system packages:

apt update -y

apt upgrade -y

Install Docker

Install required dependencies:

apt install ca-certificates curl gnupg lsb-release -y

Add Docker GPG key and repository:

mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Update package list and install Docker:

apt update

apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Verify Docker installation:

docker --version

Output:

Docker version 29.4.3, build 055a478

Setup Wiki.js Containers

Create configuration directory:

mkdir -p /etc/wiki

Generate secure PostgreSQL password:

openssl rand -base64 32 > /etc/wiki/.db-secret

Create Docker network:

docker network create wikinet

Create PostgreSQL volume:

docker volume create pgdata

Create PostgreSQL container:

docker create --name=db \
  -e POSTGRES_DB=wiki \
  -e POSTGRES_USER=wiki \
  -e POSTGRES_PASSWORD_FILE=/etc/wiki/.db-secret \
  -v /etc/wiki/.db-secret:/etc/wiki/.db-secret:ro \
  -v pgdata:/var/lib/postgresql/data \
  --restart=unless-stopped \
  -h db \
  --network=wikinet \
  postgres:15

Create Wiki.js container:

docker create --name=wiki \
  -e DB_TYPE=postgres \
  -e DB_HOST=db \
  -e DB_PORT=5432 \
  -e DB_PASS_FILE=/etc/wiki/.db-secret \
  -v /etc/wiki/.db-secret:/etc/wiki/.db-secret:ro \
  -e DB_USER=wiki \
  -e DB_NAME=wiki \
  -e UPGRADE_COMPANION=1 \
  --restart=unless-stopped \
  -h wiki \
  --network=wikinet \
  -p 80:3000 -p 443:3443 \
  ghcr.io/requarks/wiki:2

Create Wiki.js Update Companion container:

docker create --name=wiki-update-companion \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  --restart=unless-stopped \
  -h wiki-update-companion \
  --network=wikinet \
  ghcr.io/requarks/wiki-update-companion:latest

Configure Firewall (UFW)

Allow required ports:

ufw allow ssh

ufw allow http

ufw allow https

Enable firewall:

ufw --force enable

Check firewall status:

ufw status

Start Wiki.js Containers

Start all containers:

docker start db

docker start wiki

docker start wiki-update-companion

Check running containers:

docker ps

Access Wiki.js Setup Wizard

Open your browser and visit:

http://your-server-ip/

Replace your-server-ip with your actual server IP address or domain name.

You will now see the Wiki.js setup wizard.

Setup Wizard

Welcome screen:

Configure Administrator Account and Site Settings:

Complete setup and access the dashboard:

🎉 You have successfully installed and configured Wiki.js on Ubuntu 26.04 using Docker and PostgreSQL.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS