Documentation menu

Installing the server

A specific version, offline and scripted installs

The installer script understands a few environment variables, and memex install accepts flags that replace every question. Together they cover installing a chosen version, installing on a machine without internet access, and installing from a script.

Variables of the installer script

VariableEffect
MEMEX_VERSIONInstall this version (for example 0.3.1) instead of the latest release.
MEMEX_BINARYInstall this local file instead of downloading.
MEMEX_DOWNLOAD_URLBase URL holding memex-<version>-<arch>-unknown-linux-musl.tar.gz and its .sha256 (a mirror).
MEMEX_PREFIXInstall into $MEMEX_PREFIX/bin instead of /usr/local/bin (no root needed).
MEMEX_NO_RUN1: install the binary and stop, without starting the assistant.

Install a specific version

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

The variable goes in front of sh, which is the program that reads it. Running the script on a machine where Memex is already installed replaces the binary in place and keeps data and configuration; the normal way to update remains memex update.

Install without internet access

  1. On a connected machine, download from the releases page the archive for the target processor, memex-<version>-x86_64-unknown-linux-musl.tar.gz or …-aarch64-…, and install.sh.
  2. Copy both to the target machine and unpack the archive: tar -xzf memex-<version>-x86_64-unknown-linux-musl.tar.gz.
  3. Run the script with the path of the unpacked memex file:
MEMEX_BINARY=/path/to/memex sh install.sh

With MEMEX_BINARY nothing is downloaded and no checksum is compared, so verify the archive yourself first, against its .sha256 or its minisign signature (the public key is in the release documentation of the repository).

  • In domain mode with built-in HTTPS, certificates still need the machine to reach Let’s Encrypt; on an isolated network use IP mode or a proxy with your own certificate.
  • Semantic search needs its model: install it from a file with sudo memex model install --from <archive>. See Semantic search.
  • Set the update mode to manual on a machine that cannot reach GitHub.

Scripted installation

Passing --mode makes memex install non-interactive; --yes skips the confirmation. Without a terminal, nothing is asked at all: commands need their flags.

curl -fsSL https://raw.githubusercontent.com/mlafraise/memex/main/install.sh | MEMEX_NO_RUN=1 sh
sudo memex install --mode domain --domain brain.example.com --yes
FlagMeaning
--mode ip|domain|tunnel-quick|tunnel-namedAccess mode.
--domain <name>Domain (domain mode) or public hostname (permanent tunnel).
--port <n>Port of the Memex server (default 8787).
--email <address>Contact for the certificate authority (optional).
--proxy auto|nginx|apache|noneReverse proxy in domain mode (default auto).
--https auto|on|offHTTPS in domain mode (default auto).
--tunnel-token <token>Token of a permanent tunnel; also read from MEMEX_TUNNEL_TOKEN.
--public-url <url>Address to announce in IP mode (default: the detected address).
--data-dir <dir>Data directory (default /var/lib/memex).
--config <file>Configuration file (default /etc/memex/config.toml; global flag).
--no-systemdDo not install a service; print the command that starts the server.
--no-startInstall and enable the service without starting it.
--lang en|frLanguage of the messages (global flag).
--yesDo not ask for confirmation; existing files that differ are backed up and replaced.

To turn semantic search on from the start, run sudo memex model install once the instance is installed.

Check that it worked

memex version
sudo memex status

memex version prints the installed version, which should be the one you asked for.