PCR-360 Wiki

Compose360 Install

Compose360 Installation

Prerequisites

  • Linux (Debian or RHEL) server with sudo/root access

  • Python 3.11+

  • An OpenAI API key

Generating an OpenAI API Key

  1. Go to https://platform.openai.com/api-keys and sign in.

  2. Click "Create new secret key".

  3. Set the name to something descriptive (e.g. compose360-prod).

  4. When prompted for a Project (sometimes labelled as group or organization), select or create "PCR-360 Lighthouse".

  5. Click Create and copy the key — it is only shown once.

  6. Paste the key into settings.sh as OPENAI_API_KEY.

  7. Save the key to Bitwarden under the customer's entry so it can be retrieved later.


Installation

  1. Clone the repository

git clone <repo-url> /var/www/pcr360/compose360
cd /var/www/pcr360/compose360

  1. Configure settings

cp settings.sh.example settings.sh

Edit settings.sh and set at minimum:

OPENAI_API_KEY=your_openai_api_key_here

# generate: python -c "import secrets; print(secrets.token_urlsafe(32))"
ADMIN_API_KEY=your-secure-admin-key-here

# or oracle
SCHEMA_TYPE=mysql

  1. Run the deploy script

The deploy script auto-detects the OS family and handles both Debian/Ubuntu (apt) and RHEL/CentOS/Rocky/AlmaLinux (dnf/yum) automatically.

sudo bash deploy.sh

This will automatically:

  • Install system dependencies

  • Create /opt/compose360/ with application files

  • Set up a Python virtual environment and install dependencies

  • Download the embedding model

  • Generate and enable the compose360 systemd service

  • Start the service and seed the RAG system


  1. Verify the installation

curl http://localhost:8001/health
sudo systemctl status compose360

Service management

sudo systemctl start|stop|restart|status compose360
journalctl -u compose360 -f    # tail logs

Troubleshooting

pip install fails with "No space left on device"

Why it happens:

Many servers mount /tmp as a small tmpfs partition (often 1–2 GB). pip uses /tmp for downloading and extracting packages. Large installs (e.g. chromadb, sentence-transformers, torch) can exceed this limit.

How to diagnose:

Check /tmp size

df -h /tmp

Check available space on the app partition

df -h /opt

If /tmp is under ~2 GB free, use the options below.

Fix — redirect pip to the app partition:

Use defaults ($APP_DIR/tmp and $APP_DIR/.pip-cache)

sudo bash deploy.sh --tmp-dir --pip-cache-dir

Or specify custom paths

sudo bash deploy.sh --tmp-dir /opt/compose360/tmp --pip-cache-dir /opt/compose360/.pip-cache

What it does:

  • Sets TMPDIR so pip writes temp/extracted files to the specified directory instead of /tmp

  • Sets PIP_CACHE_DIR so downloaded wheels are cached there

  • Both directories are created automatically before install and deleted after

If you've already run a failed install and want to reclaim /tmp space:

Clean pip's default cache
pip cache purge
Remove any leftover pip temp files from /tmp
rm -rf /tmp/pip-*