Install
Install on your computer
Outcome: Mailnib running at http://localhost:3000 on your own machine, so you can explore it before putting it on a server.
This path builds the app from the source/ folder of your download. It works on macOS, Windows and Linux. (The runtime/ folder is prebuilt for Linux servers and is not used here.)
1. Install the tools
Node.js 20 or newer from nodejs.org. Choose the LTS version. Check it in a terminal:
node --versionYou should see
v20or higher.pnpm, the package manager this project uses. Node ships a helper that installs the right version:
corepack enablePostgreSQL 14 or newer. On a Mac, Postgres.app is the easiest. On Windows, use the installer from postgresql.org. On Linux, use your distribution's package.
2. Create a database
Open a PostgreSQL shell (psql) and run:
CREATE DATABASE mail_builder;
Your connection string is then, with your own user and password:
postgresql://postgres:YOUR-PASSWORD@localhost:5432/mail_builder
3. Install and build
Unzip your download, then open a terminal in its source folder, the one that contains package.json and pnpm-lock.yaml. Set the database address, and a folder for uploads, for this terminal session:
On macOS or Linux:
export DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@localhost:5432/mail_builder
export STORAGE_ROOT="$PWD/storage"
export APP_KEY="base64:$(openssl rand -base64 32)"
export PUBLIC_APP_URL=http://localhost:3000
On Windows PowerShell:
$env:DATABASE_URL = "postgresql://postgres:YOUR-PASSWORD@localhost:5432/mail_builder"
$env:STORAGE_ROOT = "$PWD\storage"
$bytes = New-Object byte[] 32
[Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
$env:APP_KEY = "base64:" + [Convert]::ToBase64String($bytes)
$env:PUBLIC_APP_URL = "http://localhost:3000"
APP_KEY encrypts the secrets you save in the console, and it exists only in this terminal session. To come back to the same installation later, set the same value again, so write it down (echo $APP_KEY, or $env:APP_KEY in PowerShell).
Then run these one at a time:
pnpm install --frozen-lockfile
pnpm db:migrate
pnpm build
pnpm install may print a box saying some build scripts were ignored; that is expected and needs no action. db:migrate ends with a line such as Complete: 30 applied, 0 already current. The build takes a few minutes.
4. Start it
node apps/web/.next/standalone/apps/web/server.js
Leave this terminal open; the app runs for as long as it does. Set PORT first if 3000 is taken.
Open http://localhost:3000/api/health. You should see {"ok":true,"db":"connected","migrations":"up to date"}.
5. Create your operator account
You have two choices.
The web installer. The terminal printed a block that starts with Mailnib is not installed yet. Copy the setup token under it, open http://localhost:3000/install, and follow The web installer. The installer asks for an https:// public address; on your own machine you can enter any placeholder such as https://mail.example.com and change it later.
The command line. Stop the app with Ctrl+C, then run:
pnpm db:seed
It installs the four plans and creates an operator called operator@example.com, printing a random password once. Save it. To choose your own, set OPERATOR_EMAIL and OPERATOR_PASSWORD (at least 12 characters) before running the command. Start the app again and sign in at http://localhost:3000/admin/login.
Want sample content?
Follow Demo mode to load a furnished customer workspace with ten designs. Use a separate database for it.