Self-Hosting Morphee
Run Morphee on your own server. Your data stays yours.
Requirements
| Component | Minimum |
|---|---|
| OS | Linux (Ubuntu 22.04+), macOS, Windows with WSL2 |
| RAM | 2 GB |
| CPU | 2 cores |
| Disk | 10 GB free |
| Software | Docker 24+ and Docker Compose v2 |
| Optional | Domain name + SSL certificate for HTTPS |
Quick Start (5 minutes)
1. Clone the repository
git clone https://github.com/your-org/morphee-beta.git
cd morphee-beta
2. Configure environment
cp .env.example .env
Edit .env with your settings:
# Required
DATABASE_URL=postgresql://morphee:yourpassword@db:5432/morphee
REDIS_URL=redis://redis:6379/0
JWT_SECRET=generate-a-random-64-char-string
ANTHROPIC_API_KEY=sk-ant-... # Get from console.anthropic.com
# Supabase Auth
GOTRUE_JWT_SECRET=same-as-JWT_SECRET
GOTRUE_SITE_URL=https://your-domain.com
# Optional: Email (for account verification, invites, password reset)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=noreply@your-domain.com
SMTP_PASS=your-smtp-password
SMTP_FROM=noreply@your-domain.com
No SMTP? Accounts are auto-confirmed without email verification. You can add SMTP later.
3. Start Morphee
docker compose up -d
This starts:
- Frontend (port 80) — React web app served by Nginx
- Backend (port 8000) — Python FastAPI server
- PostgreSQL (port 5432) — Database
- Redis (port 6379) — Caching and real-time events
- Supabase Auth (port 9999) — Authentication service
4. Open Morphee
Visit http://localhost (or https://your-domain.com if configured).
Create your account, go through onboarding, and start chatting!
Desktop App (Optional)
For local AI features (offline embeddings, Git-based memory, local LLM), install the desktop app:
- macOS / Windows / Linux: Download from Releases
The desktop app connects to your self-hosted server while running ML models locally on your machine.
Configuration Reference
AI (Required)
| Variable | Description | Example |
|---|---|---|
ANTHROPIC_API_KEY | Claude API key | sk-ant-api03-... |
Database (Required)
| Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | — |
REDIS_URL | Redis connection string | — |
Auth (Required)
| Variable | Description | Default |
|---|---|---|
JWT_SECRET | Token signing secret (64+ chars) | — |
GOTRUE_JWT_SECRET | Must match JWT_SECRET | — |
GOTRUE_SITE_URL | Your Morphee URL | http://localhost |
Email (Optional)
| Variable | Description |
|---|---|
SMTP_HOST | Mail server hostname |
SMTP_PORT | Mail server port (usually 587) |
SMTP_USER | SMTP username |
SMTP_PASS | SMTP password |
SMTP_FROM | Sender email address |
SSO (Optional)
Enable social login by adding provider credentials:
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET | Google OAuth |
APPLE_CLIENT_ID / APPLE_CLIENT_SECRET | Apple Sign-In |
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET | GitHub OAuth |
DISCORD_CLIENT_ID / DISCORD_CLIENT_SECRET | Discord OAuth |
Updating
cd morphee-beta
git pull
docker compose down
docker compose up -d --build
Database migrations run automatically on startup.
Backups
Database
# Manual backup
docker compose exec db pg_dump -U morphee morphee > backup-$(date +%Y%m%d).sql
# Restore
docker compose exec -T db psql -U morphee morphee < backup-20260221.sql
Automated backups
See the included backup script:
./scripts/backup-morphee.sh
Set up a cron job for daily backups:
0 2 * * * /path/to/morphee-beta/scripts/backup-morphee.sh
Reverse Proxy (HTTPS)
For production, put Morphee behind a reverse proxy with SSL.
Nginx example
server {
listen 443 ssl;
server_name morphee.your-domain.com;
ssl_certificate /etc/letsencrypt/live/morphee.your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/morphee.your-domain.com/privkey.pem;
location / {
proxy_pass http://localhost:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /ws {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Coolify
Morphee has first-class Coolify support. See Coolify Deployment Guide.
Troubleshooting
Container won't start
docker compose logs backend # Check backend logs
docker compose logs db # Check database logs
Can't connect to database
Make sure DATABASE_URL matches your PostgreSQL credentials and the db container is running.
AI not responding
Verify your ANTHROPIC_API_KEY is valid:
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "content-type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-sonnet-4-20250514","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'
More help
Back to Getting Started