VPS / Bare Metal
Deploy Exocortex on a fresh Ubuntu 24.04 server. After following this guide you will have PostgreSQL 16 with pgvector + Apache AGE, a Python venv, and all systemd services installed.
Prerequisites
| Requirement | Minimum |
|---|---|
| OS | Ubuntu 24.04 LTS |
| CPU | 2 vCPU |
| RAM | 4 GB |
| Disk | 20 GB SSD |
| Network | public IPv4, outbound HTTPS |
A DigitalOcean s-2vcpu-4gb droplet in any region works well (~$24/month).
Quick start
git clone https://github.com/hretheum/exocortex /opt/exocortexcd /opt/exocortexsudo bash scripts/bootstrap_vps.shThe script installs all dependencies, creates the exocortex system user, sets up a Python venv, and generates /etc/exocortex.env from the bundled template.
Preview what it would do without making any changes:
sudo bash scripts/bootstrap_vps.sh --dry-runStep-by-step
1. System dependencies
The bootstrap script runs:
apt-get install -y postgresql-16 postgresql-contrib libpq-dev \ python3.12 python3.12-venv python3.12-dev git build-essential pkg-config2. pgvector
Compiled from source and installed as a PostgreSQL extension:
git clone --depth 1 https://github.com/pgvector/pgvector /tmp/pgvectorcd /tmp/pgvector && make && make installsudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS vector;"3. Apache AGE
Graph extension compiled against PG 16:
git clone --depth 1 --branch PG16 https://github.com/apache/age /tmp/agecd /tmp/age && make PG_CONFIG=$(pg_config) && make installsudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS age;"4. System user and directories
useradd --system --shell /bin/bash --home-dir /opt/exocortex --create-home exocortexLogs go to /var/log/exocortex/ (owned by exocortex).
5. Python venv
python3.12 -m venv /opt/exocortex/.venv/opt/exocortex/.venv/bin/pip install -r /opt/exocortex/requirements.txt6. Environment file
The bootstrap copies config/.env.example to /etc/exocortex.env (mode 600, owner exocortex). It will not overwrite an existing file.
Post-install configuration
Edit /etc/exocortex.env and fill in at minimum:
DATABASE_URL=postgresql://exocortex:yourpassword@localhost/exocortexEXOCORTEX_VAULT_PATH=/home/youruser/vaultANTHROPIC_API_KEY=sk-ant-...TENANT_ID=your-tenant-idThen run the database migrations:
sudo -u exocortex /opt/exocortex/.venv/bin/exocortex migrateAnd install systemd services:
sudo bash /opt/exocortex/deploy/install.shPreview the install first:
sudo bash /opt/exocortex/deploy/install.sh --dry-runVerification
systemctl list-timers exocortex-* --no-pagersudo -u exocortex /opt/exocortex/.venv/bin/exocortex --helpTroubleshooting
PostgreSQL not starting
Check journalctl -u postgresql — usually a locale or data directory issue. Run pg_lsclusters to see cluster state.
AGE extension missing after install
Ensure postgresql.conf includes shared_preload_libraries = 'age' and restart PostgreSQL. The bootstrap script does this via CREATE EXTENSION; a manual restart may be needed if the line was not already present.
Permission errors on /etc/exocortex.env
The file must be owned by exocortex and have mode 600. Fix with:
sudo chown exocortex:exocortex /etc/exocortex.env && sudo chmod 600 /etc/exocortex.envexocortex command not found after install
The CLI is installed inside the venv:
/opt/exocortex/.venv/bin/exocortex --helpAdd /opt/exocortex/.venv/bin to PATH or create a symlink in /usr/local/bin.