Docker container for URBANopt CLI on Ubuntu 22.04.
This repository contains a Dockerfile that builds a Docker container with URBANopt CLI installed on Ubuntu 22.04. The container is automatically built, tested, and pushed to Docker Hub via GitHub Actions.
- URBANopt CLI: Pre-installed and configured
- Ubuntu 22.04: Base image with all required dependencies
- Automated CI/CD: GitHub Actions workflow for building, testing, and publishing
- Versioning: Automatic semantic versioning via Git tags
docker pull nrel/docker-urbanopt:latest# Run with default command (shows version)
docker run --rm nrel/docker-urbanopt:latest
# Run interactively
docker run -it --rm nrel/docker-urbanopt:latest bash
# Run with a mounted workspace
docker run -it --rm -v $(pwd):/work nrel/docker-urbanopt:latestdocker build -t docker-urbanopt:latest .For a single-server cloud deployment (for example, an AWS EC2 instance), the simplest and most reproducible approach is to run URBANopt inside a Docker container. This avoids installing URBANopt directly on the virtual machine and makes upgrades, rollbacks, and environment consistency as simple as changing the container tag.
In this workflow, URBANopt runs entirely inside a container, while project files and simulation outputs live on the host filesystem.
URBANopt CLI commands and workflows are unchanged. You will still use familiar commands such as uo create, uo run, uo process, and related workflows — the only difference is that these commands are executed inside the container rather than directly on the host operating system.
Launch a Linux-based virtual machine on your preferred cloud platform:
- AWS EC2
- Azure Virtual Machines
- Google Compute Engine
- On-premise or HPC cloud nodes
Recommended configuration
- Ubuntu 22.04 LTS
- Adequate CPUs for parallel simulations
- Sufficient disk space for OpenStudio/EnergyPlus outputs
Once the instance is running, connect using SSH:
ssh user@your-instance-ip
All remaining steps are performed inside this SSH session.
Most cloud VMs do not include Docker by default.
On Ubuntu 22.04:
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl enable docker
sudo systemctl start docker
Managed container services (AWS ECS, AWS Batch, Kubernetes) already include Docker and do not require this step.
This guide assumes your URBANopt project is stored in a Git repository and cloned onto the instance:
git clone https://github.com/your-org/your-urbanopt-project.git
cd your-urbanopt-project
Other transfer methods (for example, SCP, rsync, or cloud storage downloads) may also be used.
URBANopt is provided as a prebuilt Docker image on Docker Hub:
nrel/docker-urbanopt:1.1.0
Pull the image locally:
docker pull nrel/docker-urbanopt:1.1.0
Run URBANopt by mounting the project directory into the container:
docker run --rm -it \
-v "$(pwd):/work" \
nrel/docker-urbanopt:1.1.0 \
uo run -f example_uo/example_project.json \
-s example_uo/baseline_scenario.csv
example_project.jsonandbaseline_scenario.csvare example files provided by URBANopt- User projects will typically use different filenames
- URBANopt CLI usage and workflows are unchanged from a native installation
Because the project directory is mounted into the container, all outputs are written directly to the host filesystem.
For example:
/work/example_uo/run/
maps to:
your-urbanopt-project/example_uo/run/
No results are stored only inside the container.
The number of parallel URBANopt simulations is controlled in runner.conf:
num_parallel = 10
The container uses the CPUs available on the host VM. No special Docker configuration is required on Linux-based cloud instances.
The same container can be used on Windows with Docker Desktop:
docker run --rm -it ^
-v "C://path//to//urbanopt-project://work" ^
nrel/docker-urbanopt:1.1.0 ^
uo run -f example_uo/example_project.json ^
-s example_uo/baseline_scenario.csv
Ensure Docker Desktop is configured with enough CPUs to match num_parallel.
The repository includes a GitHub Actions workflow that:
- Builds the Docker container
- Tests the container by running
uo --version - Pushes to Docker Hub with appropriate tags:
latest- for commits to main/master branch<branch>- for branch commitsv1.0.0,v1.0,v1- for semantic version tags<branch>-<sha>- for commit SHA references
To enable automatic pushing to Docker Hub, configure the following repository secrets:
- Go to your repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add the following secrets:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_PASSWORD: Your Docker Hub password or access token
To create a new versioned release:
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0The Dockerfile supports both x86_64 (default) and arm64 architectures. To build for a specific architecture, use the UO_ARCH build argument:
# Build for x86_64 (default)
docker build -t urbanopt-cloud:x86_64 .
# Build for arm64
docker build --build-arg UO_ARCH=arm64 -t urbanopt-cloud:arm64 .See the URBANopt CLI license for details.