---
title: How to Enable Mailu API
description: "Ensure that you have [installed the *master* branch](https://mailu.io/master/setup.html) of Mailu, then do the following: 1. SSH to your server as root and proceed to the mailu directory. By default it is *mailu* `cd /mailu` 2. Shutdown the Mailu docker instance…"
url: "https://wpemailmanager.com/docs/how-to-enable-mailu-api/"
updated: "2023-01-24"
category: Email Servers / Mailu
---

# How to Enable Mailu API

Ensure that you have [installed the *master* branch](https://mailu.io/master/setup.html) of Mailu, then do the following:

1. SSH to your server as root and proceed to the mailu directory. By default it is *mailu*
   `cd /mailu`
2. Shutdown the Mailu docker instance if it is running by running the command:
   `docker-compose -p mailu down`
3. Edit the *mailu.env* file using your editor of choice. For this case, we will use *nano*
   `nano mailu.env`
4. Add the following constants if they are not present:
   `API=trueWEB_API=/apiAPI_TOKEN:your_api_token`
   Replace *your_api_token*, with a hard to guess api token. You can generate one [here](https://generate-random.org/api-token-generator?count=1&length=64&type=mixed-numbers-symbols&prefix=). This api token will be used when configuring the plugin's [general settings](https://wpemailmanager.com/documentation/settings/general-settings/).

   The end should result should be similar to one below.
   ![](https://wpemailmanager.com/wp-content/uploads/2023/01/mailu-env-api-constants.jpg)
   Save the changes made.
5. Restart the Mailu docker instance by running the following command:
   docker-compose -p mailu up -d
6. Ensure that the API is running by going to *https://yourserver.com/api/v1*. You should see a result similar to one below.
   ![](https://wpemailmanager.com/wp-content/uploads/2023/01/mailu-swagger-documentation.jpg)
