---
title: Run in production
project: OpenMail
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/openmail/1-0/guides/production/
updated: 2026-11-19T07:58:05.739Z
---

# Run in production

> Start OpenMail in release mode and protect it on a public server.

`npm start` runs OpenMail in debug mode, which is meant for development. On a server, start it in release mode.

## Start in release mode

```bash
node index.js 8000 --release
```

To keep it running after you log out and after a restart of the server, start it with a process manager or a system service, for example systemd.

## Protect the server

- Set a [primary access token](../first-start/) before the server is reachable from the internet.
- OpenMail listens on all network interfaces. Put it behind a reverse proxy such as Nginx with HTTPS, and let only the proxy reach the port of OpenMail. Tokens travel in every request, so never use plain HTTP over the internet.
- If only your own servers send email, allow only their addresses at the firewall or in the proxy.
- Give every app its own [API token](../api-tokens/).
- Back up the `databases` folder. See [Back up your data](../backups/).

## Image links

Open the admin interface at its public HTTPS address when you upload images, so the image links in your emails use that address. See [Template markup](../template-markup/).
