---
# System prepended metadata

title: Create Boxes

---

# Youtube Guide

1 for server and frontends cx3 (<name>-1)
1 for QDRANT cx3
1 database for NEON (save env)

## qdrant box

Run script, maybe change QDRANT_API_KEY
this stores the database stuff in /root/data.
```
### SETUP DOCKER
export DEBIAN_FRONTEND=noninteractive
apt-get -y update

sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

#### CREATE qdrant
mkdir qdrant
cd qdrant
echo '
version: "3"

services:
  qdrant-database:
    image: qdrant/qdrant:v1.3.2
    environment:
      - QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}
    ports:
      - 6333:6333
      - 6334:6334
    volumes:
      - /root/qdrant/qdrant-data:/qdrant/storage
    networks:
      - vault-network
networks:
  vault-network:
    driver: bridge
' > docker-compose.yml

### MAYBE CHANGE
echo "QDRANT_API_KEY=qdrant_key" > .env

docker compose up -d
```

Yeah. That's kinda it for that, what else did you expect man?

## <name>-1 box

Run script (should not need interaction)
```
### SETUP DOCKER
export DEBIAN_FRONTEND=noninteractive
apt-get -y update

sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

### SETUP CADDY
sudo apt-get install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt-get update -y 
sudo apt-get install -y caddy


### SETUP ARGUFLOW
git clone https://github.com/arguflow/arguflow
cd arguflow
cp Caddyfile /etc/caddy/Caddyfile
cat .env.server .env.search .env.chat .env.docker-compose > .env
docker compose pull
vim .env
```

### Caddy properly

REPLACE <name> with the DNS name

```
sed -i 's/self/<name>/g' /etc/caddy/Caddyfile
systemctl enable --now caddy.service
systemctl reload caddy.service
```

### SERVER ENV's
- DATABASE_URL=<neon-db-connection>
- REDIS_URL=redis://<server-ip>:6379
- S3_ENDPOINT=http://<server-ip>:9000
- QDRANT_URL=http://<qdrant-ip>:6334
- QDRANT_API_KEY=qdrant_key

### SEARCH ENV's
- PUBLIC_CHAT_URL=https://<name>-chat.arguflow.ai
- PUBLIC_SERACH_URL=https://<name>-search.arguflow.ai
- PUBLIC_API_HOST=https://<name>-api.arguflow.ai

- DATASET=<name>

### CHAT ENV's

EDIT VITE_API_HOST=https://<name>-api.arguflow.ai/api
EDIT VITE_SEARCH_URL=https://<name>-search.arguflow.ai

### ETC ENV's

Edit frontmatter vals as needed

### Finalize

`docker compose up -d`


### Updating

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

## Getting transcripts