<!-- page:59407 -->
# Docker

Run Wikilayer on a computer with Docker and Compose. The public [Wikilayer Docker repository](https://github.com/wikilayer/docker) contains the image recipe and `compose.yaml`. Compose starts the Wikilayer binary and PostgreSQL 16. The web interface and local MCP endpoint listen on `localhost:38731`; the database gets no port on the host.

<!-- block:59408 -->
## Start with Compose

In a POSIX shell (WSL on Windows), prepare the Compose files:

```sh
git clone https://github.com/wikilayer/docker.git
cd docker
printf 'POSTGRES_PASSWORD=%s\n' "$(openssl rand -hex 24)" > .env
```

If you also run Wikilayer with [Homebrew](page:59533) on this Mac, stop that service first; both installations use port 38731:

```sh
brew services stop wikilayer/tap/wikilayer
```

Start the containers:

```sh
docker compose up -d
```

<!-- block:59409 -->
## Open and connect

Open the local web interface at `http://localhost:38731`, then [connect a local agent](page:59569) and try the [first steps](page:59339).

<!-- block:59457 -->
## Check and stop

From the cloned `docker` directory, check that both services are running and print the server version:

```sh
docker compose ps
docker compose exec -T wikilayer wikilayer version
```

To stop the containers without deleting their data:

```sh
docker compose stop
```

If you also use the Homebrew installation on this Mac, you can start it again after Docker stops:

```sh
brew services start wikilayer/tap/wikilayer
```

<!-- block:59410 -->
## Update and keep your data

To update, set `WIKILAYER_VERSION` in `.env` to a published tag or leave it unset for `latest`, then run:

```sh
docker compose pull
docker compose up -d
```

Compose keeps the database and uploads in named volumes. `docker compose down` retains them; `docker compose down -v` deletes them. Back up both volumes before upgrades, and take a PostgreSQL dump before changing PostgreSQL's major version.

---

## Links here

- [Homebrew](page:59533)
- [Move from Wikilayer.org](page:59343)
- [Self-hosted](page:59317)

---

[All pages](https://wikilayer.org/smee-again/wikilayer-howto/en/index.md)
