# How to run OpenMC

**URL:** <https://openmc.discourse.group/t/how-to-run-openmc/4679>\
**Category:** User Support\
**Created:** [August 12, 2024, 9:46pm UTC](https://openmc.discourse.group/t/how-to-run-openmc/4679 "2024-08-12T21:46:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![birsena](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@birsena](https://openmc.discourse.group/u/birsena)\
**Post date:** [August 12, 2024, 9:46pm UTC](https://openmc.discourse.group/t/how-to-run-openmc/4679/1 "2024-08-12T21:46:59Z")

</div>

Hi,  
I followed the instructions from OpenMC website and installed Docker on Windows 11. From there what are the steps to run an OpenMC file?

I am confused with using Jyputer Notebook and understand how Jyputer and Docker works together.

1. How do I create an input file like the one with MCNP?
2. Where do I create an input file (on my desktop or Jyputer website)? Or do I install Jyputer on my desktop?
3. How do I use Jyputer and Docker? Or are these two different methods to run OpenMC?
4. How do I run OpenMC?

Thank you

Birsen

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [August 13, 2024, 1:42pm UTC](https://openmc.discourse.group/t/how-to-run-openmc/4679/2 "2024-08-13T13:42:28Z")

</div>

Hi Birsen, welcome to the community.  
I am not a docker user, but I am using openmc from WSL Windows and compiling it from the source. I think there are some tutorials on YouTube, one from Copenhagen Atomics that give a glimpse into how to use Docker on WSL and do neutronic calculations from it.

If you have successfully set the openmc environment, you can check your openmc version by using this command from the Linux terminal.

```auto
openmc --version

```

Next, you need to check the nuclear data library has been set on your system, try

```auto
echo $OPENMC_CROSS_SECTIONS

```

It will show you the default path for openmc nuclear data library that exists on your system, similar to the path for your xsdir file.  
If you have none of it, you might want to check whether the docker you use already has a nuclear data library or not. This is the official nuclear data library for openmc  
[https://openmc.org/official-data-libraries/](https://openmc.org/official-data-libraries/)

you can also add the nuclear data path to your .profile file from your $HOME if needed

```auto
export OPENMC_CROSS_SECTIONS=/path to your nuclear data/cross_sections.xml

```

Also, if you check the source code of openmc from git

> **[GitHub - openmc-dev/openmc: OpenMC Monte Carlo Code](https://github.com/openmc-dev/openmc)**
>
> OpenMC Monte Carlo Code

you can see that there is an examples folder with various examples. If you check those Python scripts, try the jezebel, I think you will understand the workflow. You can run this script with  
`python3 filename.py`  
it will generate the material.xml, geometry.xml, settings.xml, and other xml files that are needed by openmc to run. You can start openmc by typing  
`openmc` (enter),  
it will read the xml files, or if the python script has the `openmc.run()` line input, it will automatically run openmc after the xml file generated.

If you want a more interactive workflow, you can use the jupyter notebook to check each part of the input Python script. This git repo has many useful example notebooks for you to try. I think it will be easier for you to understand because you have a background in MCNP.

> **[GitHub - openmc-dev/openmc-notebooks: Example Jupyter notebooks for OpenMC](https://github.com/openmc-dev/openmc-notebooks)**
>
> Example Jupyter notebooks for OpenMC

Regarding how you use jupyter notebook from Docker in WSL, I think you can search it on the net. Or maybe other docker users in our forum will catch you later.

---

<div class="post-metadata">

**Author:** ![birsena](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@birsena](https://openmc.discourse.group/u/birsena)\
**Post date:** [August 13, 2024, 6:57pm UTC](https://openmc.discourse.group/t/how-to-run-openmc/4679/3 "2024-08-13T18:57:44Z")

</div>

Hi Wahid,

Thank you for the response.
