Follow these steps to setup PhpMongoAdmin:

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

  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 levelabove) 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 (/public/ will be created dusing the installation)
  3. Setup Methods:
    1. Downloading:
      1. Download to the application ZIP to a directory that is 1 level above your intended web root.
      2. 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 https://github.com/php-mongo/admin.git .
  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 by Laravel -
        • 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. 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
        DB_FOREIGN_KEYS=true
        s DB_QUERY_LOGS=true ## this will log all queries made from the application against a collection

        ## Laravel settings BROADCAST_DRIVER=log
        CACHE_DRIVER=file
        QUEUE_CONNECTION=sync
        SESSION_DRIVER=file
        SESSION_LIFETIME=120

        ## For future usage REDIS_HOST=127.0.0.1
        REDIS_PASSWORD=null
        REDIS_PORT=6379

        ## Mailer options MAIL_MAILER=smtp
        MAIL_HOST=smtp.mailtrap.io
        MAIL_PORT=2525
        MAIL_USERNAME=null
        MAIL_PASSWORD=null
        MAIL_ENCRYPTION=null
        ## 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=" ## '203.203.230.203' ## 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: https://github.com/php-mongo/admin/issues
  9. Support is also available via this website: please use this form to report problems.

Thank you for using PhpMongoAdmin...

 

Go To Top