Inspect a study over SSH
Inspect DICOM files on a remote machine without copying them to a third-party viewer or exposing the unauthenticated server publicly.
Prerequisites
Section titled “Prerequisites”dcmviewis installed on the remote machine that can read the DICOM files.- You can connect to that machine with SSH.
- A chosen port is available on both machines, or you can adapt the forwarding command.
Start the remote viewer
Section titled “Start the remote viewer”On the remote machine, choose a fixed loopback port so the forwarding command is predictable:
dcmview --no-browser --host 127.0.0.1 --port 8888 /path/to/studyWait for the startup message:
dcmview: server running at http://127.0.0.1:8888The server remains bound to the remote loopback interface. Do not replace the host with 0.0.0.0 for this workflow.
Forward the port
Section titled “Forward the port”On your local machine, open a second terminal:
ssh -L 8888:127.0.0.1:8888 user@remote-serverKeep the SSH session open, then visit http://localhost:8888 in your local browser. The browser connects to the local end of the tunnel, SSH carries requests to the remote loopback server, and DICOM files remain on the remote machine.
Use an automatically assigned viewer port
Section titled “Use an automatically assigned viewer port”Omit --port when a fixed remote port is inconvenient:
dcmview --no-browser /path/to/studyCopy the printed port into both port positions of the SSH command. For example, if dcmview prints port 43127:
ssh -L 43127:127.0.0.1:43127 user@remote-serverThen open http://localhost:43127.
Shut down cleanly
Section titled “Shut down cleanly”Press Ctrl+C in the remote dcmview terminal, then close the SSH forwarding session. The temporary server and in-memory state are removed.
Troubleshoot the tunnel
Section titled “Troubleshoot the tunnel”- If the local port is busy, use a different first port:
ssh -L 8899:127.0.0.1:8888 …, then openhttp://localhost:8899. - If the browser cannot connect, confirm that both processes are still running and that the forwarded remote port matches the
dcmviewstartup URL. - If server startup fails, select another remote port or use the default automatic port.
- If your environment requires the viewer process to launch an SSH helper, see
--tunnel,--tunnel-host, and--tunnel-portin the CLI reference.
The server has no authentication. Anyone who can reach it may be able to access pixels, tags, file paths, identifiers, and annotations. See ephemeral state and network security for the complete boundary.