Files
2026-05-02 21:19:04 +00:00

2.6 KiB

High-Availability This feature is only available from version 2.3 and up

When running Wiki.js with multiple replicas (e.g. Kubernetes cluster / Docker Swarm), you must enable High-Availability to ensure any change is propagated to other instances.

HA_ACTIVE : Set to either 1 or true to enable. (optional, off if omitted) You must be using a PostgreSQL database in order to enable this feature. It will not work with any other database engine!

Examples Here's an example of a command to run Wiki.js connecting to a PostgreSQL database:

docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=postgres" -e "DB_HOST=db" -e "DB_PORT=5432" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:2 or to a MySQL database:

docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=db" -e "DB_PORT=3306" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:2 Both examples assume you have a database running in another container named db on the same network. Wiki.js does NOT come with a database engine. See the requirements for more details.

Let's Encrypt example:

docker run -d -p 80:3000 -p 443:3443 -e "LETSENCRYPT_DOMAIN=wiki.example.com" -e "LETSENCRYPT_EMAIL=admin@example.com" --name wiki --restart unless-stopped -e "DB_TYPE=postgres" -e "DB_HOST=db" -e "DB_PORT=5432" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:2 Alternative: Mount the config file If using environment variables is not your cup of tea, you can also mount a config file instead.

Create a new file based on the sample config file and modify the values to match your setup. You can then mount the config file in the container:

docker run -d -p 8080:3000 --name wiki --restart unless-stopped -v YOUR-FILE.yml:/wiki/config.yml ghcr.io/requarks/wiki:2 It's also possible to define an alternate location for the config file to be loaded from, using the CONFIG_FILE env variable. This is useful in scenarios where you want to mount a configuration folder instead.

CONFIG_FILE : Path to the config.yml file Change User Mode By default, Wiki.js runs as user wiki. If you get permissions issues while mounting files (such as SQLite db or private keys), you can override the runtime user to run as root using the -u parameter, e.g.:

docker run -d -p 8080:3000 -u="root" --name wiki --restart unless-stopped -e "DB_TYPE=postgres" -e "DB_HOST=db" -e "DB_PORT=5432" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:2 This is however not a secure way to run containers. Make sure you understand the security implications before doing so.