Download necessary files (seed data, example config and example study from datahub):
./init.sh
Start docker containers. This can take a few minutes the first time because the database needs to import some data.
docker compose up
The cbioportal application should now be running at localhost:8080, with the one of the studies already loaded in it.
If you are developing and want to expose the MySQL database for inspection through a program like Sequel Pro, run:
docker compose -f docker-compose.yml -f dev/open-ports.yml up
In a different terminal import a study
docker-compose exec cbioportal metaImport.py -u http://cbioportal:8080 -s study/lgg_ucsf_2014/ -o
The example study in the study/
directory is based on hg19. When importing hg38 data, be sure to set reference_genome: hg38
in the meta_study.txt.
Restart the cbioportal container after importing
docker-compose restart cbioportal
The compose file uses docker volumes which persist data between reboots. To completely remove all data run:
docker compose down -v
If you were able to successfully set up a local installation of cBioPortal, please add it here: https://www.cbioportal.org/installations. Thank you!
For cBioPortal instances with large cohorts (>100K samples), we developed a "Clickhouse mode" of the Study View. This mode uses Clickhouse as an additional database next to MySQL for 10x faster querying (see video). The mode is experimental and is currently used only by the public-facing GENIE instance. We plan to roll it out to other portals later this year (see roadmap ticket). Follow the steps below to run cBioPortal Docker Compose in clickhouse mode.
- Modify .env to use clickhouse-compatible release of cBioPortal.
... DOCKER_IMAGE_CBIOPORTAL=cbioportal/cbioportal:6.0.27 ...
- Run init script
./init.sh
- Start cBioPortal with clickhouse
docker compose -f docker-compose.yml -f addon/clickhouse/docker-compose.clickhouse.yml up
The Clickhouse setup mentioned above is fully compatible with a remote Clickhouse database. For production environments, you can set up a Clickhouse database using Clickhouse Cloud and update the clickhouse database credentials in the .env to match your database credentials. For the clickhouse sync step to work properly, your credentials should have both read and write permissions.
docker compose exec cbioportal-database \
sh -c 'mysql -hcbioportal-database -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"'
This cBioPortal Docker Compose setup runs the latest release of cBioPortal. If you want to run more recent pre-releases, follow the steps below:
- Modify
DOCKER_IMAGE_CBIOPORTAL
environmental variable to point to a valid cBioPortal Docker Image.export DOCKER_IMAGE_CBIOPORTAL=cbioportal/cbioportal:6.2.0
- Restart cbioportal
docker compose restart cbioportal
A web-only version of cBioPortal (suffixed -web-shenandoah) can be run using docker compose by declaring the DOCKER_IMAGE_CBIOPORTAL
environmental variable to point to the corresponding image:
export DOCKER_IMAGE_CBIOPORTAL=cbioportal/cbioportal:6.0.20-web-shenandoah
docker compose -f docker-compose.yml -f dev/docker-compose.web.yml up
which will start the v6.0.20-web-shenandoah version rather than the newest default version.
To set up a keycloak server with your cBioPortal instance for development purposes, check out the documentation.
You can change the heap size in the command section of the cbioportal container
For the importer you can't directly edit the java command used to import a study. Instead add JAVA_TOOL_OPTIONS
as an environment variable to the cbioportal container and set the desired JVM parameters there (e.g. JAVA_TOOL_OPTIONS: "-Xms4g -Xmx8g"
).