OpenFOAM 14 CFD Toolkit on Ubuntu 24.04 on Azure User Guide
Overview
This guide covers the deployment and use of OpenFOAM 14 on Ubuntu 24.04 on Azure using cloudimg Azure Marketplace images.
OpenFOAM is the leading open source toolkit for computational fluid dynamics (CFD). It ships a large library of solvers and physics models covering incompressible and compressible flow, heat transfer, turbulence, multiphase and reacting flows, together with mesh generation, mesh manipulation and post processing utilities, so a complete simulation workflow from geometry to results runs entirely on the command line. This image packages the OpenFOAM Foundation distribution from openfoam.org, released under the GNU General Public License version 3.
This image is a headless compute appliance. OpenFOAM has no web interface: you SSH in and run meshers, solvers and utilities from the command line, exactly as you would on a local workstation or an HPC login node. The whole toolkit is installed under /opt/openfoam14 and is placed on the PATH of every interactive login shell, so there is nothing to build, source or configure before your first run.
The modular solver runtime. OpenFOAM 11 and later replaced the old per application solvers with a single modular runtime, foamRun. A case describes its mesh, physics and numerics as plain text dictionaries and selects a physics module with the solver keyword in system/controlDict, then runs in two steps: generate the mesh with blockMesh (or snappyHexMesh), and launch the solver with foamRun. The bundled lid driven cavity tutorial used throughout this guide selects solver incompressibleFluid; and needs no extra flags.
Security by design. This appliance holds no secret and runs no network service:
-
No baked credential of any kind. OpenFOAM is a toolkit, not a service, so the image contains no product password, no service account and no shared key. The only routable listener is SSH on port 22, which authenticates with your own Azure injected key.
-
A unique host identity per VM. The SSH host keys and the machine id are regenerated on first boot, so no two VMs launched from this image share a host fingerprint.
-
Proven, not assumed. Every image is verified by actually solving a bundled tutorial end to end, meshing then running the solver and checking the real result files, before it is published. The machine you launch is verified to run a simulation, not merely to contain the software.
What is included:
-
OpenFOAM 14 (package
openfoam14, version20260724) installed from the official openfoam.org apt repository under/opt/openfoam14, with the complete set of solvers, meshers and utilities -
The full tutorials tree at
/opt/openfoam14/tutorials, covering every solver family, ready to copy and run -
ParaView and
paraFoamfor post processing and visualisation -
/etc/profile.d/openfoam.sh, which loads the OpenFOAM environment for every interactive login shell so the toolkit is on yourPATHat once -
The openfoam.org apt source left in place, so
sudo apt update && sudo apt install --only-upgrade openfoam14keeps the toolkit current -
Unattended security upgrades left enabled so the operating system keeps receiving patches
Prerequisites
-
Active Azure subscription, an SSH public key, and a VNet and subnet in the target region
-
Subscription to this listing on Azure Marketplace
-
A Network Security Group allowing TCP 22 for SSH administration. This appliance opens no other port.
Recommended virtual machine size: CFD is compute and memory bound. Standard_F4s_v2 (4 vCPU, 8 GB RAM) is a sensible starting point for the tutorials and small to medium cases. For production meshes choose a compute optimised size with more vCPU and memory, such as Standard_F16s_v2, Standard_F32s_v2 or an HB series HPC size, and run the solver in parallel as shown later in this guide. Standard_B2s (2 vCPU, 4 GB) is adequate for evaluation and for working through this guide.
Deploy the virtual machine
Deploy from the Azure Portal by selecting the image from Azure Marketplace, choosing your VM size, and supplying your SSH public key for the azureuser account. Or deploy from the Azure CLI.
These commands run on your own workstation, not on the VM:
az vm create \
--resource-group my-resource-group \
--name my-openfoam-vm \
--image <this-marketplace-image> \
--size Standard_F4s_v2 \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Connect over SSH once the VM is running:
ssh azureuser@<vm-ip>
Confirm the toolkit is ready
The OpenFOAM environment loads automatically for interactive login shells, so blockMesh, foamRun, snappyHexMesh and the rest of the toolkit are already on your PATH when you connect. In scripts and non login shells, load it explicitly by sourcing the shipped environment file, which is what every command block in this guide does so it is self contained:
. /opt/openfoam14/etc/bashrc
echo "OpenFOAM version: $WM_PROJECT_VERSION"
command -v blockMesh foamRun snappyHexMesh checkMesh
Expected output
OpenFOAM version: 14
/opt/openfoam14/platforms/linux64GccDPInt32Opt/bin/blockMesh
/opt/openfoam14/platforms/linux64GccDPInt32Opt/bin/foamRun
/opt/openfoam14/platforms/linux64GccDPInt32Opt/bin/snappyHexMesh
/opt/openfoam14/platforms/linux64GccDPInt32Opt/bin/checkMesh
The bundled tutorials cover every solver family and are the fastest way to see the toolkit at work. List them:
. /opt/openfoam14/etc/bashrc
ls "$FOAM_TUTORIALS"
Expected output
Allclean incompressibleVoF
Allrun isothermalFilm
Alltest isothermalFluid
XiFluid legacy
compressibleMultiphaseVoF mesh
compressibleVoF movingMesh
film multiRegion
fluid multicomponentFluid
incompressibleDenseParticleFluid ...
incompressibleDriftFlux
incompressibleFluid
incompressibleMultiphaseVoF

Set up a working copy of a tutorial
Never run in the read only system tutorials directory. Copy a case into your own working directory first. This guide uses the classic lid driven cavity, an incompressible flow in a square cavity with a moving top wall:
. /opt/openfoam14/etc/bashrc
mkdir -p "$HOME/run"
rm -rf "$HOME/run/cavity"
cp -r "$FOAM_TUTORIALS/incompressibleFluid/cavity" "$HOME/run/cavity"
ls "$HOME/run/cavity"
Expected output
0 constant system
A case is three directories of plain text: 0 holds the initial and boundary conditions for each field, constant holds the mesh and physical properties, and system holds the run control, discretisation schemes and solver settings. The solver incompressibleFluid; line in system/controlDict is what foamRun reads to pick the physics module.
Generate the mesh
blockMesh builds the mesh from the block description in system/blockMeshDict, and checkMesh validates its geometry and topology:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
blockMesh 2>&1 | tail -14
checkMesh 2>&1 | tail -6
Expected output
Mesh Information
----------------
boundingBox: (0 0 0) (0.1 0.1 0.01)
nPoints: 882
nCells: 400
nFaces: 1640
nInternalFaces: 760
----------------
Patches
----------------
patch 0 (start: 760 size: 20) name: movingWall
patch 1 (start: 780 size: 60) name: fixedWalls
patch 2 (start: 840 size: 800) name: frontAndBack
End
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 1.66533e-14 OK.
Coupled point location match (average 0) OK.
Mesh OK.
A 400 cell mesh with three named patches, and checkMesh reporting Mesh OK, is the whole cavity ready to solve.

Run the solver
Launch the solver. foamRun reads solver incompressibleFluid; from system/controlDict and advances the flow to the case end time (endTime 10), writing results at the configured interval:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
foamRun 2>&1 | tail -14
Expected output
Courant Number mean: 0.122786 max: 0.251756
Time = 10s
smoothSolver: Solving for Ux, Initial residual = 3.32735e-05, Final residual = 1.72577e-06, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 3.20368e-05, Final residual = 1.70576e-06, No Iterations 1
GAMG: Solving for p, Initial residual = 4.44198e-05, Final residual = 3.98854e-06, No Iterations 2
time step continuity errors : sum local = 6.57107e-09, global = -3.27564e-20
smoothSolver: Solving for epsilon, Initial residual = 6.89439e-05, Final residual = 4.04349e-06, No Iterations 1
smoothSolver: Solving for k, Initial residual = 0.000133634, Final residual = 8.22366e-06, No Iterations 1
ExecutionTime = 3.39612 s ClockTime = 4 s
End
Falling residuals and small, stable continuity errors are the solver converging; End on the final line is the run completing cleanly. On this small case it solves in a few seconds.

Inspect the results
Every write interval produced a time directory holding the solved fields. List them, then look inside the final one:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
foamListTimes | tail -5
ls
ls 10
Expected output
8
8.5
9
9.5
10
0 1.5 3 4.5 6 7.5 9 constant
0.5 10 3.5 5 6.5 8 9.5 system
1 2 4 5.5 7 8.5
U epsilon k nut p phi uniform
The 10 directory holds the final solved velocity field U, pressure p, turbulence fields epsilon, k and nut, and the face flux phi. Derive quantities from the solved fields with the postProcess utility, for example the Cartesian components of velocity at the latest time:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
postProcess -func 'components(U)' -latestTime 2>&1 | tail -8
Expected output
Executing functionObjects
functionObjects::components components(U) writing field: Ux
functionObjects::components components(U) writing field: Uy
functionObjects::components components(U) writing field: Uz
End
postProcess has written the individual velocity components alongside the solved fields, ready to sample, plot or export. This is a complete CFD workflow, geometry to mesh to solution to derived quantities, run entirely from the command line.

Visualise the results
paraFoam launches ParaView on the case for interactive 3D visualisation. ParaView is a graphical application, so use it either over an X11 forwarded SSH session (ssh -X azureuser@<vm-ip>) or, more commonly for a headless server, by generating a case file and opening the results on your own workstation's ParaView:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
touch case.foam
Then copy the case directory to a machine with ParaView installed and open case.foam, or run paraFoam directly if you have an X server. For automated or batch post processing, the postProcess utility and the function object framework (sampling lines and surfaces, computing forces, integrating fluxes) cover most needs without a GUI.
Run in parallel
Real cases are solved across multiple cores. OpenFOAM decomposes the mesh with decomposePar, runs the solver under MPI, then reconstructs the result. On a multi core VM:
. /opt/openfoam14/etc/bashrc
cd "$HOME/run/cavity"
# write a decomposeParDict for N subdomains (create one if the case has none)
decomposePar -force > log.decomposePar 2>&1
mpirun -np 4 foamRun -parallel > log.foamRun.parallel 2>&1
reconstructPar > log.reconstructPar 2>&1
tail -3 log.reconstructPar
Set numberOfSubdomains to the number of cores you want to use and keep it at or below the VM's vCPU count. decomposePar splits the mesh into that many subdomains, mpirun -np N foamRun -parallel solves them together, and reconstructPar merges the per processor results back into single time directories. The cavity is far too small to benefit from parallelism, but the workflow is identical for a production mesh where it is essential.
Server components
| Component | Version | Purpose |
|---|---|---|
OpenFOAM (openfoam14) |
20260724 (release 14) | Full CFD toolkit: solvers, meshers, utilities, tutorials |
blockMesh, snappyHexMesh |
14 | Mesh generation |
foamRun, foamMultiRun |
14 | Modular solver runtime |
checkMesh, postProcess, foamDictionary |
14 | Mesh validation, post processing, case editing |
ParaView / paraFoam |
bundled with OpenFOAM 14 | Visualisation |
| Open MPI | Ubuntu 24.04 | Parallel (distributed) solver runs |
| Ubuntu Server | 24.04 LTS | Operating system |
Filesystem layout
| Path | Purpose |
|---|---|
/opt/openfoam14 |
The OpenFOAM 14 installation (binaries, libraries, source, docs) |
/opt/openfoam14/etc/bashrc |
The OpenFOAM environment file |
/opt/openfoam14/platforms/linux64GccDPInt32Opt/bin |
Solver, mesher and utility binaries |
/opt/openfoam14/tutorials |
The full tutorials tree, one directory per solver family |
/opt/openfoam14/COPYING |
The GNU General Public License version 3 |
/etc/profile.d/openfoam.sh |
Loads the OpenFOAM environment for interactive login shells |
/etc/apt/sources.list.d/openfoam.list |
The openfoam.org apt source, for updates |
$HOME/run |
Suggested working directory for your own cases (not created by the image) |
Network ports
| Port | Bound to | Purpose |
|---|---|---|
| 22 | all interfaces | SSH administration and command line access |
This appliance runs no network service and opens no other port. Restrict TCP 22 to your own management address range in the Network Security Group.
Keeping OpenFOAM up to date
The openfoam.org apt source ships in the image, so you can pull newer OpenFOAM 14 point releases as the Foundation publishes them:
sudo apt update
sudo apt install --only-upgrade openfoam14
To move to a future major release (for example a later openfoamNN package), install that package alongside; openfoam.org packages coexist under /opt, and you select one by sourcing its own etc/bashrc.
Troubleshooting
blockMesh: command not found or the OpenFOAM commands are missing. The environment is not loaded in this shell. Source it: . /opt/openfoam14/etc/bashrc. It loads automatically for interactive login shells; non login shells and scripts must source it explicitly.
FOAM FATAL IO ERROR or cannot find file when running a solver. You are not in a valid case directory, or the mesh has not been generated yet. Change into the case directory and run blockMesh before foamRun.
FOAM FATAL ERROR: ... has not been read or a missing dictionary. The case is incomplete or the module named by solver in system/controlDict does not match the case's fields. Start from a copy of a bundled tutorial, which is internally consistent, and modify it incrementally.
A parallel run fails to start. Check that numberOfSubdomains in system/decomposeParDict matches the -np value passed to mpirun, and that it does not exceed the VM's vCPU count. Run decomposePar -force again after changing it.
Confirm the toolkit at any time:
. /opt/openfoam14/etc/bashrc
echo "$WM_PROJECT_VERSION"
foamInstallationTest 2>&1 | tail -20
foamInstallationTest walks the whole installation and reports each component as ok.
Security recommendations
-
Restrict TCP 22 to your own address range. SSH is the only listener; scope the Network Security Group rule to your management network rather than opening it to the internet.
-
Run simulations as a normal user, not root. OpenFOAM is designed to run as an ordinary user. The
azureuseraccount is all you need. -
Keep OpenFOAM and the operating system updated with the commands above, and leave unattended security upgrades enabled.
-
Take Azure snapshots or store results off the VM. Simulation output on the OS disk is not backed up; copy finished cases to blob storage or snapshot the disk on a schedule that matches how much compute you can afford to repeat.
Support
cloudimg images are backed by 24/7 support. For help with this image, contact support through the Azure Marketplace listing or visit www.cloudimg.co.uk.
OPENFOAM is a registered trademark of OpenCFD Ltd, and is used here nominatively only to identify the software packaged. This image packages the unmodified OpenFOAM Foundation (openfoam.org) distribution of OpenFOAM 14, which is distributed under the GNU General Public License version 3; the licence text ships on the image at /opt/openfoam14/COPYING. cloudimg is not affiliated with, endorsed by, or sponsored by OpenCFD Ltd or the OpenFOAM Foundation.