Deploying memEx
Introduction
memEx is a personal knowledge management system inspired by Vannevar Bush’s original Memex concept from 1945. It provides a structured way to organize notes, research, and ideas in an interconnected wiki-like format.
Named after the hypothetical device that would allow users to store and retrieve knowledge through associative links, memEx brings this vision to modern personal knowledge management. It focuses on creating connections between ideas rather than just storing isolated notes.
Key highlights of memEx:
- Wiki-Style Organization: Create interconnected pages of knowledge
- Markdown Support: Write notes using familiar Markdown syntax
- Search Functionality: Full-text search across all notes
- Tagging System: Organize notes with flexible tags
- Link Visualization: See connections between your notes
- Version History: Track changes to your notes over time
- Export Options: Export your knowledge base in various formats
- Privacy Focused: Self-hosted for complete data ownership
- Responsive Design: Works on desktop and mobile devices
- 100% Open Source: Community-driven development
This guide walks through deploying memEx on Klutch.sh using Docker, setting up your knowledge base, and organizing your notes effectively.
Why Deploy memEx on Klutch.sh
Deploying memEx on Klutch.sh provides several advantages:
Always-On Access: Your knowledge base is available 24/7 from anywhere.
Simplified Deployment: Klutch.sh handles container deployment automatically.
Persistent Storage: Notes and configurations survive restarts.
HTTPS by Default: Secure access to your personal knowledge.
GitHub Integration: Track configuration in version control.
Data Ownership: Complete control over your notes and data.
Prerequisites
Before deploying memEx on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and Markdown
Understanding memEx Architecture
memEx uses a straightforward architecture:
Web Application: The main interface for creating and browsing notes.
Database: Stores notes, tags, and their relationships.
Search Index: Enables fast full-text search across content.
File Storage: Stores attachments and media files.
Preparing Your Repository
Create a GitHub repository for your memEx deployment.
Repository Structure
memex-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM python:3.11-slim
# Install system dependenciesRUN apt-get update && apt-get install -y \ gcc \ libpq-dev \ && rm -rf /var/lib/apt/lists/*
# Create application directoryWORKDIR /app
# Install memExRUN pip install memex-notes
# Set environment variablesENV MEMEX_SECRET_KEY=${MEMEX_SECRET_KEY}ENV MEMEX_DATABASE_URL=${MEMEX_DATABASE_URL:-sqlite:///data/memex.db}ENV MEMEX_DATA_DIR=/data
# Create data directoryRUN mkdir -p /data
# Expose the web interfaceEXPOSE 8000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -f http://localhost:8000/health || exit 1
# Run the applicationCMD ["memex", "serve", "--host", "0.0.0.0", "--port", "8000"]Alternative Setup with PostgreSQL
For production deployments:
FROM python:3.11-slim
# Install dependenciesRUN apt-get update && apt-get install -y \ gcc \ libpq-dev \ curl \ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install memEx with PostgreSQL supportRUN pip install memex-notes psycopg2-binary
# Environment variablesENV MEMEX_SECRET_KEY=${MEMEX_SECRET_KEY}ENV MEMEX_DATABASE_URL=${MEMEX_DATABASE_URL}ENV MEMEX_DATA_DIR=/dataENV MEMEX_DEBUG=false
# Create data directoryRUN mkdir -p /data
# Expose portEXPOSE 8000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -f http://localhost:8000/health || exit 1
CMD ["memex", "serve", "--host", "0.0.0.0", "--port", "8000"]Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
MEMEX_SECRET_KEY | Yes | - | Secret key for session encryption |
MEMEX_DATABASE_URL | No | sqlite:///data/memex.db | Database connection URL |
MEMEX_DATA_DIR | No | /data | Directory for data files |
MEMEX_DEBUG | No | false | Enable debug mode |
Deploying memEx on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8000
Generate a Secret Key
Create a secure secret key:
python -c "import secrets; print(secrets.token_hex(32))"Push Your Repository to GitHub
Initialize and push your repository:
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial memEx deployment configuration"git remote add origin https://github.com/yourusername/memex-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “memex” or “knowledge-base”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select the repository containing your Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
MEMEX_SECRET_KEY | Your generated secret key |
For PostgreSQL (optional):
| Variable | Value |
|---|---|
MEMEX_DATABASE_URL | postgresql://user:pass@host:5432/memex |
Attach Persistent Volumes
Add storage for your notes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 5 GB | Notes, attachments, and database |
Deploy Your Application
Click Deploy to start the build process.
Access memEx
Once deployed, access your knowledge base at https://your-app-name.klutch.sh.
Using memEx
Creating Notes
Start building your knowledge base:
- Click “New Note” in the interface
- Give your note a title
- Write content using Markdown
- Add tags for organization
- Save your note
Linking Notes
Create connections between ideas:
- Use
[[Note Title]]syntax to link to other notes - Links are created automatically
- View a visualization of connections
Markdown Features
memEx supports full Markdown:
# Heading 1## Heading 2
**Bold** and *italic* text
- Bullet lists- With items
1. Numbered lists2. With items
`inline code`
```code blocks```
> Blockquotes
[[Links to other notes]]Tagging System
Organize with tags:
- Add tags when creating notes
- Filter notes by tag
- Combine multiple tags
- View tag statistics
Knowledge Organization
Zettelkasten Method
Apply the Zettelkasten note-taking system:
- Create atomic notes (one idea per note)
- Link notes extensively
- Use tags for broad categorization
- Build emergence through connections
Topic Hierarchies
Organize by topic:
/topics/├── Programming/│ ├── Python/│ └── JavaScript/├── Research/│ └── Machine Learning/└── Personal/ └── Projects/Daily Notes
Capture daily thoughts:
- Create daily note pages
- Link to relevant topics
- Review and consolidate weekly
Search and Discovery
Full-Text Search
Find any note quickly:
- Search titles and content
- Filter by tags
- Sort by date or relevance
Graph View
Visualize your knowledge:
- See connections between notes
- Discover related topics
- Identify knowledge gaps
Backup and Export
Exporting Notes
Export your knowledge base:
- Go to Settings > Export
- Choose format (Markdown, JSON)
- Download the archive
Backup Strategy
Protect your knowledge:
- Regular database backups
- Export Markdown periodically
- Store exports offsite
Troubleshooting
Notes Not Saving
- Check database connectivity
- Verify volume is mounted
- Review application logs
Search Not Working
- Rebuild search index
- Check for database corruption
- Verify search configuration
Slow Performance
- Allocate more resources
- Consider PostgreSQL for large bases
- Clean up unused attachments
Additional Resources
- memEx GitHub Repository
- Memex Wikipedia Article
- Zettelkasten Method
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying memEx on Klutch.sh gives you a personal knowledge management system that helps you organize and connect your ideas. With Markdown support, full-text search, and link visualization, memEx provides the tools you need to build a comprehensive personal knowledge base.
Take control of your knowledge with memEx on Klutch.sh, where your ideas stay interconnected and accessible from anywhere.