···6262The simplest way to set up your own knot is to use the provided compose file
6363and run the following:
64646565+First, create directories that will be used as docker volumes:
6666+6567```sh
6668mkdir keys repositories server
6969+chown -R 1000:1000 keys repositories server
7070+```
7171+7272+Replace the `1000:1000` ids if you built your docker image with different ids.
7373+7474+Then start the knot container using:
7575+7676+```sh
6777export KNOT_SERVER_HOSTNAME=example.com
6878export KNOT_SERVER_OWNER=did:plc:yourdidgoeshere
6979export KNOT_SERVER_PORT=443
7080docker compose up -d
7181```
72827373-This will setup everything for you including a reverse proxy.
8383+If you also want to setup a reverse proxy with TLS termination, use the `caddy` profile of the in the compose file:
8484+8585+```sh
8686+docker compose --profile caddy up -d
8787+```
8888+8989+The knot server will then be exposed on the given port.
9090+9191+## Pushing code using SSH
9292+9393+When starting a knot in a docker container, the knot listens to a SSH port that is not the same as the host.
9494+The `docker-compose.yml` file uses port 2222 as an example:
9595+9696+```yml
9797+services:
9898+ knot:
9999+ image: atcr.io/tangled.org/knot:latest
100100+ ports:
101101+ - "5555:5555"
102102+ - "2222:22"
103103+```
104104+105105+By default, when you push code to a remote, such as `git@knot.example.com/someRepo`, Git will use port 22, which will resolve to your docker host's SSH daemon, not the container.
106106+107107+To connect to the knot container over Git with SSH, configure your SSH client to use the port exposed by the container in `~/.ssh/config`.
108108+109109+```
110110+Host knot.example.com
111111+ Port 2222
112112+```
113113+114114+You can then test your configuration using `ssh -T git@knot.example.com`.