How to get started with MongoSoup

Following up our MongoDB Munich Thank You Post today we would like to show you how to deploy an application on CloudControl and use MongoSoup as the data storage. As an example we use a little web application that displays movies from The Movie Database. The source code is available on GitHub. So first of all:

What is MongoSoup?

MongoSoup is the first German-based MongoDB cloud hosting solution. Supported by our team of experts you can have a running MongoDB database in virtually no time.

What do you need?

First of all you need a CloudControl account. Therefore, go to and create an account and verify your email address. Then switch to your console.

If you haven’t already installed Git on your computer, get it from the official site or your package repository. For Windows it’s recommended to use the official installer and Git bash.

Afterwards you need to install cctrl the CloudControl command line client. For Linux and Mac OS X you can get it like this:

# if you don't have pip yet, first install pip
$ sudo easy_install pip
# then install cctrl
$ sudo pip install cctrl

If you have problems on linux, you can also download it here and install it by running:

$ sudo python install

Windows user should download the installer. The file is named cctrl-x.x-setup.exe.

For more details see the CloudControl Getting Started Guide .

How to create a CloudControl application?

Afterwards create a new CloudControl Application, either online or by running the following comand with only the language you want:

$ cctrlapp APP_NAME create [java, php, python, ruby]

If your project uses Gradle, like we do here, you need to specify the buildpack like this:

$ cctrlapp APP_NAME create custom --buildpack

If the buildpack is not suitable for you, you can fork and modify it like you need it.

How to add MongoSoup?

To add MongoSoup as Add-On to your application run:

$ cctrlapp APP_NAME/DEP_NAME addon.add mongosoup.sandbox

This will give you a free sandbox plan to play around with.

Now you can go to the web interface, select your application and your deployment. If you now go to the Add-Ons, you can click on the Credentials Button and see the link you will have to include in your application.

In our case it’s changing the spring-context.xml to use the Credentials class that is provided by CloudControl.

How to start the application?

Finally, CloudControl needs a Procfile in the main directory to start the application. In our case the content of the file is:

web: ./ui/start

As we are using the gradle application plugin, the start file calls the outcoming script of running ‘gradle stage’ which depends on the ‘installApp’ task.

If your are not using gradle, it will be something like:

web: java -cp target/classes:target/dependency/*

You may also need to change the Java version to 1.7. In order to do so, create a file in the main directory with following content:


To get the right port for your application use:


as 8080 is not always the right port.

To test your application locally you can use foreman and execute ‘foreman start’ on your command line.

How to deploy your application?

As CloudControl is working with Git, commit your application either to your own git repository or the git repository provided by CloudControl. Be aware that by default the master brunch is taken for the default deployment. If you want to use another brunch, the name must be identical with your deployment name.

Now you can push your application to CloudControl by running:

$ cctrlapp APP_NAME push

Afterwards you deploy your application by running:

$ cctrlapp APP_NAME deploy

This can take some minutes. You can see the current status when you log in online to your CloudControl account.

Now your application is online hosted under

What may help if you have problems or need more information?

The CloudControl documentation is here:

For a Java Hello World example look at:

You can use SSH to connect directly as described here:

What is the demo based on?

The demo is based on the Spring Framework, MongoDB, Apache Wicket and Jetty.

How can this demo be extended?

Starting with this little demo you can extend it as you wish to. If you are using The Movie Database, please create your own account here and use your own API key.

Any questions?

If you have any questions or feedback, please write to or!


4 thoughts on “How to get started with MongoSoup

  1. Benedikt

    Nice Tutorial. Thanks! Yet I get the following warning:

    $ cctrlapp blmongosouptest/default addon.add mongosoup.sandbox
    addon: Billing account required in order to add “mongosoup.sandbox”.

    Is this OK? Am I missing a step? Thanks.

    1. Benedikt

      The solution is to add a billing account (credit card information) to your profile in cloudcontrol. Yet the mongosoup.sandbox addon will not cost anything.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s