Skip to content
CloudTAK Documentation
GitHub

CloudTAK Deploy

Run CloudTAK with Docker Compose, or deploy it into AWS with the provided infrastructure templates.

Introduction

CloudTAK is designed to be deployed into one of two different environments; a full AWS deployment via provided Infrastructure as Code (IaC) templates, or into a on-prem or alternate cloud environment via provided Docker Compose files.

Both paths end with the same step: opening the Web UI for the first time and uploading a TAK Server administrative certificate, which must be generated as described in TAK Server Admin Certificate.

TAK Server Admin Certificate

CloudTAK talks to the TAK Server through a single administrative client certificate, the Admin Connection. You upload it as a .p12 on the setup page the first time you open the Web UI, and you can replace it later from Admin Panel → Server → Connection.

The certificate must be channels disabled. When a certificate is issued through the TAK Server’s Certificate Enrollment API (the path ATAK, WebTAK and CloudTAK user logins take) the TAK Server adds an extra Extended Key Usage OID, 1.2.840.113549.1.9.7, that marks it as channels enabled. A channels enabled certificate is scoped to the channels currently selected for that user, so CloudTAK cannot see every group on the server and the CoreDevice and CoreEvents functionality will not work. Never reuse a certificate enrolled through ATAK, WebTAK, or a CloudTAK user login as the Admin Connection.

The Server Connection page shows Channels Enabled: Enabled or Disabled for the certificate currently loaded, so you can confirm the state after uploading.

Generate the certificate with the makeCert.sh script that ships with the TAK Server. It signs against the [ client ] profile in config.cfg, which only sets the clientAuth usage and therefore produces a channels disabled certificate.

  1. On the TAK Server, as the tak user, generate a client certificate. The common name is up to you; it becomes the Admin Connection’s identity.

    cd /opt/tak/certs
    ./makeCert.sh client cloudtak-admin

    The certificate, key, and cloudtak-admin.p12 are written to /opt/tak/certs/files/. The P12 password is the PASS value from cert-metadata.sh, which is atakatak unless you changed it.

  2. Grant the certificate administrator rights on the TAK Server.

    java -jar /opt/tak/utils/UserManager.jar certmod -A /opt/tak/certs/files/cloudtak-admin.pem
  3. Optionally confirm the certificate is channels disabled. The output should list only TLS Web Client Authentication.

    openssl x509 -in /opt/tak/certs/files/cloudtak-admin.pem -noout -ext extendedKeyUsage
  4. Copy cloudtak-admin.p12 to your workstation and upload it, with its password, as the Admin Certificate on the CloudTAK setup page.

Building Images

CloudTAK runs as four container images, all built from the root of the CloudTAK repository:

Image Dockerfile Purpose
api Dockerfile API server and Web UI
pmtiles tasks/pmtiles/Dockerfile.compose Tile server (tiles service in Docker Compose)
events tasks/events/Dockerfile Import and event processing
retention tasks/retention/Dockerfile.compose Scheduled data retention

Tagged releases are also published to the GitHub Container Registry as ghcr.io/dfpc-coe/cloudtak-<image>:<tag>, but both deployment paths below build the images themselves so that the result matches the checked out git revision and, optionally, includes plugins.

Prerequisites

Building requires Docker Engine with the Buildx and Compose plugins. On Ubuntu, ./cloudtak.sh install installs them for you as part of the Docker Compose setup. To install Docker by hand, follow the Docker Engine install guide and make sure your user is in the docker group:

Terminal window
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world

Pushing to AWS additionally requires Node.js (24 or newer) and the AWS CLI with credentials for the target account.

Building locally

From the root of the repository, Docker Compose builds every image using the docker-compose.yml service definitions:

Terminal window
git clone https://github.com/dfpc-coe/CloudTAK.git
cd CloudTAK
docker compose build

Build a single service by name, for example only the API:

Terminal window
docker compose build api

The resulting images are tagged cloudtak-api, cloudtak-tiles, cloudtak-events and cloudtak-retention and are picked up automatically by ./cloudtak.sh start or docker compose up.

To build an image outside of Compose, point docker build at the relevant Dockerfile with the repository root as the build context:

Terminal window
docker build -f Dockerfile -t cloudtak-api .
docker build -f tasks/pmtiles/Dockerfile.compose -t cloudtak-tiles .

The api image runs the web client lint, type-check and build steps as well as the API lint and build, so a build failure usually points at a code error rather than a Docker problem. On first build, the Dockerfile also downloads the CloudTAK-Data release archive containing default icons and basemaps. In an environment without access to GitHub, place the archive at api/data.zip and build with --build-arg USE_LOCAL_ZIP=true.

Building with plugins

Plugins are compiled into the Web UI at build time, so the set of plugins is fixed when the api image is built. For Docker Compose, list them in the WEB_PLUGINS variable of your .env file as comma-separated git URLs, optionally pinned to a tag, branch or commit with #<ref>:

Terminal window
WEB_PLUGINS=https://github.com/org/plugin-a.git#v1.2.0,https://github.com/org/plugin-b.git

Every Compose build reads this value, so docker compose build, ./cloudtak.sh install and ./cloudtak.sh update all produce an api image containing the listed plugins. During the build, CloudTAK clones each repository into app/plugins/<name>/, copies any public/ assets, and bundles the plugin into the web client. Leave WEB_PLUGINS empty for an image with no plugins.

After changing the list, rebuild the api image and restart:

Terminal window
docker compose build api
./cloudtak.sh start

When building with plain docker build, pass the same value as a build argument:

Terminal window
docker build -f Dockerfile --build-arg WEB_PLUGINS="https://github.com/org/plugin-a.git#v1.2.0" -t cloudtak-api .

Pushing to AWS

The AWS deployment runs the images from the ECR repository created by the VPC stack, named tak-vpc-<environment>-cloudtak-api. All four images share this one repository and are distinguished by tag: the API image is tagged with the git SHA, and the task images are prefixed, for example pmtiles-<sha>. The CloudTAK CloudFormation stack takes the git SHA as its GitSha parameter and resolves the image tags from it.

The repository ships a build script that builds each image for linux/amd64, logs in to ECR, and pushes the result. Run it from the root of the repository with the following environment variables set:

Variable Description
AWS_ACCOUNT_ID AWS account that owns the ECR repository
AWS_REGION Region of the ECR repository
Environment Name of the VPC stack environment, for example prod. A comma-separated list builds once and pushes to each

AWS credentials must also be available in the shell, either from aws configure or from $(deploy env --profile <profile> --region <region>) if you use the deploy tooling described in AWS Deployment.

Terminal window
cd CloudTAK
npm install
export AWS_ACCOUNT_ID=<account-id>
export AWS_REGION=<region>
export Environment=<environment>
npm run build

With no arguments the script builds and pushes all four images. Pass an image name to build only that one:

Terminal window
npm run build -- api
npm run build -- pmtiles
npm run build -- events
npm run build -- retention

To include plugins in the pushed api image, pass each plugin repository with a --plugin flag. The script resolves the current HEAD of each plugin repository and pins the build to that commit so that the image is reproducible:

Terminal window
npm run build -- api \
--plugin https://github.com/org/plugin-a.git \
--plugin https://github.com/org/plugin-b.git

The images are tagged with the git SHA of the CloudTAK checkout, so commit any local changes before building and pass the same SHA as the GitSha parameter when creating or updating the CloudFormation stack. The deploy tooling does this automatically from the current checkout.

Docker Compose Deployment

Initial Install & Setup

The following instructions will guide you through deploying CloudTAK using Docker Compose

The following are pre-requisites for a Docker Compose deployment:

  • Working TAK Server
  • TAK Server Admin Credentials
  • A channels disabled TAK Server admin certificate, see TAK Server Admin Certificate
  • Linux Distribution (Ubuntu 24.04+ recommended)

Note: commands below assume Ubuntu

  1. Before you start the install, ensure you have the following DNS records created for your domain.

    Record Type Hostname Points To Example
    A map.<yourdomain> CloudTAK API & Web UI map.cotak.gov
    A tiles.map.<yourdomain> CloudTAK Tile Server tiles.map.cotak.gov
  2. Ensure Ubuntu Version is 24.04 or greater

    lsb_release -a
  3. Navigate to the desired install directory, in this guide we will assume the Home directory of the user. While CloudTAK can be installed using root, it is not recommended for security reasons and a non-root user should be used.

    cd ~/
  4. Clone the CloudTAK Repository

    git clone https://github.com/dfpc-coe/CloudTAK.git
  5. Navigate into the new git Directory created in the last step

    cd CloudTAK
  6. Install necessary system dependencies

    ./cloudtak.sh install
  7. Edit the Environment Variable file:

    nano .env

    To include plugins in the Web UI, set WEB_PLUGINS to a comma-separated list of git URLs, see Building with plugins. The image is built with the plugins listed here and rebuilt with them on every update.

  1. Start the Docker Containers
./cloudtak.sh start
  1. Navigate to https://map.<yourdomain> and complete the setup page, uploading the admin certificate .p12 generated in TAK Server Admin Certificate.

Updating CloudTAK

  1. Navigate to the CloudTAK directory

    cd CloudTAK
  2. Run the provided CloudTAK Update Script

    ./cloudtak.sh update

    It will prompt you to perform a database backup before proceeding with the update, we recommend you always do so.

Runtime Configuration

CloudTAK stores almost all operational settings in the database and exposes them through the administrative interface. That is the preferred way to manage day-to-day settings after the platform is running.

You can also provide configuration values as environment variables at startup. When an environment variable is present, it overrides the matching value stored in the database for that process launch.

Mapping CloudTAK config keys to environment variables

Any configuration key exposed by the POST /config API can be set with an environment variable during startup.

Use the following rules:

  • Prefix the key with CLOUDTAK_Config_
  • Replace every :: sequence with _
  • Preserve the original case of the key after the prefix

Examples:

  • media::url becomes CLOUDTAK_Config_media_url
  • group::Brown becomes CLOUDTAK_Config_group_Brown

AWS custom resource naming overrides

If you deploy with the provided CloudFormation templates, CloudTAK populates these values for you and you usually do not need to set them manually. Override them only if you are integrating CloudTAK with pre-existing AWS resources or custom naming conventions.

Variable Name Description
ECR_TASKS_REPOSITORY_NAME ECR repository used for ETL task images
ECS_CLUSTER_PREFIX Prefix used when resolving ECS cluster names

DNS Configuration

Final DNS Configuration should have the following entries:

Record Type Hostname Points To Example
A <sub>.example.com CloudTAK API & Web UI map.example.com
A <sub>.example.com CloudTAK Media Server video.example.com
A tiles.<sub>.example.com CloudTAK Tile Server tiles.map.example.com

Note that the relationship between subdomains in the tree is important as CloudTAK will automatically generate Content Security Policy (CSP) headers that allow the API & Web UI to access the Media and Tile servers.

The following rules must be adhered to unless customizing the nginx configuration files directly:

  • The API & Web UI must be on the same level subdomain (e.g. map.example.com & video.example.com)
  • The Tile server must be on a subdomain of the API & Web UI (e.g. tiles.map.example.com) AND must be named tiles

AWS Deployment

Initial Install & Setup

The following instructions will guide you through deploying CloudTAK using AWS CloudFormation

Before you begin, make sure any prerequisite infrastructure required by your environment already exists. At minimum, CloudTAK expects a VPC and supporting networking stack where it can place ECS tasks and related resources.

Name Notes
coe-vpc-<name> VPC, networking, and related AWS infrastructure for the deployment environment
  1. Ensure you have NodeJS installed locally. The install instructions assume an Ubuntu Command line, Windows Subsystem for Linux (WSL) is recommended for Windows users.
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
nvm install 24
  1. Ensure the AWS CLI is installed and a new profile is configured in your ~/.aws/credentials file.
# Install AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws configure --profile <name>
  1. Install the CloudTAK Deploy Tooling
npm install -g @openaddresses/deploy
  1. Configure your AWS CLI with an IAM User that has permissions to create CloudFormation stacks

Note: Ensure the profile used in the next step matches the profile name you set in the AWS CLI configuration

deploy init
  1. Create a new folder to hold CloudTAK specific configuration
mkdir -p ~/Development/dfpc-coe
cd ~/Development/dfpc-coe
  1. Install the VPC Infrastructure

Note: You must have an active Route53 Hosted Zone for the domain you plan to use with CloudTAK

The VPC stack will provision necessary networking components including VPCs, Subnets, Security Groups, NAT Gateways, in addition to Amazon Certificate Manager (ACM) certificates for use with CloudTAK. As part of this process, a DNS valdation check will be performed.

git clone git@github.com:dfpc-coe/vpc
cd vpc
npm install
deploy create <stack-name> --profile <profile> --region <region>
  1. Build and publish the CloudTAK container images

CloudTAK ships with a script to build the required images and push them to the ECR repository created by the VPC stack. Run these commands from the root of the CloudTAK repository after you clone it, see Pushing to AWS for the full set of options, including building the api image with plugins.

Make sure the VPC stack has finished deploying and that your AWS credentials are available in the current shell, because the build process performs aws ecr get-login-password as part of the push flow.

Terminal window
cd ~/Development/dfpc-coe
git clone git@github.com:dfpc-coe/CloudTAK
cd CloudTAK
npm install
$(deploy env --profile <profile> --region <region>)
AWS_ACCOUNT_ID=<account-id> AWS_REGION=<region> Environment=<stack-name> npm run build
  1. Install the CloudTAK Infrastructure

Note: The stack name must match the stack name used in the VPC deployment step. Each stack will be prefixed by the name of the git repository.

cd ~/Development/dfpc-coe
$(deploy env --profile <profile> --region <region>)
Environment='<stack-name>' node bin/build.js
deploy create <stack-name> --template cloudformation/webhooks.template.js --profile <profile> --region <region>
deploy create <stack-name> --profile <profile> --region <region>
deploy update <stack-name> --profile <profile> --region <region>
deploy info <stack-name> --outputs --profile <profile> --region <region>
deploy info <stack-name> --parameters --profile <profile> --region <region>
  1. Navigate to https://map.<yourdomain> to access the CloudTAK Web UI and complete the setup page, uploading the admin certificate .p12 generated in TAK Server Admin Certificate.

The webhooks stack creates the API Gateway resources used for inbound ETL data events and internal webhook processing.

If you prefer not to install deploy globally, the same commands can be run with npx deploy ... from the repository root.

For a full list of supported actions, run:

Terminal window
deploy --help
deploy info --help

Optional dependencies

The following components can be deployed later if your environment needs them:

Name Notes
coe-media-<name> Media-server task definitions and supporting infrastructure

S3 Bucket Configuration

CloudTAK will use a single S3 compatible store for storing assests including map tiles, user uploaded files, and other static content.

If you are using the provided AWS CloudFormation Or Docker Compose file, this bucket will be created for you. In AWS this will be created with a native S3 bucket, while Docker Compose will deploy a Minio instance to provide S3 compatible storage.

The following key prefixes will be used within the S3 Bucket:

Prefix Management Description
attachment/{sha256}/{file.ext} Automated CoT Attachments by Data Package reported SHA
import/{UUID}/{file.ext} Automated Initial User File Uploads
profile/{email}/{file.ext} Automated User Files & Cloud Optimized outputs from Import process
public/{name}.pmtiles User Provided Public Tile Pyramids

Public Tile Pyramids

Public Tile Pyramids are user provided PMTiles files that are made available to any authenticated CloudTAK User.

While the server will immediately host tile requests for any uploaded PMTiles file, for users to see the Tile source in the UI, an entry must be created via the Admin Overlay Console and set to Public for users to have a UI driven method for discovering and using the Tile source.