Step-by-Step Guide: Installing and Configuring Wiki.js with Docker on Ubuntu 25.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 25.04 using Docker, along with PostgreSQL 15, Wiki.js Update Companion, and UFW firewall configuration.
Update the system:
Before installing Wiki.js and Docker, make sure your system is fully updated.
apt -qqy update
DEBIAN_FRONTEND=noninteractive apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' dist-upgrade
Install Docker:
Install the required dependencies to add the Docker repository.
apt -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install ca-certificates curl gnupg lsb-release
Add Docker’s official 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
Install Docker:
apt -qqy update
apt -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Setup Containers
Create a directory to hold Wiki.js configuration and secrets.
mkdir -p /etc/wiki
Generate a secure database password and store it securely:
openssl rand -base64 32 > /etc/wiki/.db-secret
Create a private Docker network:
docker network create wikinet
Create a Docker volume for PostgreSQL data:
docker volume create pgdata
Deploy containers for PostgreSQL, Wiki.js, and the Wiki.js Update Companion:
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
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
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 the Firewall (UFW)
Enable access to required ports:
ufw allow ssh
ufw allow http
ufw allow https
ufw --force enable
Start the containers
Now start the containers:
docker start db
docker start wiki
docker start wiki-update-companion
Wiki.js should now be running and accessible.
Access the setup wizard
Open your browser and visit:
http://your-server-ip/
Replace
your-server-ip
with your actual IP or domain.
The Wiki.js setup wizard will guide you through the rest of the configuration:
You now have a fully functional Wiki.js installation on Ubuntu 25.04, ready for use as a collaborative documentation or knowledge platform.
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