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.
-
On the TAK Server, as the
takuser, 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-adminThe certificate, key, and
cloudtak-admin.p12are written to/opt/tak/certs/files/. The P12 password is thePASSvalue fromcert-metadata.sh, which isatakatakunless you changed it. -
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 -
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 -
Copy
cloudtak-admin.p12to 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:
sudo usermod -aG docker $USERnewgrp dockerdocker run hello-worldPushing 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:
git clone https://github.com/dfpc-coe/CloudTAK.gitcd CloudTAK
docker compose buildBuild a single service by name, for example only the API:
docker compose build apiThe 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:
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>:
WEB_PLUGINS=https://github.com/org/plugin-a.git#v1.2.0,https://github.com/org/plugin-b.gitEvery 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:
docker compose build api./cloudtak.sh startWhen building with plain docker build, pass the same value as a build argument:
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.
cd CloudTAKnpm install
export AWS_ACCOUNT_ID=<account-id>export AWS_REGION=<region>export Environment=<environment>
npm run buildWith no arguments the script builds and pushes all four images. Pass an image name to build only that one:
npm run build -- apinpm run build -- pmtilesnpm run build -- eventsnpm run build -- retentionTo 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:
npm run build -- api \ --plugin https://github.com/org/plugin-a.git \ --plugin https://github.com/org/plugin-b.gitThe 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
-
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 -
Ensure Ubuntu Version is 24.04 or greater
lsb_release -a -
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 ~/ -
Clone the CloudTAK Repository
git clone https://github.com/dfpc-coe/CloudTAK.git -
Navigate into the new git Directory created in the last step
cd CloudTAK -
Install necessary system dependencies
./cloudtak.sh install -
Edit the Environment Variable file:
nano .envTo include plugins in the Web UI, set
WEB_PLUGINSto 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.
- Start the Docker Containers
./cloudtak.sh start- Navigate to
https://map.<yourdomain>and complete the setup page, uploading the admin certificate.p12generated in TAK Server Admin Certificate.
Updating CloudTAK
-
Navigate to the CloudTAK directory
cd CloudTAK -
Run the provided CloudTAK Update Script
./cloudtak.sh updateIt 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::urlbecomesCLOUDTAK_Config_media_urlgroup::BrownbecomesCLOUDTAK_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 namedtiles
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 |
- 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 NVMcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bashnvm install 24- Ensure the AWS CLI is installed and a new profile is configured in your
~/.aws/credentialsfile.
# Install AWS CLIcurl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/installaws configure --profile <name>- Install the CloudTAK Deploy Tooling
npm install -g @openaddresses/deploy- 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- Create a new folder to hold CloudTAK specific configuration
mkdir -p ~/Development/dfpc-coecd ~/Development/dfpc-coe- 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/vpccd vpcnpm install
deploy create <stack-name> --profile <profile> --region <region>- 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.
cd ~/Development/dfpc-coegit clone git@github.com:dfpc-coe/CloudTAKcd CloudTAKnpm install
$(deploy env --profile <profile> --region <region>)AWS_ACCOUNT_ID=<account-id> AWS_REGION=<region> Environment=<stack-name> npm run build- 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>- Navigate to
https://map.<yourdomain>to access the CloudTAK Web UI and complete the setup page, uploading the admin certificate.p12generated 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:
deploy --helpdeploy info --helpOptional 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.