Self-host Wiki.js

A wiki engine on Node.js and PostgreSQL with a visual and Markdown editor, local and third-party sign-in, and live collaboration; the current release line is 3.x. Run your own Wiki.js on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

Updated November 23, 2026

Running your own Wiki.js usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Wiki.js behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

Just ask your agent

Open a Plus workspace (Wiki.js runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Wiki.js on this workspace and give me the link. Follow https://envhaven.com/self-host/wikijs.md

Then open the link it sends and create your Wiki.js account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Wiki.js’s docs require.

Or keep it private with Tailscale

The preview URL puts Wiki.js on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Wiki.js an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:

Set up Wiki.js on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/wikijs.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Wiki.js, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
  • Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
At a glance
What it isNotes, wikis and knowledge bases
LicenseAGPL-3.0
Runs asDocker (ghcr.io/requarks/wiki:3)
Memoryat least 1 GB on Linux (docs)
Plan that fitsPlus or larger
Web port3000
Documentationdocs.js.wiki/setup/installation

What your agent takes care of

  • Installing it. Wiki.js runs from the official image, ghcr.io/requarks/wiki:3, with its data in folders under ~/apps/wikijs.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Wiki.js’s docs say to set before it faces the internet, below.
  • Telling you what to back up: the PostgreSQL database (pages, content and settings), config.yml for host installs, a local content-storage path only if Local File System storage is configured in the admin area and ./data (dataPath) is cache and temporary uploads and is not to be backed up (docs).

The settings it needs behind a proxy

  • Administration Area > Security > Trust X-Forwarded-* Proxy Headers: Must be switched on after install when behind a proxy or tunnel so auth callbacks, rate limiting, audit log and live collaboration see the public scheme and client address. (docs)
  • X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-For headers: The proxy must set all three; the auth callback URL is built from them. (docs)
  • Wrong callback if the setting is off: Redirect URLs come out as http and possibly an internal hostname. (docs)
  • WebSocket upgrades through the proxy: Live collaboration (/_collab) needs them. (docs)
  • Cloudflare Tunnel: The docs say Cloudflare already sends the needed headers. (docs)
  • WIKI_PORT (env) or port (config.yml): Listen port, default 3000; the docs advise changing the container’s host port mapping instead. (docs)
  • No base-URL variable; dedicated hostname required: The site is reached at its own domain or sub-domain. (docs)

Before it faces the internet

  • The first administrator is created from ADMIN_EMAIL and ADMIN_PASS (default password 12345678 when unset) and the password must be changed on first login. (docs)
  • ADMIN_EMAIL and ADMIN_PASS only create the root account once. (docs)
  • Enable Trust X-Forwarded-* Proxy Headers behind a proxy. (docs)
  • Use a dedicated database user and password for Wiki.js. (docs)
  • No telemetry. (docs)

Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

  • “Import this folder of Markdown notes, keeping the folder structure.”
  • “Turn off public sign-ups now that my account exists.”
  • “Move Wiki.js to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Wiki.js’s address settings to match.
  • “Update Wiki.js to the latest release.” It pulls the new image and recreates the container, data kept.

Instructions for the agent

The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

Set up Wiki.js on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/requarks/wiki:3, starting from the docs' compose file: https://docs.js.wiki/setup/installation. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: postgres (postgres:18 in the sample; only PostgreSQL 17 and 18 are supported, with the ltree and pg_trgm extensions).
- Keep the compose file in ~/apps/wikijs and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Wiki.js's port 3000.
- The preview URL terminates HTTPS in front of Wiki.js: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/wikijs.md for the preview URL, as Wiki.js's docs describe for running behind a proxy; skip any that apply only when Wiki.js serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/wikijs.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Wiki.js up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.

What to know

  • In Docker, Wiki.js’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
  • The wiki’s own upload cap is 10 MB by default, below Cloudflare’s 100 MB; raising it needs matching proxy limits. (docs)
  • Failed uploads behind a proxy are usually the proxy’s body-size limit. (docs)
  • Outbound internet access is used for update checks, locale data and icon search; it can be turned off with OFFLINE. (docs)
  • Offline switch for restricted VPS networks. (docs)
  • Only PostgreSQL is supported, versions 17 and 18. (docs)
  • Docker tags: no latest tag in 3.x, pin :3. (docs)
  • Not for 2.x installs: in-place upgrade does not apply to them. (docs)
  • Host installs must install the Sharp and Puppeteer extensions from the Administration Area Extensions page; the Docker image bundles all extensions, which is why it is about 850 MB. (docs)
  • Wiki.js expects its own host rather than a path under one, so it takes the workspace’s preview URL or a domain of its own.
  • A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

Without a workspace

The manual route, on a server you run:

  1. Rent a Linux VPS, secure SSH, and create a user for the app.
  2. Install Docker and write a compose file from the official image.
  3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
  4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
  5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Wiki.js’s own documentation covers each step for its install methods.

Sources

Facts about Wiki.js come from its own documentation, checked on 2026-11-23: