Using MNE with 3D visualization on a headless server

For a usage inside docker, the best ressource available AFAIK is mne-docker but it might not be up to date.

For reference, I will also describe the standard procedure to use mne-python on a remote server using conda and jupyter notebook, without docker:

  1. (on server) clone mne-python:

git clone https://github.com/mne-tools/mne-python.git

  1. (on server) create a conda environment from server_environment.yml:

conda env create -f server_environment.yml

  1. (on server) activate the environment:

conda activate mne

  1. (on server) start jupyter notebook in “no browser” mode:

jupyter notebook --no-browser --port=8889

  1. (on client) ssh forwarding:

ssh -N -f -L localhost:8888:localhost:8889 username@your_remote_host_name

  1. (on web browser - on client) in the address bar:

localhost:8888

Here is a gist to showcase the features available.

Further consideration: those steps could be automated inside a docker container too.

2 Likes