Skip to content

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:

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Create application directory
WORKDIR /app
# Install memEx
RUN pip install memex-notes
# Set environment variables
ENV MEMEX_SECRET_KEY=${MEMEX_SECRET_KEY}
ENV MEMEX_DATABASE_URL=${MEMEX_DATABASE_URL:-sqlite:///data/memex.db}
ENV MEMEX_DATA_DIR=/data
# Create data directory
RUN mkdir -p /data
# Expose the web interface
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Run the application
CMD ["memex", "serve", "--host", "0.0.0.0", "--port", "8000"]

Alternative Setup with PostgreSQL

For production deployments:

FROM python:3.11-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install memEx with PostgreSQL support
RUN pip install memex-notes psycopg2-binary
# Environment variables
ENV MEMEX_SECRET_KEY=${MEMEX_SECRET_KEY}
ENV MEMEX_DATABASE_URL=${MEMEX_DATABASE_URL}
ENV MEMEX_DATA_DIR=/data
ENV MEMEX_DEBUG=false
# Create data directory
RUN mkdir -p /data
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --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

VariableRequiredDefaultDescription
MEMEX_SECRET_KEYYes-Secret key for session encryption
MEMEX_DATABASE_URLNosqlite:///data/memex.dbDatabase connection URL
MEMEX_DATA_DIRNo/dataDirectory for data files
MEMEX_DEBUGNofalseEnable debug mode

Deploying memEx on Klutch.sh

    Generate a Secret Key

    Create a secure secret key:

    Terminal window
    python -c "import secrets; print(secrets.token_hex(32))"

    Push Your Repository to GitHub

    Initialize and push your repository:

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial memEx deployment configuration"
    git remote add origin https://github.com/yourusername/memex-deploy.git
    git push -u origin main

    Create 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:

    • Select HTTP as the traffic type
    • Set the internal port to 8000

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    MEMEX_SECRET_KEYYour generated secret key

    For PostgreSQL (optional):

    VariableValue
    MEMEX_DATABASE_URLpostgresql://user:pass@host:5432/memex

    Attach Persistent Volumes

    Add storage for your notes:

    Mount PathRecommended SizePurpose
    /data5 GBNotes, 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:

  1. Click “New Note” in the interface
  2. Give your note a title
  3. Write content using Markdown
  4. Add tags for organization
  5. 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 lists
2. 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:

  1. Create atomic notes (one idea per note)
  2. Link notes extensively
  3. Use tags for broad categorization
  4. Build emergence through connections

Topic Hierarchies

Organize by topic:

/topics/
├── Programming/
│ ├── Python/
│ └── JavaScript/
├── Research/
│ └── Machine Learning/
└── Personal/
└── Projects/

Daily Notes

Capture daily thoughts:

  1. Create daily note pages
  2. Link to relevant topics
  3. Review and consolidate weekly

Search and Discovery

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:

  1. Go to Settings > Export
  2. Choose format (Markdown, JSON)
  3. Download the archive

Backup Strategy

Protect your knowledge:

  1. Regular database backups
  2. Export Markdown periodically
  3. 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

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.