Documentation menu

Installing the server

Through a Cloudflare tunnel

A tunnel makes Memex reachable from the internet without opening any port and without a public IP address: Memex starts cloudflared, which connects out to Cloudflare, and people reach the instance through Cloudflare over HTTPS. The installer offers two kinds, quick and permanent.

Quick or permanent

Quick tunnelPermanent tunnel
Installer wordingQuick: no account needed, but the address changes at every restartPermanent: stable address on your own domain (needs a free Cloudflare account)
--modetunnel-quicktunnel-named
AddressA random https://<words>.trycloudflare.comA hostname on your domain
AccountNoneA free Cloudflare account with the domain on it
Good forTrying MemexLasting use

This is the only mode in which cloudflared is downloaded: the official release binary, to /usr/local/bin/cloudflared, unless it is already installed.

Quick tunnel

Choose "Through a tunnel", then the quick kind, or run:

sudo memex install --mode tunnel-quick --yes
  • The address changes every time Memex restarts (reboot, update, crash). Links you shared stop working, and AI assistants connected over MCP must be reconnected with the new address.
  • memex status always shows the current address. If the summary says the address is not known yet, run it again a moment later.
  • Quick tunnels have no uptime guarantee.
  • Prefer the notify or manual update mode with a quick tunnel, since an automatic update restarts the server and so changes the address.

Permanent tunnel

  1. Create the tunnel in CloudflareIn the Cloudflare dashboard, under Zero Trust → Networks → Tunnels, create a tunnel and copy its token.
  2. Add a public hostnameIn the same tunnel, add a public hostname (for example brain.example.com) pointing to the service http://localhost:8787.
  3. Run the installerChoose "Through a tunnel", then the permanent kind. The assistant asks for the tunnel token (typed masked) and the public hostname.
  4. Confirm the planThe token is stored in /etc/memex/config.toml (mode 0640) and handed to cloudflared through its environment, never on a command line.

The same without questions; the token can also come from the MEMEX_TUNNEL_TOKEN environment variable:

sudo memex install --mode tunnel-named --domain brain.example.com --tunnel-token "$TOKEN" --yes

Check that it worked

sudo memex status

The status shows the public address. Open it in a browser from another network, for example from a phone on mobile data. If a permanent tunnel answers with a Cloudflare error, check in the dashboard that the public hostname points to the service http://localhost:8787 (or the port you chose).

With a tunnel, the traffic passes through Cloudflare, which terminates HTTPS. Backups contain the tunnel token: treat them as secrets.