How to install Mongo Express in your guebs hosting plan

If you have reached this guide through a search engine, please note that this guide is intended for accommodation services nodejs from The general concepts remain valid for any application, but the specific steps apply to the service.

This guide, developed around August 2017, is intended for version 0.42.1 of Mongo Express, which is a MongoDB collection management tool.

First we must create a subdomain to host the application. This subdomain will be called «mexpress» throughout this guide. Therefore, the subdomain will be called

How to access your Hosting Panel

Once you have created your domain, you must create the nodejs application from the hosting it also mexpress .

How to deploy a NodeJs application

Today it is possible to use the latest LTS version of this software to launch this application, so you can use version 6 of this software. Now you just need to log in via ssh to your hosting plan to launch the application.

How to access your hosting via SSH

Now you must enter the nodejs/mexpress directory and clone the application:

cd ~/nodejs/ ; rm -rf mexpress ; git clone mexpress ; cd mexpress

Now npm will install the necessary modules:

<br />
npm install<br />

With this, we’ll have everything we need installed. Now we have to prepare the static files and the connection configuration.

  • In order for the system to find the static resources that come as standard in the Mongo Express distribution, in such a way that the situation is adapted to the public/ directory from which they will be served, we must execute this command:

<br />
cp -a build public/public<br />

  • To configure the connection to the database, we will use the method through a connection url. First copy the default configuration file and then edit the configuration file:

<br />
cp -a config.default.js config.js<br />

We are looking for the following line

<br />
connectionString: process.env.ME_CONFIG_MONGODB_SERVER ? &#187; : process.env.ME_CONFIG_MONGODB_URL,<br />

and leave it as follows:

<br />
connectionString: &#8216;mongodb://;,<br />

Where in the place of user and password you will have to put the data corresponding to a real MongoDB user that you have created previously from the Hosting Panel.

Once we call the subdomain, we will find the application connected to our database. By default there is an additional authentication with the user name ‘admin’ and the password ‘pass’, which you can modify by editing the following lines of the config.js file

<br />
basicAuth: {<br />
 username: process.env.ME_CONFIG_BASICAUTH_USERNAME || &#8216;admin&#8217;,<br />
 password: process.env.ME_CONFIG_BASICAUTH_PASSWORD || &#8216;pass&#8217;,<br />
 },<br />

Following these steps, the application will be available:

Translated with