Deploy your Bitnami MEAN Stack on Bitnami Cloud Hosting now! Launch Now

MEAN for Bitnami Cloud Hosting

Description

MEAN Stack, short for MongoDB, Express, Angular, and Node.js, is a free and open source JavaScript stack for building modern, dynamic websites and web applications.

First steps with the Bitnami MEAN Stack

Welcome to your new Bitnami application running on Bitnami Cloud Hosting! Here are a few questions (and answers!) you might need when first starting with your application.

What credentials do I need?

You need two sets of credentials:

  • The application password that allows you to log in to your new Bitnami application.
  • The server credentials that allow you to log in to your Bitnami Cloud Hosting server using an SSH client and execute commands on the server using the command line. These credentials consist of an SSH username and key.

What SSH username should I use for secure shell access to my application?

SSH username: bitnami

How to start or stop the services?

Each Bitnami stack includes a control script that lets you easily stop, start and restart services. The script is located at /opt/bitnami/ctlscript.sh. Call it without any service name arguments to start all services:

$ sudo /opt/bitnami/ctlscript.sh start

Or use it to restart a single service, such as Apache only, by passing the service name as argument:

$ sudo /opt/bitnami/ctlscript.sh restart apache

Use this script to stop all services:

$ sudo /opt/bitnami/ctlscript.sh stop

Restart the services by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh restart

Obtain a list of available services and operations by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh

What are the default ports?

A port is an endpoint of communication in an operating system that identifies a specific process or a type of service. Bitnami stacks include several services or servers that require a port.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Port 22 is the default port for SSH connections.

Bitnami opens some ports for the main servers. These are the ports opened by default: 80, 443.

Which components are installed with the Bitnami MEAN Stack?

The Bitnami MEAN Stack ships the components listed below. If you want to know which specific version of each component is bundled in the stack you are downloading, check the README.txt file in the download page or in the stack installation directory. You can also find more information about each component using the links below.

Main components

How can I get started with MEAN?

To get started, we suggest the following steps:

Step 1: Create a new MEAN project

To create a new MEAN project, create a new folder for your project in the /home/bitnami directory and then create a new Express project:

  $ cd /home/bitnami
  $ mkdir projects
  $ cd projects
  $ express sample
  $ cd sample
  $ npm install

To start the application, use this command:

  $ ./bin/www

By default, the application will run on port 3000.

To access the application and see its output, browse to http://SERVER-IP:3000/. To end the application, terminate the running Express process.

NOTE: Access to the server on port 3000 may be blocked for security reasons. In this case, you must first create an SSH tunnel between your local system and the server before you can access the application using these instructions.

For more information, refer to these instructions.

Step 2: Add MongoDB and AngularJS to your MEAN application

You can connect your application with MongoDB using MongooseJS, an object modelling driver for Node.js. It is already installed in the MEAN stack so you only have to add the following lines to your app.js file:

var Mongoose = require('mongoose');
var db = Mongoose.createConnection('mongodb://USER:PASSWORD@localhost/DATABASE');

You can use install AngularJS in your application with Bower. Create a file named .bowerrc in your application with the following content:

{ "directory" : "public/javascripts/vendor" }

Then, run this command in the project directory:

$ bower install angular

For more information, refer to these instructions.

Step 3: Access RockMongo

RockMongo is an application intended to handle the administration of MongoDB over the Web. For security reasons, this application is not accessible via web by default. Find out how to access it here.

How to access a MEAN server application?

For security reasons, MEAN server applications are accessible only when using 127.0.0.1 as the hostname. To access the application, it is necessary to create an SSH tunnel by forwarding port 3000 on the MEAN server to port 3000 on the local host.

Refer to the FAQ for platform-specific instructions to create the SSH tunnel. An example of configuring the SSH tunnel using PuTTY on Windows is displayed below.

PuTTY tunnel config

How to upload files to the server with SFTP?

NOTE: Bitnami applications can be found in /opt/bitnami/apps.

First, obtain your SSH credentials by following these steps:

  • Browse to the Bitnami Cloud Hosting dashboard and sign in if required using your Bitnami account.

  • Select the "Servers" menu item.

  • Select your cloud server from the resulting list.

  • Click the "Manage" button.

  • On the resulting page, note the server IP address.

    SSH credentials

  • Click the "Connect" button and download the SSH key for your server in .ppk format (for FileZilla or WinSCP) or in .pem format (for Cyberduck).

    SSH credentials

Although you can use any SFTP/SCP client to transfer files to your server, this guide documents FileZilla (Windows, Linux and Mac OS X), WinSCP (Windows) and Cyberduck (Mac OS X).

Using an SSH Key

Once you have your server's SSH key, choose your preferred application and follow the steps below to connect to the server using SFTP.

FileZilla
IMPORTANT: To use FileZilla, your server private key should be in PPK format.

Follow these steps:

  • Download and install FileZilla.
  • Launch FileZilla and use the "Edit -> Settings" command to bring up FileZilla's configuration settings.
  • Within the "Connection -> SFTP" section, use the "Add keyfile" command to select the private key file for the server. FileZilla will use this private key to log in to the server.

    FileZilla configuration

  • Use the "File -> Site Manager -> New Site" command to bring up the FileZilla Site Manager, where you can set up a connection to your server.
  • Enter your server host name and specify bitnami as the user name.
  • Select "SFTP" as the protocol and "Ask for password" as the logon type.

    FileZilla configuration

  • Use the "Connect" button to connect to the server and begin an SFTP session. You might need to accept the server key, by clicking "Yes" or "OK" to proceed.

You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window.

If you have problems accessing your server, get extra information by use the "Edit -> Settings -> Debug" menu to activate FileZilla's debug log.

FileZilla debug log

WinSCP
IMPORTANT: To use WinSCP, your server private key should be in PPK format.

Follow these steps:

  • Download and install WinSCP.
  • Launch WinSCP and in the "Session" panel, select "SCP" as the file protocol.
  • Enter your server host name and specify bitnami as the user name.

    WinSCP configuration

  • Click the "Advanced…" button and within the "SSH -> Authentication -> Authentication parameters" section, select the private key file for the server. WinSCP will use this private key to log in to the server.

    WinSCP configuration

  • From the "Session" panel, use the "Login" button to connect to the server and begin an SCP session.

You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window.

If you need to upload files to a location where the bitnami user doesn't have write permissions, you have two options:

  • Once you have configured WinSCP as described above, click the "Advanced…" button and within the "Environment -> Shell" panel, select sudo su - as your shell. This will allow you to upload files using the administrator account.

    WinSCP configuration

  • Upload the files to the /home/bitnami directory as usual. Then, connect via SSH and move the files to the desired location with the sudo command, as shown below:

     $ sudo mv /home/bitnami/uploaded-file /path/to/desired/location/
    
Cyberduck
IMPORTANT: To use Cyberduck, your server private key should be in PEM format.

Follow these steps:

  • Select the "Open Connection" command and specify "SFTP" as the connection protocol.

    Cyberduck configuration

  • In the connection details panel, under the "More Options" section, enable the "Use Public Key Authentication" option and specify the path to the private key file for the server.

    Cyberduck configuration

  • Use the "Connect" button to connect to the server and begin an SFTP session.

You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window.

How to find the MongoDB database credentials?

How to connect to the MongoDB database?

You can connect to the MongoDB database from the same computer where it is installed. Run the mongo client authenticating as the root user against the admin database:

$ mongo admin --username root -p

You will be prompted to enter the root user password. This is the same as the application password.

How to connect to MEAN from a different machine?

For security reasons, the MEAN ports in this solution cannot be accessed over a public IP address. To connect to MEAN from a different machine, you must open port 80, 443 for remote access. Refer to the FAQ for more information on this.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

How to access RockMongo?

For security reasons, RockMongo is accessible only when using 127.0.0.1 as the hostname. To access it from a remote system, you must create an SSH tunnel that routes requests to the Apache Web server from 127.0.0.1. This implies that you must be able to connect to your server over SSH in order to access these applications remotely.

IMPORTANT: Before following the steps below, ensure that your Apache and MongoDB servers are running.
NOTE: The steps below suggest using port 8888 for the SSH tunnel. If this port is already in use by another application on your local machine, replace it with any other port number greater than 1024 and modify the steps below accordingly. Similarly, if you have enabled Varnish, your stack's Apache Web server might be running on port 81. In this case, modify the steps below to use port 81 instead of port 80 for the tunnel endpoint.

Accessing RockMongo on Windows

In order to access RockMongo via SSH tunnel you need an SSH client. In the instructions below we have selected PuTTY, a free SSH client for Windows and UNIX platforms. The first step is having PuTTY configured. Please, check how to configure it in the section how to connect to the server through SSH using an SSH client on Windows.

Once you have your SSH client correctly configured and you tested that you can successfully access to your instance via SSH, you need to create an SSH tunnel in order to access RockMongo. For doing so, follow these steps:

  • In the "Connection -> SSH -> Tunnels" section, add a new forwarded port by introducing the following values:

    • Source port: 8888
    • Destination: localhost:80

    This will create a secure tunnel by forwarding a port (the "destination port") on the remote server to a port (the "source port") on the local host (127.0.0.1 or localhost).

  • Click the "Add" button to add the secure tunnel configuration to the session. (You'll see the added port in the list of "Forwarded ports").

    PuTTY configuration

  • In the "Session" section, save your changes by clicking the "Save" button.
  • Click the "Open" button to open an SSH session to the server. The SSH session will now include a secure SSH tunnel between the two specified ports.
  • Access the RockMongo console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/rockmongo.
  • Log in to RockMongo by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

RockMongo

If you are unable to access RockMongo, verify that the SSH tunnel was created by checking the PuTTY event log (accessible via the "Event Log" menu):

PuTTY configuration

Accessing RockMongo on Linux and Mac OS X

To access the application using your Web browser, create an SSH tunnel, as described below.

  • Open a new terminal window on your local system (for example, using "Finder -> Applications -> Utilities -> Terminal" in Mac OS X or the Dash in Ubuntu).
  • Make sure that you have your SSH credentials (.pem key file) in hand.
  • Run the following command to configure the SSH tunnel. Remember to replace KEYFILE with the path to your private key and SERVER-IP with the public IP address or hostname of your server:

    $ ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@SERVER-IP
    
NOTE: If successful, the above command will create an SSH tunnel but will not display any output on the server console.
  • Access the RockMongo console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/rockmongo.
  • Log in to RockMongo by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

RockMongo

How to change the MongoDB root password?

You can modify the MongoDB password using the following command at the shell prompt:

$ mongo admin --username root --password YOURPASSWORD
MongoDB shell version: 2.4.8
connecting to: 127.0.0.1:27017/admin
> db = db.getSiblingDB('admin')
admin
> db.changeUserPassword("root", "NEWPASSWORD")
> exit
NOTE: Remember that both YOURPASSWORD and NEWPASSWORD are placeholders. Replace them with your current password and with the new password you want to set.

How to reset the MongoDB root password?

You can reset the administrator password by following the steps below:

  • Edit the /opt/bitnami/mongodb/mongodb.conf file and replace the following lines:

     # Turn on/off security.  Off is currently the default
     #noauth = true
     auth = true
    
     # Disable the HTTP interface (Defaults to localhost:27018).
     #nohttpinterface = true
     setParameter = enableLocalhostAuthBypass=0
    

    with:

     # Turn on/off security.  Off is currently the default
     noauth = true
     #auth = true
    
     # Disable the HTTP interface (Defaults to localhost:27018).
     #nohttpinterface = true
     #setParameter = enableLocalhostAuthBypass=0
    
  • Restart the MongoDB server:

     $ cd /opt/bitnami
     $ sudo /opt/bitnami/ctlscript.sh restart mongodb
    
  • Create a new administrative user with a new password. Run the following commands to do so (remember to replace NEWPASSWORD with the new one you want to set):

     $ mongo
     > db = db.getSiblingDB('admin')
     admin
     > db.changeUserPassword("root", "NEWPASSWORD")
    
  • Revert the modifications made to /opt/bitnami/mongodb/mongodb.conf by replacing:

     # Turn on/off security.  Off is currently the default
     noauth = true
     #auth = true
    
     # Disable the HTTP interface (Defaults to localhost:27018).
     #nohttpinterface = true
     #setParameter = enableLocalhostAuthBypass=0
    

    with:

     # Turn on/off security. Off is currently the default
     #noauth = true
     auth = true
    
     # Disable the HTTP interface (Defaults to localhost:27018).
     #nohttpinterface = true
     setParameter = enableLocalhostAuthBypass=0
    
  • Restart the MongoDB server again:

     $ cd /opt/bitnami
     $ sudo /opt/bitnami/ctlscript.sh restart mongodb
    

How to create an SSL certificate?

OpenSSL is required to create an SSL certificate. A certificate request can then be sent to a certificate authority (CA) to get it signed into a certificate, or if you have your own certificate authority, you may sign it yourself, or you can use a self-signed certificate (because you just want a test certificate or because you are setting up your own CA).

Follow the steps below:

  • Generate a new private key:

     $ sudo openssl genrsa -out /opt/bitnami/apache2/conf/server.key 2048
    
  • Create a certificate:

     $ sudo openssl req -new -key /opt/bitnami/apache2/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr
    
    IMPORTANT: Enter the server domain name when the above command asks for the "Common Name".
  • Send cert.csr to the certificate authority. When the certificate authority completes their checks (and probably received payment from you), they will hand over your new certificate to you.

  • Until the certificate is received, create a temporary self-signed certificate:

     $ sudo openssl x509 -in /opt/bitnami/apache2/conf/cert.csr -out /opt/bitnami/apache2/conf/server.crt -req -signkey /opt/bitnami/apache2/conf/server.key -days 365
    
  • Back up your private key in a safe location after generating a password-protected version as follows:

     $ sudo openssl rsa -des3 -in /opt/bitnami/apache2/conf/server.key -out privkey.pem
    

    Note that if you use this encrypted key in the Apache configuration file, it will be necessary to enter the password manually every time Apache starts. Regenerate the key without password protection from this file as follows:

     $ sudo openssl rsa -in privkey.pem -out /opt/bitnami/apache2/conf/server.key
    

Find more information about certificates at http://www.openssl.org.

How to enable HTTPS support with SSL certificates?

TIP: If you wish to use a Let's Encrypt certificate, you will find specific instructions for enabling HTTPS support with Let's Encrypt SSL certificates in our Let's Encrypt guide.
NOTE: The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your cloud server.

Bitnami images come with SSL support already pre-configured and with a dummy certificate in place. Although this dummy certificate is fine for testing and development purposes, you will usually want to use a valid SSL certificate for production use. You can either generate this on your own (explained here) or you can purchase one from a commercial certificate authority.

Once you obtain the certificate and certificate key files, you will need to update your server to use them. Follow these steps to activate SSL support:

  • Use the table below to identify the correct locations for your certificate and configuration files.

    Variable Value
    Current application URL https://[custom-domain]/
      Example: https://my-domain.com/ or https://my-domain.com/appname
    Apache configuration file /opt/bitnami/apache2/conf/bitnami/bitnami.conf
    Certificate file /opt/bitnami/apache2/conf/server.crt
    Certificate key file /opt/bitnami/apache2/conf/server.key
    CA certificate bundle file (if present) /opt/bitnami/apache2/conf/server-ca.crt
  • Copy your SSL certificate and certificate key file to the specified locations.

    NOTE: If you use different names for your certificate and key files, you should reconfigure the SSLCertificateFile and SSLCertificateKeyFile directives in the corresponding Apache configuration file to reflect the correct file names.
  • If your certificate authority has also provided you with a PEM-encoded Certificate Authority (CA) bundle, you must copy it to the correct location in the previous table. Then, modify the Apache configuration file to include the following line below the SSLCertificateKeyFile directive. Choose the correct directive based on your scenario and Apache version:

    Variable Value
    Apache configuration file /opt/bitnami/apache2/conf/bitnami/bitnami.conf
    Directive to include (Apache v2.4.8+) SSLCACertificateFile "/opt/bitnami/apache2/conf/server-ca.crt"
    Directive to include (Apache < v2.4.8) SSLCertificateChainFile "/opt/bitnami/apache2/conf/server-ca.crt"
    NOTE: If you use a different name for your CA certificate bundle, you should reconfigure the SSLCertificateChainFile or SSLCACertificateFile directives in the corresponding Apache configuration file to reflect the correct file name.
  • Once you have copied all the server certificate files, you may make them readable by the root user only with the following commands:

     $ sudo chown root:root /opt/bitnami/apache2/conf/server*
    
     $ sudo chmod 600 /opt/bitnami/apache2/conf/server*
    
  • Open port 443 in the server firewall. Refer to the FAQ for more information.

  • Restart the Apache server.

You should now be able to access your application using an HTTPS URL.

How can I run a command in the Bitnami MEAN Stack?

Log in to the server console as the bitnami user and run the command as usual. The required environment is automatically loaded for the bitnami user.

How to create a custom Node.js application?

Many users run a Bitnami stack as a development environment for their own projects (as opposed to running third-party applications). To create a custom Node.js application from scratch, follow the steps below. These steps assume that your application will live in the /opt/bitnami/apps/myapp/ directory:

  • Run the following commands to create the directories:

    $ sudo mkdir -p /opt/bitnami/apps/myapp
    $ sudo mkdir /opt/bitnami/apps/myapp/conf
    $ sudo mkdir /opt/bitnami/apps/myapp/htdocs
    
  • Create and edit the /opt/bitnami/apps/myapp/conf/httpd-prefix.conf file and add the line below to it:

    Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
    
  • Create and edit the /opt/bitnami/apps/myapp/conf/httpd-app.conf file and add the content below to it. This is the main configuration file for your application, so modify it further depending on your application's requirements.

    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
    
    NOTE: 3000 is the default port for the Express server. If you have customized your application to use a different port, change it here as well.
  • Once you have created the files and directories above, add the following line to the end of the main Apache configuration file at /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:

    Include "/opt/bitnami/apps/myapp/conf/httpd-prefix.conf"
    
  • Restart the Apache server:

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    
  • Start the Express server:

    $ cd /opt/bitnami/apps/myapp/htdocs
    $ ./bin/www
    

    Alternatively, use the following command to start the server and keep it running even after your server session ends. Replace FILE with the correct filename for your application.

    $ forever start FILE.js
    

Although your application is now available, you may not be able to access it immediately. This is because the Express server runs on port 3000 by default, and Bitnami stacks on some platforms have this port closed for security reasons. To access the application, you will need to create an SSH tunnel to the port.

How to create a project using Express?

Express is a high-performance Web development framework for Node.js inspired by Sinatra.

  • Installing it is as simple as executing the commands below:

     $ sudo npm -g install express
     $ sudo npm -g install express-generator
    
  • Create a skeleton project by executing these commands. This will produce a new application in the projects/sample-application directory:

     $ mkdir -p projects
     $ cd projects
     $ express sample-application
    
  • Install dependencies using npm:

     $ cd sample-application
     $ npm install
    

This will download and install the required dependencies into a node_modules directory under your project folder.

How to start the Express web application?

To start your application server, you just have to execute the following command, inside your application directory:

$ npm start

Alternatively, use the following command to start the server and keep it running even after your server session ends. Replace FILE with the correct filename for your application.

$ forever start FILE.js

If you are using a recent Express version (greater than 4.0), you should use the following command instead:

$ ./bin/www

Port 3000 is the default port used by Express when creating the template. This means that you may receive an error similar to the below when starting the server:

Error: listen EADDRINUSE
 at errnoException (net.js:670:11)
 at Array.0 (net.js:771:26)
 at EventEmitter._tickCallback (node.js:190:38)

This means that the port is already in use. Edit the app.js script and change the line containing app.listen() to use a different port number, as below. Then, start the application again.

app.listen(4000, function(){

How to install Node.js applications?

NOTE: To avoid a conflict between two or more Node.js applications attempting to use the same port, modify the application settings as needed to use a different port for each application.

To install a Node.js application, first ensure that all dependences are satisfied. Many applications will require Node.js and MongoDB, but others may require Redis or MySQL. To check available services, run this command:

$ sudo /opt/bitnami/ctlscript.sh status

To install an application in the example/ directory, follow these steps:

  • Create the directory:

     $ sudo mkdir /opt/bitnami/apps/example
    
  • Move the application files to that directory and follow the official installation steps.

How to create a new MEAN project?

If you would like to create a new MEAN project, follow the steps below:

  • Log in to your server console.

  • Create a new folder for your project in the /home/bitnami directory.

     $ cd /home/bitnami
     $ mkdir projects
    
  • Create a new Express project:

     $ cd /home/bitnami/projects
     $ express sample
    
  • The MEAN stack already has the required components installed in Node.js, but if you prefer, you can install them in the new project folder:

     $ cd /home/bitnami/projects/sample
     $ npm install
    
  • Start the application.

     $ ./bin/www
    

This will start the Express server for your application on port 3000.

To access the application and see its output, browse to http://SERVER-IP:3000/. To end the application, terminate the running Express process.

NOTE: Access to the server on port 3000 may be blocked for security reasons. In this case, you must first create an SSH tunnel between your local system and the server before you can access the application using these instructions.

You can now proceed to enhance your project by connecting it with MongoDB or by adding AngularJS.

Connecting to MongoDB

You can connect your application with MongoDB using MongooseJS, an object modelling driver for Node.js. It is already installed in the MEAN stack so you only have to add the following lines to your app.js file:

var Mongoose = require('mongoose');
var db = Mongoose.createConnection('mongodb://USER:PASSWORD@localhost/DATABASE');

On cloud servers, you can also use the MongoDB socket instead of using the TCP/IP connection to MongoDB. Here is an example.

var Mongoose = require('mongoose');
var db = Mongoose.createConnection('mongodb:///opt/bitnami/mongodb/tmp/mongodb-27017.sock/DATABASE');

Note that the socket name depends on the MongoDB port in use.

Refer to this document for information on how to create a database and a database user in MongoDB.

Adding AngularJS

You can use install AngularJS in your application with Bower. Create a file named .bowerrc in your application with the following content:

{ "directory" : "public/javascripts/vendor" }

Then, run this command in the project directory:

$ bower install angular

The necessary files will be copied into the public/javascripts/vendor/angular directory of your application.

Learn more about testing and developing applications with the Bitnami MEAN stack.

How to create a full backup of MEAN?

Backup

The Bitnami MEAN Stack is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

Follow these steps:

  • Change to the directory in which you wish to save your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Create a compressed file with the stack contents:

      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    
  • Restart all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

You should now download or transfer the application-backup.tar.gz file to a safe location.

Restore

Follow these steps:

  • Change to the directory containing your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Move the current stack to a different location:

      $ sudo mv /opt/bitnami /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directoryv

      $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

How to debug errors in your MongoDB database?

The main log file is created at /opt/bitnami/mongodb/log/mongodb.log on the MongoDB database server host.

bch

Bitnami Documentation