molgenis
8.0
8.0
  • Introduction
  • What is MOLGENIS
  • Try out MOLGENIS
  • Quick start (docker)
  • Find, view, query
    • Using the navigator
    • Using the search-all
    • Using the dataexplorer
    • Setup authentication
  • Data management
    • EMX format
    • Quickly import data
    • Advanced data import
    • Modify metadata
    • Questionnaires
    • Downloading data
    • Using expressions
  • Access control
    • Users
    • Groups and roles
    • Finegrained permissions
  • Data processing
    • Scripts
    • R
    • Python
    • Schedule jobs
  • Configuration
    • Settings
    • Customize MOLGENIS
    • Localization
    • Apps in MOLGENIS
    • Creating themes
  • Interoperability
    • Swagger specification
    • REST api v1
    • REST api v2
    • Files api
    • Import api
    • Python-api client
    • R-api client
    • Beacon api
    • FAIR api
    • RSQL operators
  • For developers
    • Developing MOLGENIS
    • Developing frontend in MOLGENIS
    • Developing Apps in MOLGENIS
    • Using an IDE (Intellij)
    • Technologies
    • Dynamic decorators
    • Running the integration tests
    • Jobs
    • Security
  • For system administrators
    • Kubernetes (experimental)
    • Standalone server (tomcat)
    • Migration guide
Powered by GitBook
On this page
  • Prerequisites for MOLGENIS development
  • Setting your molgenis-server.properties
  • Configuring Elasticsearch
  • Get the code
  • Start MOLGENIS
  1. For developers

Developing MOLGENIS

PreviousFor developersNextDeveloping frontend in MOLGENIS

Last updated 4 years ago

To develop MOLGENIS on you machine we recommend to use IntelliJ as IDE. You need to install the prerequisites as well.

Prerequisites for MOLGENIS development

The components needed to run MOLGENIS locally are:

MOLGENIS components

Now that your Apache Tomcat is running and MOLGENIS is deployed, you will notice it will not work yet. This is because your database needs to be configured, and a single properties file needs to be set.

Setting your molgenis-server.properties

The properties file supplies information to the application regarding the database URL, and the initial administrator password. To make it clear to Tomcat where to find your properties file, you have to edit the setenv.sh file in the apache-tomcat folder.

echo 'CATALINA_OPTS="-Xmx2g -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dmolgenis.home=<put your molgenis home here>"' > <path to tomcat>/bin/setenv.sh

The -Dmolgenis.home property tells tomcat where to find your properties file. Replace the ${molgenis_home_folder} with the location of your molgenis home. Note that you should NOT use relative paths in your apache-tomcat configuration. Always use absolute paths to point to your molgenis-server.properties.

Inside the specified molgenis home folder, create a file called molgenis-server.properties, and depending on the version of your MOLGENIS, write the following:

db_user=molgenis
db_password=molgenis
db_uri=jdbc\:postgresql\://localhost/molgenis
admin.password=admin
user.password=admin
python_script_executable=<python3_executable_path>
MINIO_ACCESS_KEY=molgenis
MINIO_SECRET_KEY=molgenis

Remember the molgenis specified in your db_uri, because this will be the name of the database you will create later on in PostgreSQL. This effectively means that whatever you call your database, your db_uri should point to it.

  • Add a database 'molgenis'

  • Add a user 'molgenis' (password 'molgenis') under Login Roles

  • Add 'can create databases' privilege to user 'molgenis'

For example, in psql terminal type:

CREATE DATABASE molgenis;
CREATE USER molgenis WITH PASSWORD 'molgenis';

-- optional for creation of databases by molgenis user
-- this is needed when you run integration tests 
ALTER USER molgenis CREATEDB;

GRANT ALL PRIVILEGES ON SCHEMA molgenis TO molgenis;

Configuring Elasticsearch

Open elasticsearch.yml in the Elasticsearch config directory and set the following properties:

cluster.name: molgenis
node.name: node-1
indices.query.bool.max_clause_count: 131072

Start Elasticsearch from the command line:

./bin/elasticsearch

By default MOLGENIS will try to connect to a node within cluster 'molgenis' on address 127.0.0.1:9300 (not to be confused with port 9200 which is used for REST communication). If the cluster is named differently or is running on another address then you will have to specify these properties in molgenis-server.properties:

elasticsearch.cluster.name=my-cluster-name
elasticsearch.transport.addresses=127.1.2.3:9300,127.3.4.5:9301

Get the code

Create account on github.com.

Copy the clone URL.

mkdir -p ~/git
cd ~/git 
git clone http://github.com/molgenis/molgenis

Optionally select stable molgenis version:

git fetch --tags origin
git checkout <tag name: see https://github.com/molgenis/molgenis/releases>

Start MOLGENIS

You can download, install and use MOLGENIS for free under license .

Optional: and (enables R scripting feature)

Optional: (enables Python scripting feature)

Deploy Apache Tomcat, and place the molgenis-app WAR as the ROOT.war in your apache-tomcat/webapps folder. If you are unfamiliar with Apache Tomcat, follow one of their .

Setting up your PostgreSQL If you are unfamiliar with PostgreSQL, follow one of their . Once you have a PostgreSQL server running, open up the included pgAdmin application that is supplied with most PostgreSQL installations, and perform the following actions:

Set the credentials of the database in the molgenis-server.properties. See

We use as IDE to run the code in.

LGPLv3
OpenJDK 11
Apache Tomcat v9.0.x
PostgreSQL v11.1
Elasticsearch v5.5
Minio v6
OpenCPU 2.1
R 3.5.x
Python 3.6
Apache Tomcat installation guides
PostgreSQL installation guides
IntelliJ
Setting your molgenis-server.properties