Docker is the recommended way to run Wiki.js.
Wiki.js requires a PostgreSQL database. See the Docker Compose section below for an example with a database.
A Wiki.js docker image is available on the following registries:
Images are tagged to major, major.minor and major.minor.patch versions.
It's recommended to use the major version, unless you have a specific requirement to pin your deployment to specific version.
Note that Wiki.js 3.x is in alpha and images are currently tagged as `3.0.0-alpha`. The tags below won't work until the beta phase has started.
# recommended
ghcr.io/requarks/wiki:3
# using a specific version:
ghcr.io/requarks/wiki:3.0
ghcr.io/requarks/wiki:3.0.1
While the "latest" tag is available, it's NOT RECOMMENDED to use it as it can break your deployment if the next major version has breaking changes.
All images are built for these architectures:
✅ = Required
✴️ = Recommended
Env | Description | Required | Default |
---|---|---|---|
ADMIN_EMAIL | Email address to use to create the root administrator account. Has no effect if the root administrator account is already created. | ✴️ | admin@example.com |
ADMIN_PASS | Initial password to use to create the root administrator account. Has no effect if the root administrator account is already created. | ✴️ | 12345678 |
CONFIG_FILE | Path to the config file | ./config.yml | |
DATABASE_URL | Database Connection String (overrides all DB_ prefixed env vars if set) | ||
DB_HOST | Database Hostname / IP Address | ✅ | |
DB_NAME | Database Name | ✅ | |
DB_PASS | Database Password | ✅ | |
DB_PASS_FILE | Path to the mapped file containing the database password. (overrides DB_PASS if set) | ||
DB_PORT | Database Port | 5432 | |
DB_SCHEMA | Database Schema | wiki | |
DB_SSL | Whether to use SSL to connect to the database. Accepted values: 0, 1, true, false | false | |
DB_SSL_CA | Database CA certificate content, as a single line string (without spaces or new lines), without the prefix and suffix lines. | ||
DB_USER | Database Username | ✅ | |
HTTPS_ENABLE | Whether to enable the HTTPS server. Accepted values: 0, 1, true, false | false | |
HTTPS_LE_DOMAIN | Let's Encrypt - Initial domain to provision. | ||
HTTPS_LE_EMAIL | Let's Encrypt - Email address to use when provisioning certificates. | ||
HTTPS_PORT | HTTPS Port to listen on | 3443 | |
HTTPS_PROVIDER | Provider to use to provision the SSL certificate. Accepted values: letsencrypt, custom | letsencrypt | |
LOG_FORMAT | Logging format Accepted values: default, json | default | |
LOG_LEVEL | Severity level for logging Accepted values: debug, info, warn, error | info | |
PORT | HTTP Port to listen on | 3000 |
Assuming you have a PostgreSQL container named db on the same network (replace the values with your own!):
docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "ADMIN_EMAIL=user@example.com" -e "ADMIN_PASS=SuperSecret123" -e "DB_HOST=db" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:3
Once the container is started, browse to http://YOUR-IP-ADDRESS:8080 and login using the admin email and password you provided in the command above.
By default, the Wiki.js docker image runs as the user wiki. Some deployments require the container to run as root. Simply add the -u root parameter when creating the container to do so.
This is however not a secure way to run containers. Make sure you understand the security implications before doing so.
Upgrading is simply a matter of recreating the container with the latest image version:
# Stop and remove container named "wiki"
docker stop wiki
docker rm wiki
# Pull latest image of Wiki.js
docker pull ghcr.io/requarks/wiki:3
# Create new container of Wiki.js based on latest image
docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_HOST=db" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:3
Here's a full example of a Docker Compose file for Wiki.js, using PostgreSQL, listening on port 80 (replace the values of ADMIN_EMAIL and ADMIN_PASS with your own!):
version: "3"
services:
db:
image: postgres:16
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: ghcr.io/requarks/wiki:3
depends_on:
- db
environment:
ADMIN_EMAIL: user@example.com
ADMIN_PASS: SuperSecret123
DB_HOST: db
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
restart: unless-stopped
ports:
- "80:3000"
volumes:
db-data:
DB_HOST should match the service name (in this case, db). If container_name is specified for the service, its value should be used instead.
See the reference above for all available environment variables.
Once both containers are started, browse to http://YOUR-IP-ADDRESS and login using the admin email and password you provided above.
The following commands will pull the latest image and recreate the containers defined in the docker-compose file:
docker compose pull wiki
docker compose up --force-recreate -d