# Self-host Wiki.js

> A modern wiki with Markdown and visual editing, page permissions and full-text search, backed by Postgres.

- Page: https://levelrail.com/templates/wikijs/
- JSON: https://levelrail.com/templates/wikijs.json
- Category: Productivity
- Licence: AGPL-3.0 (Network copyleft (AGPL) license)
- Source: https://github.com/requarks/wiki
- Upstream docs: https://docs.requarks.io

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 16-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | postgres | 16-alpine | none | pgdata -> /var/lib/postgresql/data |
| wiki | ghcr.io/requarks/wiki | 2 | 3000 | none |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | POSTGRES_DB | preset |
| db | POSTGRES_PASSWORD | generated |
| db | POSTGRES_USER | preset |
| wiki | DB_HOST | preset |
| wiki | DB_NAME | preset |
| wiki | DB_PASS | generated |
| wiki | DB_PORT | preset |
| wiki | DB_TYPE | preset |
| wiki | DB_USER | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install wikijs --name my-wikijs
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain db=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/wikijs/install \
  -d '{
    "name": "my-wikijs"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## Questions

### Can I deploy Wiki.js on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id wikijs for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, ghcr.io/requarks/wiki:2 is what you deploy there.

Self-host Wiki.js, Wiki.js docker compose file, deploy Wiki.js on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
