Compose360 Installation
Prerequisites
-
Linux (Debian or RHEL) server with sudo/root access
-
Python 3.11+
-
An OpenAI API key
Generating an OpenAI API Key
-
Go to https://platform.openai.com/api-keys and sign in.
-
Click "Create new secret key".
-
Set the name to something descriptive (e.g.
compose360-prod). -
When prompted for a Project (sometimes labelled as group or organization), select or create "PCR-360 Lighthouse".
-
Click Create and copy the key — it is only shown once.
-
Paste the key into
settings.shasOPENAI_API_KEY. -
Save the key to Bitwarden under the customer's entry so it can be retrieved later.
Installation
-
Clone the repository
git clone <repo-url> /var/www/pcr360/compose360
cd /var/www/pcr360/compose360
-
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
-
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
-
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-*