# SIMCOAI Docs VPS Deployment

The docs site is static and should be isolated from the API and dashboard.

## VPS Layout

```text
/root/simco                         Backend API and worker
/var/www/dashboard                  Dashboard
/var/www/docs.simcoai.co.uk/public  Documentation site
/etc/nginx/sites-available/docs.simcoai.co.uk
/var/log/nginx/docs.simcoai.co.uk.access.log
/var/log/nginx/docs.simcoai.co.uk.error.log
```

## DNS

Point the docs subdomain at the VPS public IP:

```text
Type: A
Host/Name: docs
Value: YOUR_VPS_PUBLIC_IPV4
TTL: Default
```

If your VPS also has IPv6:

```text
Type: AAAA
Host/Name: docs
Value: YOUR_VPS_PUBLIC_IPV6
TTL: Default
```

Do not create both an A/CNAME record for `docs`. Use A/AAAA for the VPS.

## Install

Upload and extract the docs ZIP on the VPS, then run:

```bash
cd /path/to/extracted/docs-site
sudo bash deploy/install-docs-vps.sh
```

## Enable HTTPS

After DNS resolves to the VPS:

```bash
sudo certbot --nginx -d docs.simcoai.co.uk
sudo nginx -t
sudo systemctl reload nginx
```

## Verify

```bash
nslookup docs.simcoai.co.uk
curl -I http://docs.simcoai.co.uk
curl -I https://docs.simcoai.co.uk
tail -n 80 /var/log/nginx/docs.simcoai.co.uk.error.log
```

## Update Docs Later

Extract the new docs ZIP and run the install script again. The script only syncs the docs public folder and docs Nginx config.
