Host Memex yourself

Memex is a single program, memex: one Rust binary that contains the server, the web app, the MCP endpoint, the OAuth authorisation server and the sync engine, with an embedded SQLite database. Installing it on a Linux server takes one command, and your notes stay plain Markdown files in a directory on that server.

Install

On a Linux server (x86_64 or arm64). Debian and Ubuntu are supported first; any Linux with systemd should work.

curl -fsSL https://raw.githubusercontent.com/mlafraise/memex/main/install.sh | sh

The script downloads the binary for your machine, checks its SHA-256, installs it and starts an interactive assistant in your terminal. The assistant asks a few questions, shows exactly what it is going to do, and does it. It uses sudo when it is not run as root.

At the end it prints the address of your instance, a one-time admin key and a setup link. Open the link to create the administrator account. Everything else (brains, users, invitations, AI clients, notifications, updates) is configured in the app.

Piping a script into a shell means trusting it. You can read install.sh first, and verify a release archive by hand with minisign before the first install; the installation guide explains how.

Step-by-step guides: quick install, your own domain with HTTPS, Cloudflare tunnel, local network, behind an existing reverse proxy, a specific version or an offline install, uninstalling.

Choose how the instance is reached

The first question of the assistant is how people will reach the instance.

ModeWhat it does
IP address and portPlain HTTP on a port (8787 by default). Fine on a home or office network or behind a VPN. Nothing is encrypted, so do not use it across the internet.
Domain nameDetects nginx or Apache and writes a reverse-proxy site, with certbot if it is installed. With neither, Memex serves HTTPS itself with automatic Let’s Encrypt certificates.
TunnelNo open port. A quick Cloudflare tunnel needs no account, but its address changes at every restart. A permanent tunnel gives a stable address on your own domain.

Memex never installs or reconfigures nginx, Apache or certbot themselves; it only adds its own site, checks the web server’s configuration before and after, and removes the site again if the web server rejects it.

For AI assistants, prefer a domain or a permanent tunnel. With a quick tunnel the address changes whenever the server restarts, and every assistant connected over MCP must be reconnected with the new address.

The three modes are compared in Access modes.

The three access modes: what sits between the people and the memex process.Three rows. IP address and port: machines of the local network reach memex directly in plain HTTP on port 8787. Domain name: the internet reaches nginx or Apache over HTTPS on ports 80 and 443, which forwards to memex on 127.0.0.1:8787; when neither is installed, Memex serves HTTPS itself. Tunnel: the internet reaches Cloudflare, which terminates HTTPS; cloudflared, started by Memex, holds an outbound connection to Cloudflare and forwards to memex locally, so no port is open.plain HTTP, port 8787HTTPSHTTP, localoutbound connectionLocal networkbrowser, local AI clientsmemex0.0.0.0:8787Internetpeople, AI assistantsnginx or Apacheports 80/443, certificatememex127.0.0.1:8787Internetpeople, AI assistantsCloudflareterminates HTTPScloudflaredstarted by Memexmemex127.0.0.1:8787IP address and portDomain nameTunnel
The three access modes: what sits between the people and the memex process.

Scripted installation

Passing --mode makes the installation non-interactive; --yes skips the confirmation.

# IP and port
sudo memex install --mode ip --port 8787 --yes

# Domain, proxy detected automatically, HTTPS when it can be automated
sudo memex install --mode domain --domain brain.example.com --yes

# Quick tunnel
sudo memex install --mode tunnel-quick --yes

With --no-systemd, no service is installed and the command that starts the server is printed instead, which suits containers.

What is installed where

PathContent
/var/lib/memex/Data directory: memex.db (users, rights, index, change log), brains/ (your notes, as plain files), history/ (one git repository per brain), index/ (search index, rebuildable), backups/.
/var/lib/memex/bin/memexThe program, with a symlink at /usr/local/bin/memex.
/etc/memex/config.tomlStart-up configuration.
/etc/systemd/system/memex.serviceThe service. It runs as a dedicated memex user, sandboxed, with only the data directory writable.

Operating the server

Running memex alone opens the same assistant full screen, with every action as a box to select. Each action is also a command, for scripts:

sudo memex status
sudo memex backup
sudo memex update
sudo memex config set public_url https://brain.example.com

Backups

memex backup writes a single .tar.gz containing a consistent snapshot of the database, every brain as plain Markdown files, the version history and the configuration file. It can run while the server is running. Copy backups to another machine, and treat them as secrets: they contain your notes. Details: backups.

Updates

Memex updates itself by replacing its own binary. By default it checks for new versions and tells administrators; you decide when to install, from the app or with memex update. Every update is verified with a minisign signature against a public key compiled into the running binary, and a backup is taken first. Details: updates.

Semantic search

Semantic search is off by default because its embedding model is a separate download of about 480 MB. An administrator enables it from the administration pages of the app, or on the server:

sudo memex model install
memex model status

The model is verified, then every brain is indexed in the background. Keyword search keeps working in the meantime. A machine without internet access can install the model from a file with --from. Details: semantic search.

One guide per task: the memex command, configuration, updates, backup and restore, notifications, semantic search, recovering administrator access and troubleshooting.

Desktop and mobile apps

The Memex apps keep the brains you can see as ordinary folders of Markdown files on your device, in step with the server, online or not. The desktop app targets Linux, macOS and Windows; the mobile app targets Android and iOS. Their code is in the repository and their builds are attached to the GitHub releases as they are published. Details: desktop and mobile apps.

Because a synced brain is a plain folder, you can open it in Obsidian or any other editor. Edits made there are picked up and synced like any others.

More: desktop app, mobile apps, how sync works.

Build from source

Requirements: stable Rust with the wasm32-unknown-unknown target, and wasm-bindgen-cli.

cargo install wasm-bindgen-cli --version 0.2.130 --locked
cargo xtask ui --release        # build the web UI
cargo build --release -p memex-cli
./target/release/memex serve    # reads /etc/memex/config.toml, or --config <file>

CONTRIBUTING.md shows how to run a throwaway local instance.

Licence

Memex is source-available under the Functional Source License, Version 1.1, ALv2 Future License (FSL-1.1-ALv2). It is not an open source licence. In short:

  • You may use, modify and self-host Memex freely, including inside a company and for commercial work.
  • You may not offer it to others as a product or service that competes with Memex.
  • Each version becomes Apache 2.0 two years after its release.

The licence text is what applies; this summary is only a guide.