Skip to main content

Self-Hosting Morphee

Run Morphee on your own server. Your data stays yours.


Requirements

ComponentMinimum
OSLinux (Ubuntu 22.04+), macOS, Windows with WSL2
RAM2 GB
CPU2 cores
Disk10 GB free
SoftwareDocker 24+ and Docker Compose v2
OptionalDomain 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)

VariableDescriptionExample
ANTHROPIC_API_KEYClaude API keysk-ant-api03-...

Database (Required)

VariableDescriptionDefault
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string

Auth (Required)

VariableDescriptionDefault
JWT_SECRETToken signing secret (64+ chars)
GOTRUE_JWT_SECRETMust match JWT_SECRET
GOTRUE_SITE_URLYour Morphee URLhttp://localhost

Email (Optional)

VariableDescription
SMTP_HOSTMail server hostname
SMTP_PORTMail server port (usually 587)
SMTP_USERSMTP username
SMTP_PASSSMTP password
SMTP_FROMSender email address

SSO (Optional)

Enable social login by adding provider credentials:

VariableDescription
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETGoogle OAuth
APPLE_CLIENT_ID / APPLE_CLIENT_SECRETApple Sign-In
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETGitHub OAuth
DISCORD_CLIENT_ID / DISCORD_CLIENT_SECRETDiscord 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