Self-Hosting
Deploy MindMatrix on your own infrastructure.
Requirements
- Node.js 22+
- PostgreSQL 17
- 2GB RAM minimum
Docker Compose
git clone git@github.com:mojoaar/mindmatrix.git
cd mindmatrix
cp .env.example .env
openssl rand -base64 48 # Generate BETTER_AUTH_SECRET
docker compose -f deploy/docker-compose.yml up -dNode.js (systemd)
cp deploy/mindmatrix.service /etc/systemd/system/
sudo useradd -r -s /bin/false mindmatrix
sudo mkdir -p /opt/mindmatrix
sudo chown -R mindmatrix:mindmatrix /opt/mindmatrix
sudo systemctl daemon-reload
sudo systemctl enable mindmatrix
sudo systemctl start mindmatrixEnvironment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
BETTER_AUTH_SECRET | Yes | 32+ char random secret |
BETTER_AUTH_URL | Yes | Base URL of the app |
NEXT_PUBLIC_APP_URL | Yes | Public URL for client |
DB_MAX_CONNECTIONS | No | Max DB connections (default 10) |
NODE_ENV | No | production or development |
SMTP_HOST | No | SMTP server hostname for emails |
SMTP_PORT | No | SMTP port (e.g. 587) |
SMTP_USER | No | SMTP username |
SMTP_PASS | No | SMTP password |
EMAIL_FROM | No | Sender email address |
ENCRYPTION_KEY | No | AES-256-GCM key for plugin credentials (generate with openssl rand -hex 32) |
System Configuration
Dynamic admin settings are stored in the system_config PostgreSQL table and can be managed from the Admin Dashboard under the Settings tab. Configurable options include:
- Upload file types and max upload size
- SMTP host, port, user, password, and sender email
- Markdown email templates (verification, password reset)
- Landing page enable/disable
SMTP and ENCRYPTION_KEY can also be set as environment variables, which take priority over the database-stored values.