This guide describes how to build and run a Range Cloud instance as a Docker or Podman container. The process has two stages:
- Generate — run
scripts/generate_containerfile.shto produce a ready-to-use build context (Containerfile + entrypoint script) with all deployment parameters baked in. - Build and run — build the container image and start the container using Docker or Podman.
All Range Cloud setup steps (Certificate Authority creation, self-signed host certificate generation, cloud service configuration) happen during docker build / podman build. The admin account is configured automatically on the first container start.
- Docker or Podman installed on the build host
- The Range Cloud package file:
range-cloud-<version>-linux-x86_64.tar.gz - Bash
scripts/generate_containerfile.sh --package-file=FILENAME [OPTION]...
| Parameter | Required | Default | Description |
|---|---|---|---|
--package-file=FILENAME |
Yes | — | Path to the range-cloud .tar.gz package |
--host-name=NAME |
No | my-cloud-host.com |
Host name embedded in generated certificates |
--admin-account=EMAIL |
No | admin@my-cloud-host.com |
Administrator account email address |
--public-port=PORT |
No | 4011 |
Public HTTP port exposed by the container |
--private-port=PORT |
No | 4012 |
Private HTTP port used for administration |
--ca-country=CODE |
No | EU |
Two-letter country code for the CA certificate |
--ca-state=NAME |
No | CZ |
State or region for the CA certificate |
--ca-location=NAME |
No | Prague |
City for the CA certificate |
--ca-organization=NAME |
No | Range Software |
Organization for the CA certificate |
--ca-organization-unit=NAME |
No | Cloud |
Organizational unit for the CA certificate |
--ca-email=EMAIL |
No | admin@my-cloud-host.com |
Contact email embedded in the CA certificate |
--base-image=IMAGE |
No | ubuntu:24.04 |
Base image for the generated Containerfile |
--output-dir=DIR |
No | . (current directory) |
Directory where generated files are written |
--help, -h |
No | — | Print help and exit |
The script writes three files to --output-dir:
| File | Description |
|---|---|
Containerfile |
Build instructions for Docker / Podman |
entrypoint.sh |
Container startup script |
<package>.tar.gz |
Copy of the package (required in the build context) |
- Installs
opensslon the base image. - Extracts the package to a temporary directory.
- Runs
ca_setup.shto create a local Certificate Authority at/root/range-ca. - Runs
ca_create_signed_certificate.shto generate a self-signed host key and certificate at/root/range-cloud/etc/ssl/certs/. - Runs
cloud_setup.shto install and configure the Range Cloud service at/root/range-cloud. - Cleans up the extracted package and temporary files.
All configuration values (--host-name, --ca-*, ports) are expanded and embedded in the Containerfile at generation time — no build arguments are required when building the image.
Every start:
- Starts the Range Cloud service via
cloud_start.sh. - Registers a signal handler: on
SIGTERMorSIGINTit callscloud_stop.shbefore the container exits.
First start only (detected via a .configured sentinel file):
- Polls
cloud_status.shup to 30 times (2-second intervals) until the service is ready. - Creates the administrator account using
cloud-tool --user-add. - Assigns the administrator to the
usersandrootgroups usingcloud-tool --user-update. - Writes a
.configuredmarker so this step is skipped on all subsequent starts.
Run the script from the project root, pointing to the package file and providing your deployment values.
scripts/generate_containerfile.sh \
--package-file=/path/to/range-cloud-<version>-linux-x86_64.tar.gz \
--host-name=my-cloud-host.com \
--admin-account=admin@my-cloud-host.com \
--output-dir=./container-buildThe script prints the exact build and run commands to use once it completes.
# Docker
docker build -t range-cloud ./container-build
# Podman
podman build -t range-cloud ./container-buildThe build may take several minutes while the CA and cloud service are configured inside the image.
# Docker
docker run -d \
--name range-cloud \
-p 4011:4011 \
-p 4012:4012 \
range-cloud
# Podman
podman run -d \
--name range-cloud \
-p 4011:4011 \
-p 4012:4012 \
range-cloudOn first start, the container configures the admin account before becoming fully operational. Allow a few seconds after docker run returns before connecting.
docker logs -f range-cloud
podman logs -f range-cloudSends SIGTERM; the entrypoint calls cloud_stop.sh before exiting.
docker stop range-cloud
podman stop range-clouddocker restart range-cloud
podman restart range-cloudAdmin account configuration is skipped on restart because the .configured sentinel persists inside the container.
docker rm -f range-cloud
podman rm -f range-cloudBy default, all service data (including the .configured sentinel, user data, and certificates) lives inside the container at /root/range-cloud. Removing the container with docker rm permanently deletes this data.
To persist data across container recreations, mount a volume over the cloud data directory:
docker run -d \
--name range-cloud \
-p 4011:4012 \
-p 4012:4012 \
-v range-cloud-data:/root/range-cloud \
range-cloudNote: On the very first run with an empty named volume, Docker copies the image contents into the volume. On subsequent runs the volume contents are used as-is, including the
.configuredsentinel, so the admin account setup is not repeated.
scripts/generate_containerfile.sh \
--package-file=range-cloud-1.0.4-linux-x86_64.tar.gz \
--host-name=cloud.example.org \
--admin-account=sysadmin@example.org \
--public-port=8011 \
--private-port=8012 \
--output-dir=./container-buildscripts/generate_containerfile.sh \
--package-file=range-cloud-1.0.4-linux-x86_64.tar.gz \
--host-name=cloud.example.org \
--admin-account=sysadmin@example.org \
--ca-country=US \
--ca-state=California \
--ca-location="San Francisco" \
--ca-organization="Example Corp" \
--ca-organization-unit=Engineering \
--ca-email=pki@example.org \
--output-dir=./container-buildscripts/generate_containerfile.sh \
--package-file=range-cloud-1.0.4-linux-x86_64.tar.gz \
--base-image=debian:12 \
--output-dir=./container-buildNote: The generated Containerfile installs
opensslviaapt-get. If you change to a non-Debian base image you will need to edit the generatedContainerfileto use the appropriate package manager.