Skip to main content
This page takes you from nothing to a running mailbox. You need a domain you control, a Resend account, a Firebase project and a place to run Node.js 18 or newer, such as Render.

1. Firebase

  1. Create a Firebase project and add a Firestore database.
  2. Go to Authentication, then Sign-in method, and enable Google.
  3. Go to Authentication, then Settings, then Authorized domains, and add the domain you will serve the app from (for example mail.example.com) and your *.onrender.com host if you use Render.
  4. Lock the database so that only the server can use it. Under Firestore, then Rules, paste:
  1. Create a service-account key: Project settings, then Service accounts, then Node.js, then Generate new private key. You will paste this JSON into FIREBASE_SERVICE_ACCOUNT.
  2. Copy the web-app config: Project settings, then Your apps, then Web. You will paste it into FIREBASE_WEB_CONFIG.
The service-account JSON gives full access to your database. Keep it in your host’s environment variables and never commit it.

2. Resend

  1. Add and verify your domain in Resend, and enable receiving mail for it.
  2. Create an API key with send and receive access. This is RESEND_API_KEY.
  3. After the server is deployed (step 4), add a webhook that points to https://<your-domain>/api/incoming for the email.received event.
  4. Copy the webhook’s signing secret into RESEND_WEBHOOK_SECRET.

3. Push keys

Generate a pair of VAPID keys once, on any computer:
The public key is VAPID_PUBLIC_KEY and the private key is VAPID_PRIVATE_KEY. Keep the private key secret. Without these keys mail still arrives, only the notification is skipped.

4. Deploy

On Render, create a Web Service from your fork of the repository: Add these environment variables:
Older deployments that use PERSONAL_GMAIL keep working, because it is used when MAILBOX_OWNER_EMAIL is not set. Rename it when convenient.

5. Check that it works

  1. Open your server’s URL and sign in with the account in MAILBOX_OWNER_EMAIL.
  2. Tap Allow notifications. A test notification is sent to confirm.
  3. Send an email to one of your addresses. It should appear in the inbox and trigger a notification.

Running locally

Copy .env.example to .env, fill it in, and start the server. Node.js 20.6 or newer can read the file directly:
On older versions, export the variables in your shell and run npm start.

Copyright © 2025–2026 Amit Dutta