PhpMongoAdmin can be installed manually or by using one of the installation scripts.

This page provides a quick-start example and an overview of the manual installation method:

You may also wish to consult this page detailing some Nested and Alias setup requirements and warnings: Nested Installations and Aliases


If you are using a Linux distribution with an Apache variant or NginX you can use our installation script for a fully automated installation. These have been tested on Centos 7+ and Ubuntu 16+

Follow these steps to get started:

  1. Before starting, make sure you have the MongoDB credentials. You will need them to complete the process.
  2. You should never run a MongoDB server that is publicly visible without activating security and restarting the server:
    2. If your MongoDB server is on a local development environment or is located on a private network, and you have not activated security:
      1. The application Control-User is still required to secure the application login access
      2. The Control-User will be able to access MongoDB without credential and will have full ROOT access to MongoDB
  3. Switch to a sudo user: sudo su
  4. Run this command at the prompt for 'default' installation:
    1. The default setup installs the application code to: /usr/share/phpMongoAdmin
    2. You can then choose whether to create a VirtualHost config or an Alias (global) config based installation
    3. wget -O - | bash
    4. When the initialisation completes can choose from the 4 options to continue installing
    5. During the installation you will be asked to provide several environment settings
      • Select an environment: ( production, staging, local are valid choices )
      • Turn debugging mode on|off ( off recommended for all environments except local )
      • The URL you will access the application with ( this is not strictly enforced yet - mostly used for referencing )
  5. Run this command at the prompt for the 'custom' installation:
    1. The custom setup installs the application to the current directory (where to process is initialised)
    2. The custom install requires manual set-up of the .env file (see below)
    3. wget -O - | bash
    4. If you select the 'pmainstall run vhost public' install command an the process will prompt for SSL information :
        • Do you already have an SSL certificate for the intended host? 
        • 1) Yes - 1 + Enter, you will be asked for the location of the server key and certificate files
        • 2) No  - 2 + Enter, a self signed certificate will be generated - you will be asked for some details
        • 3) No  - 3 + Enter, no SSL will be available
        • This automated process has been tested on AWS + Ubuntu
    5. These env.example provides the minimal set-up information required to launch the application
    6. Other environment setting will be populated automatically
  6. When the installation completes you should access the URL to complete the initial setup:
    1. http(s)://
    2. The default installation configuration creates an Alias record that allows you to load PhpMongoAdmin from any website that is active on the Server.
    3. If that is not a desirable outcome, you should try the 'custom setup' or consult the manual installation instructions below.
    4. For a VirtualHost install use the sample /setup/apache/virtualHost/vhost_phpMongoAdmin.conf (local network) or vhost_phpMongoAdminPublic.conf for public access
  7. With later releases of PhpMongoAdmin we will provision further testing and adjustments to these set-up procedures.



We have created our first docker-compose compatible installation which provides the full server suite required for PhpMongoAdmin

Check here: - this repository has full setup instruction listed within the primary README file.

The docker-compose-full installation has been tested on Windows 10 and Centos 7


Manual Setup Guide

The process outlined below is a detailed hands on guide for installing PhpMongoAdmin as a VirtualHost or other custom setup.

  1. Before proceeding ensure that your setup meet the minimum requirement. Read then requirements doc for more information.
  2. In both of the following scenarios, you will need a directory structure that allows you to have files outside ( one level above) of the web document root (/public)
    1. /hosting/websites
    2. /hosting/websites/phpmongoadmin
    3. /hosting/websites/phpmongoadmin/public
    4. Note: you may have to rename /public to /public_html if you are using CPanel or similar
    5. A /public/ directory exists as the 'default' web root for the application - while it can be changed we have not tested that outcome
  3. Setup Methods:
    1. Downloading:
      1. Download to the application ZIP to a directory that is 1 level above your intended web root.
      2. Download:
      3. Unzip to the current directory.  When you inspect the files/folders you will see the /public directory - that will be the 'Document Root' for your website configuration.
    2. Cloning:
      1. CD to the intended application root directory
      2. Clone the repository to the current directory:
        1. git clone --branch master .
  4. If all went according to plan - now its time to create the .env configuration file for the application.
    1. These files cannot be distributed as part of the application - they are unique for each installation.
    2. There are two possible methods to use.
      1. Copy the sample file provide with PhpMongoAdmin - this file has many prepopulated defaults (mostly intended for local development usage)
        • cp .env.example .env
      2. Create a new one from scratch:
        • touch .env will create the file
        • Alternatively let the editor create the file: nano .env or vi .env to open for editing
    3. We have created a quick install script that does all the hard work for you.
      1. Currently the script will only install in default mode with nested alias access.
      2. Run these command to trigger the setup:
        1. source
        2. pmasetup run
          1. This will create an install used for private network or development access
        3. pmasetup run public
          1. This uses the web server config that allows public access (beware of security requirements)
    4. Use our recommended sample as a guide:
      • APP_ENV=local ## set the environment: production, staging, (local, dev, development) # testing is reserved for internal use
        APP_KEY=01234567890123456789012345678901 ## ensure a key is generated - 32 CHAR random string
        APP_DEBUG=true ## true for local or development environment
        APP_URL=http://host.yourdomain.suffix ## http(s)://< your host and domain >

        ## Laravel logging LOG_CHANNEL=stack

        ## Database settings DB_CONNECTION=sqlite

        ## Required database system path DB_DATABASE= ## < system path to > /database/sqlite/database.sqlite
        s DB_QUERY_LOGS=true ## this will log all queries made from the application against a collection

        ## Laravel settings BROADCAST_DRIVER=log

        ## For future usage REDIS_HOST=

        ## Mailer options MAIL_MAILER=smtp
        ## Default FROM ADDRESS for emails MAIL_FROM_ADDRESS=person ## This email address is being protected from spambots. You need JavaScript enabled to view it.
        MAIL_FROM_NAME="${APP_NAME} ## this defaults to the APP_NAME setting value
        ## Save all sent emails to a logfile ## comment this out to disable MAIL_LOG_CHANNEL="emails

        ## Recommended and optional app settings
        #DB_USER= ## used for locked down setups
        #DB_PASSWD= ## used for locked down setups
        APP_TIMEZONE=" ## set your timezone for sensible time keeping eg: 'Australia/Brisbane'
        APP_MIN_PWD_LENGTH="9 ## safe minimum length for passwords

        ## Restrict the environment from creating new users
        ## This setting allows you the lock the application to the control user only
        ## Use: "production" to prevent user creation on production environment
        APP_DENY_ENV_ADD_USERS="demo ## we use this on our demo site

        ## Enable or disable IpInfo querying
        ## If this application is used offline this should be disabled (set to false)
        IPINFO_ENABLED="true ## PhpMongoAdmin uses some location data to personalize the experience
        ## Manually pass an IP address to IpConfig
        ## This will enforce the same location for all users
        IPINFO_ADDRESS=" ## '' ## use what's my IP to loack this down to a single location
  5. Now that you have a basic configuration - its time to run some application initialization procedures:
    1. Run the composer install from the application root:
      • composer install
      • In some cases you may need to specify the full path to compose
    2. Run the artisan migration process to initialize the local SQLite database. First, create the directory and database file:
      • mkdir database/sqlite
      • touch database/sqlite/database.sqlite
      • NOTE: You are not constrained to this exact format - you may wish to use a different path and name, If so, the change must be reflected in the .env configuration file
      • php artisan migrate
    3. Run the Passport setup - this create the unique keys for your local user tokens
      • php artisan passport:install
      • php artisan passport:client --personal ## this step is not required for our environment
  6. If you have configured your web server, you should now be able to load the application.
  7. Access the application URI:
    1. The initial setup will trigger.
    2. This process will setup your Control User.
      • Enter a name, username, password and email address - save when completed.
      • This user will be the Master Administrator account.
      • Depending on the privileges associated with the MongoDb account you link to thie control user, this user can be considered a 'root' level user for the application and databses.
    3. Once the Control User is created, the application will load the login form.
      • NOTE: All users of PhpMongoAdmin login to accounts that are locally managed. Database sever configurations are designed to be managed separately. As a root or admin user you can create user accounts that are syncronised between the application and local mongodb. Syncronisation has only been tested with local mongodb servers.
      • Enter your Control User login credentials to continue.
    4. If the MongoDB daemon has been started without security -> authentication, then you should be able to see some databases and statistical information.
      1. You will not be required to create and Server configuration to use the application.
    5. If your MongoDB daemon has been started with security -> authentication enabled in the configuration, you will need to create a Server configuration.
      1. Click on Servers on the Top navigation
        1. NOTE: Please be aware that the 'password' you enter here is saved unencrypted into the local SQLite database (we'll be adding encryption later on)
        2. Enter the username and password details for a user that has MongoDB access.
        3. If the MongoDB is a local install, enter localhost into the host field.
        4. The default PORT setting should be OK.
        5. Check the 'Active' checkbox.
        6. After saving the server config, refresh the application (Ctrl F5 on windows)
        7. We now support connecting to MongoDb Atlas Cloud clusters. 
        8. To connect to Atlas, activate the checkbox at the top of the form. 
        9. If your Atlas account does NOT cluster admin privileges you will most likely need to enter the database name that you want to connect to.
  8. Please report any setup issues via our GitHub account:
  9. Support is also available via this website: please use this form to report problems.

Thank you for using PhpMongoAdmin...


Go To Top