Skip to main content
Molecular dynamics simulations help you study how atoms and molecules move over time. They are commonly used to explore protein stability, conformational changes and ligand binding. You can run these simulations on Nebius AI Cloud using OpenMM, a Python-based simulation engine with GPU acceleration. By packaging OpenMM in a Docker image and running it as a Serverless AI job, you only pay for the seconds the GPU is in use and avoid keeping infrastructure running between simulations. In this tutorial, you will run a protein simulation and inspect its results. The tutorial walks you through the following steps:
  1. Build the simulation image locally with Docker and push it to Container Registry.
  2. Configure an Object Storage bucket for storing simulation results.
  3. Run a CUDA®-accelerated protein simulation as a Serverless AI job that reads a protein structure and writes the simulation results to the Object Storage bucket.

Costs

Nebius AI Cloud charges you for the following billing items: Container Registry is provided free of charge.

Prerequisites

  1. Make sure you are in a group that has at least the editor role within your tenant or project; for example, the default editors group. You can check this in the Administration → IAM section of the web console.
  2. Install Docker on your local machine. To do so, you can install Docker Desktop. If your local machine uses a different CPU architecture than AMD64 — for example, an Apple Silicon Mac or a Windows-on-ARM device — Docker Desktop builds the AMD64 image under emulation.
  3. Install the Nebius AI Cloud CLI. It is required to authenticate against Container Registry and to push the Docker image to it.

Steps

Prepare infrastructure

Locate all resources in the same project.
  1. Create an Object Storage bucket to store simulation results. Serverless AI deletes the container disk after the job completes. The bucket preserves the simulation artifacts generated by the job: the processed structure, trajectory, logs, metadata and plots.
    1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 StorageObject Storage.
    2. Click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Create bucket.
    3. Specify the openmm-simulation name for the bucket.
    4. In the Bucket size field, select Unlimited.
    5. Click Create bucket.
  2. In Container Registry, create a registry to host the Docker image with OpenMM. Hosting the image in Container Registry keeps image pulls inside the same region as your Serverless AI job, which reduces the image pull latency and improves the job start time. Serverless AI doesn’t bill for start time, so you can use Docker Hub or configure a private registry if the added pull latency doesn’t matter for your workflow.
    1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 StorageContainer Registry.
    2. Click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Create registry.
    3. Specify the openmm name for the registry.
    4. Click Create registry.

Build and push the image

  1. Configure the Docker credential helper for Container Registry so that docker push can authenticate through the Nebius AI Cloud CLI:
    nebius registry configure-helper
    
  2. Clone the Serverless AI Cookbook repository and switch to the openmm-simulation directory:
    git clone https://github.com/nebius/serverless-ai-cookbook.git && \
    cd serverless-ai-cookbook/life-science/openmm-simulation
    
    The sim/ folder contains Python code with the OpenMM simulation settings. This tutorial uses the code as-is and lets you adjust the target protein and the simulation step count when you create the Serverless AI job.
    You can explore the code and change the simulation settings — for example, by editing the OpenMM classes in sim/utils.py and sim/run.py. For more details, see OpenMM Python API.
  3. Export the region and the registry path to environment variables:
    export NB_REGION_ID=<region_ID>
    export NB_REGISTRY_PATH=$(nebius registry list \
      --format json \
      | jq -r '.items[] | select(.metadata.name=="openmm") | .metadata.id' \
      | cut -d- -f2)
    
    For the list of regions, see Regions.
  4. Verify that Docker is available and the daemon is running:
    docker version
    docker ps
    
    If docker ps returns a table of containers (can be empty), the daemon is running. If the daemon is not running, launch it.
  5. Build the image, targeting linux/amd64:
    docker build --platform linux/amd64 \
      -t cr.$NB_REGION_ID.nebius.cloud/$NB_REGISTRY_PATH/openmm-serverless:v1 .
    
    Serverless AI runs Docker images on the linux/amd64 architecture. Using the --platform linux/amd64 parameter produces an AMD64 image regardless of the host architecture of your local machine. The resulting image runs natively in Serverless AI with no runtime penalty. For more information, see Docker official documentation on multi-platform builds.
  6. Push the image to the registry:
    docker push cr.$NB_REGION_ID.nebius.cloud/$NB_REGISTRY_PATH/openmm-serverless:v1
    

Run the simulation as a Serverless AI job

Create a CUDA-accelerated job that runs a short simulation on the 1UBQ protein structure:
  1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 StorageContainer Registry, then open the openmm registry and the openmm-serverless image.
  2. In the v1 tag row, click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334adDeploy as job. The Create job page opens with Image path already filled in.
  3. Specify the remaining job parameters:
    • Name: openmm-1ubq.
    • Entrypoint command: bash -c "python -m sim.run --protein-id 1UBQ --steps 1000 && cp -r /openmm/results/. /mnt/data/".
    • Job timeout in hours: 4.
    • Computing resources: With GPU.
    • Available platform: NVIDIA® L40S PCIe with Intel Ice Lake.
    • Preset: 1 GPU — 8 CPUs — 32 GiB RAM.
    • Mount volumes: Bucket.
    • Mount path: /mnt/data. After that, click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Attach bucket and then select the openmm-simulation bucket.
    In the entrypoint command, /openmm/results/ is the location of simulation results inside the Docker container. The command runs the simulation and copies the results to the mounted bucket at /mnt/data. You can adjust --protein-id and --steps to target a different protein or change the simulation length.
  4. Click Create.
  5. Follow the job logs to watch the simulation progress:
    1. In the sidebar, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/ai-services.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=ab4ff229f7690c99deb1dc52d3daf987 AI Services → Jobs.
    2. Next to the job, click View logs. Alternatively, select the job that you want to view the logs for and switch to the Logs tab.
A healthy CUDA-accelerated job prints the following line near the start of the logs:
Using OpenMM platform: CUDA
If the line shows CPU or Reference instead, the GPU runtime didn’t initialize and the simulation will be far slower than expected.

View results in the bucket

The job uploads the simulation results to the bucket in the folder named <protein_id>_<timestamp>/ — for example, 1UBQ_20260512_192514/.To view results:
  1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 StorageObject Storage.
  2. Open the openmm-simulation bucket.
  3. Open the output folder of the latest job.
A completed simulation contains the following artifacts:
  • <protein>_processed.pdb — the processed input structure.
  • <protein>_trajectory.dcd — the trajectory of the simulation.
  • <protein>_simulation.log — the simulation log.
  • <protein>_metadata.txt — the simulation metadata.
  • plots/ — visualizations generated from the trajectory.
To inspect the simulation locally, open the downloaded <protein_id>_processed.pdb and <protein_id>_trajectory.dcd files in a molecular visualization tool of your choice, for example, PyMOL.
PyMOL rendering of the 1UBQ protein structure

How to delete the created resources

A Serverless AI job stops billing the moment it completes, but the bucket keeps accruing charges until you remove it. The container registry is free of charge; delete it if you no longer need the image. The service account and its access key live at the tenant level, don’t accrue charges and can be reused for future workloads. If you don’t need the bucket, delete it, so Nebius AI Cloud doesn’t charge for it.