Unable to install with MongoDB

Hi Cockpit Community,

I’m having trouble installing Cockpit with mongodb as default database. I can install Cockpit fine with SqlLite.

  1. I downloaded latest stable build from https://getcockpit.com/download and copied the configuration from getcockpit.com/documentation/reference/configuration to use mongodb.
  2. Created the “cockpitdb” collection in mongo.
  3. Then I went to install via localhost/cockpit/install and the browser just says “This page isn’t working”.

php_error.log
[26-May-2018 16:16:43 Europe/Berlin] PHP Fatal error: Class ‘MongoDB\Driver\Manager’ not found in /Applications/MAMP/htdocs/cockpit-cms/lib/MongoDB/Client.php on line 83

Hi,

please make sure that you have the mongodb driver extension installed/enabled:

http://php.net/manual/de/mongodb.installation.pecl.php

1 Like

in the Cockpit Dockerfile is a list of dependencies that get installed. The pecl monogodb is one of them.

Dockerfile:

...
RUN apt-get update \
&& apt-get install -y \
	wget zip unzip \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    sqlite3 libsqlite3-dev \
    libssl-dev \
&& pecl install mongodb \
&& pecl install redis \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) iconv gd pdo zip opcache pdo_sqlite \
&& a2enmod rewrite expires
...

I had the same issue, but I was using MAMP. I had to make sure the mongodb driver was installed on my MAMP server. If you are still having trouble and that is your issue let me know. I will offer my solution.