Documentation navigation

Install MarkRelay

Three steps, about ten minutes: deploy MarkRelay to your Cloudflare account, activate your license, and create the administrator.

How to Deploy Self-Hosted Email to Cloudflare | MarkRelay Guide #1

Before you start

  • An active MarkRelay license, shown on your Licenses page.
  • A Cloudflare account. MarkRelay runs there, as a Worker you own.
  • To send email, the Workers Paid plan. MarkRelay sends through Cloudflare Email Sending, which Cloudflare includes in Workers Paid. Receiving works on any plan.
  • A GitHub or GitLab account. Cloudflare keeps a copy of the MarkRelay release there for your deployment.

Step 1: Deploy to Cloudflare

  1. On your Licenses page, select Deploy to Cloudflare on your license.
    Example
    Deploy to Cloudflare
    On each active license, on your Licenses page.
  2. Sign in to Cloudflare and connect your GitHub or GitLab account when asked.
  3. On the setup page, keep the suggested names, or change them if you like. Cloudflare creates the database, storage, and queues with them.
  4. Fill in BETTER_AUTH_SECRET (see below), then select Create and deploy.
  5. When the deploy finishes, open the Worker's address, such as https://markrelay-mail-app.<your-subdomain>.workers.dev. You can always find it on the Worker's page in Cloudflare.

About BETTER_AUTH_SECRET

It is a long random value that signs your users' sign-in sessions. Keep a private copy: anyone who has it could forge sessions, and changing it later signs everyone out. Generate one here, in your browser (nothing is sent to MarkRelay):

Or in a terminal: openssl rand -base64 32

Step 2: Activate your license

  1. On your Licenses page, select Generate activation code on your license. The code works once and is valid for 15 minutes.
    Example
    Generate activation code
    On each active license, on your Licenses page.
  2. Open your Worker's address. You see Activate your license.
  3. Enter the license ID and the activation code, then select Activate license.
  4. Your license appears. Select Continue.

Step 3: Create the administrator

  1. Enter your name, email address, and a password.
  2. Select Create admin account. You are signed in as the administrator.

Do this right after activating: the first account becomes the administrator, and setup then closes. Everyone else joins by invitation.

Update

Updating is one click. Once, add a deploy hook to your Worker in Cloudflare (Settings → Builds → Deploy Hooks) and paste its URL into Mail under Manage → Settings → Updates. After that, select Update there whenever a new version is available. The latest MarkRelay release is installed in about a minute, and your data stays as it is. See Updates & changelog for the details.

If something goes wrong

ProblemWhat to do
The activation code is rejectedCodes work once and expire after 15 minutes. Generate a new one.
“This license has expired”Renew it on your Licenses page, then activate again.
An administrator forgot their passwordOn the sign-in page, select Forgot password?. Verify the license with its ID and a new activation code from your Licenses page, then enter the administrator's email and a new password. Members ask an administrator, who sets a new password under Manage → Members.

Next

Set up your first domain: connect it in Cloudflare, create a mailbox, and test it.