How To Deploy OHIF V3 Viewer in non-root Path – Step-by-Step Guide

In this tutorial, we will discuss how to deploy OHIF V3 viewer in a non-root path.OHIF Viewer is an open-source, web-based medical imaging viewer that enables visualization and interaction with DICOM and other imaging formats. It provides tools for image manipulation, reconstruction, and advanced features, promoting interoperability and collaboration in healthcare, research, and education.

Let’s dive into the deployment of OHIF viewer v3, suppose we want to run OHIF viewer from server_root/ohif/.


  • yarn to build the OHIF V3 viewer package

Follow these steps

Step 1: First, head over to GitHub and download a release for this demo we’re using Viewers-3.8.0-beta.59.

Step 2: Open the command prompt enter into the OHIF Viewer directory and set these environment variables.

set PUBLIC_URL=/ohif/ 
set APP_CONFIG=config/default.js

As per OHIF V3 documentation

  • The PUBLIC_URL tells the application where to find the static assets.
  • the routerBasename will tell the application how to handle the routes.

Step 3: Open the default.js file (platform\app\public\config\default.js) in the text editor and update routerBasename as shown below

Step 4: First test it locally using the command :

yarn run dev

That’s it OHIF viewer running from a non-root path http://localhost:3000/ohif.

You can build the viewer using the below command.

yarn run build

OHIF viewer build will be available in the path /platform/app/dist.