···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 build 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 auth, use the `caddy` profile of the compose:
8484+8585+```sh
8686+docker compose --profile caddy up -d
8787+```
8888+8989+The knot server will 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+Thus, when trying to push code to your knot, say `git@knot.example.com/someRepo`, Git will use port 22 by default (which will resolve to your docker host's SSH daemon).
106106+Configure ssh to use the port exposed by your container in `~/.ssh/config`:
107107+108108+```
109109+Host knot.example.com
110110+ Port 2222
111111+```
112112+113113+You can then test your configuration using `ssh -T git@knot.example.com`.