Skip to main content

JBrowse web quick start via CLI

In this guide, we'll get an instance of JBrowse web running on your computer's browser.

Just want to download JBrowse web and get started? Follow our JBrowse web quick start.

Want JBrowse desktop? Follow our JBrowse desktop quick start.

Prerequisites

  • Ability to run commands on the command line
  • A stable and recent version of node
caution

If you are using apt as your package manager, we recommend not using it to install Node.js. Good alternatives include NodeSource or NVM.

Downloading JBrowse 2 using the JBrowse CLI

The JBrowse CLI can help perform many tasks to help you manage JBrowse 2, such as:

  • create a new instance of JBrowse 2 automatically
  • update an existing instance of JBrowse 2 with the latest released version
  • configure your JBrowse 2 instance

Installing the CLI tools

To globally install the JBrowse CLI, run

npm install -g @jbrowse/cli

After running this command you can then test the installation with

jbrowse --version

which will output the current version of the JBrowse CLI.

note

If you can't or don't want to globally install the JBrowse CLI, you can also use the npx command, which is included with Node.js, to run JBrowse CLI without installing it. Simply replace jbrowse with npx @jbrowse/cli in any command, e.g.

npx @jbrowse/cli --version

Using jbrowse create to download JBrowse 2

In the directory where you would like to download JBrowse 2, run

jbrowse create jbrowse2

Checking the download

The directory where you downloaded JBrowse should look something like this:

jbrowse2/
├── asset-manifest.json
├── favicon.ico
├── index.html
├── manifest.json
├── robots.txt
├── static/
├── test_data/
└── version.txt

Running JBrowse 2

JBrowse 2 requires a web server to run. It won't work if you try to directly open the index.html in your web browser. We can use a simple server to check that JBrowse 2 has been downloaded properly. Run

cd jbrowse2/
npx serve . # use npx serve -S . if you want to refer to symlinked data later on

which will start a web server in our JBrowse 2 directory.

Navigate to the location specified in the CLI's output (likely http://localhost:3000).

Your page should look something like this:

JBrowse 2 screen showing no configuration found
Figure: JBrowse 2 screen showing no configuration found

Click on the sample config to see JBrowse 2 running with a demo configuration. It should look like this:

JBrowse 2 screen with a sample configuration
Figure: JBrowse 2 screen with a sample configuration

Congratulations! You're running JBrowse 2.

Next steps

Now that JBrowse 2 is set up, you can configure it with your own genomes and tracks. There are two ways you can configure JBrowse 2: with the JBrowse CLI (tutorial here) or with JBrowse 2's built-in graphical configuration editing (guide here).