Part 9 of TAK: From Two Phones to a Global Platform
Federation: Two TAK Servers, One Shared Picture
So far, our users and feeds have connected to one TAK Server. When two agencies respond to the same incident, they may want to share tracks while keeping separate servers, users and certificate authorities. They can exchange public CA certificates without sharing CA private keys or giving either agency authority to issue the other’s user certificates.
Federation connects two TAK Servers so they share data, while each keeps its own users and trust. This article runs a second TAK Server on the same computer, as a separate organization, federates the two directly, and limits what crosses between them. Then it puts TAK Federation Hub in the middle, so the servers connect to the hub instead of to each other, and a policy on the hub decides what flows where.
What you’ll need
The setup from the previous articles, with TAK Server running and both ATAK devices connected. This article adds federation settings and a script, so update your copy first:
cd tak-stack
git stash
git pull
git stash pop
The second server needs another set of TAK Server containers, and Federation Hub needs its own container later. In my tests, server B used about 3.8 GB of memory and the hub about 1.7 GB. With CloudTAK from the seventh article also running, server B’s API didn’t start until I stopped CloudTAK, so stop it for this article if Docker is short of memory:
cd tak-stack/compose/cloudtak
docker compose stop
Leave the feeds from the last article running. They show which groups cross.
For the Federation Hub section, you’ll need one more download from tak.gov: takserver-fedhub-docker-<version>.zip (how to download). It’s separate from the TAK Server release. I tested 5.8-RELEASE-92.
How federation works
Two TAK Servers federate over a dedicated port, 9001 here. One server connects to the other, using its own server certificate as a client certificate. The other checks that certificate against a separate truststore that holds only its federation partners’ CAs.
That separate truststore is the point. Server A trusts server B’s CA for federation, but not for its own users. So B’s server can connect to A’s federation port, but B’s users can’t connect to A directly. Each organization keeps control of who holds its certificates.
What crosses is decided by groups, at both ends:
- What A shares with B: A’s outbound groups for B. Data in those groups goes to B.
- Where B’s data lands on A: A’s inbound groups for B. B’s data joins those groups on A, and A’s users in them see it.
B makes the same two choices for A. Neither side controls what the other does with data once it arrives.
Start a second server
setup.sh can now create a second, separate server in the same folder:
cd tak-stack/compose/takserver
./setup.sh --instance b
It copies your settings into config-b/, gives the new server its own CA name, TAK-STACK-B-CA, and its own passwords. It keeps the location and address settings, and clears the ones that belong to server A: USERS, CLIENT_CERTS, USER_GROUPS, REVOKE and the federation settings. Its host ports are 10000 higher than the first server’s: 18089, 18443, 18446 and 19001. Inside its container, it still listens on 8089, 8443, 8446 and 9001.
In config-b/takserver.env, give it one user and turn on federation. B shares and receives __ANON__, its default group, and waits for A to connect:
USERS=echo-1
FEDERATION=true
Then create the user’s password and start it:
./setup.sh --instance b
docker compose --env-file config-b/compose.env up -d
Server B is now a separate TAK Server, with its own database and certificates. Nothing connects the two yet.
Exchange CAs
Each server needs the other’s public CA certificates. From tak-stack/compose/takserver, ./share-ca.sh exports them without any private keys:
./share-ca.sh
./share-ca.sh --instance b
Use the filenames printed by the scripts. Following the root rotation in article 6, A’s CA is named TAK-STACK-CA-2026, so the example below uses TAK-STACK-CA-2026.pem. If you chose another name, substitute the actual export filename. Each file holds the root and the intermediate. Swap them:
cp TAK-STACK-B-CA.pem config/federation/
cp TAK-STACK-CA-2026.pem config-b/federation/
Between two real organizations, this is the step that happens by email or in a meeting. Check the certificate’s fingerprint with your partner by phone, rather than trusting whatever arrives in an inbox.
Connect them
Only one server needs to connect. In config/takserver.env, for server A:
FEDERATION=true
FEDERATE_WITH=host.docker.internal:19001
FEDERATION_SHARE=blue
FEDERATION_RECEIVE=blue
host.docker.internal lets A’s container reach B’s port on this computer. Between real servers, it’s the other server’s address and port 9001.
Restart both servers so they load the new CAs:
docker compose --env-file config-b/compose.env up -d --force-recreate tak-certs takserver
docker compose up -d --force-recreate tak-certs takserver
A’s log shows federation starting, from docker compose logs takserver:
Federation on: port 9001, connecting to host.docker.internal:19001, sharing blue, receiving into blue
TAK Server’s own log, takserver-messaging.log, shows the connection:
Federation server (v2/https) started, listening on port 9001
created v2 federate subscription host.docker.internal:19001
Each server records the other in CoreConfig.xml as a federate, with the groups from its settings. A’s record of B:
<federate id="2B:F9:5B:...:B5:FD" name="takserver:intermediate">
<inboundGroup>blue</inboundGroup>
<outboundGroup>blue</outboundGroup>
</federate>
A shares its blue tracks and receives B’s data into blue. B’s record of A has __ANON__ both ways. The vessel feed stays in maritime, which A doesn’t share.
The id is the fingerprint of the other server’s certificate, and the name is its common name and its issuer’s. In my tests, both servers had certificates called takserver from a CA called intermediate, so their names matched and the fingerprints told them apart. After article 6’s rotation, A’s intermediate may have another name, such as intermediate-2.
What each side sees
Sign in to WebTAK on server B as echo-1, at https://localhost:18446/webtak/index.html, and turn on Track Location. Over about three minutes, B received ALPHA-1, BRAVO-1, 27 to 28 aircraft and the tractor from server A, and no vessels. Tracks appear as fresh reports arrive, so a device that reports less often takes longer to show up. In an earlier run, ALPHA-1 took a couple of minutes longer than BRAVO-1.
In the other direction, A received ECHO-1’s reports into blue. This screenshot is from an earlier run, with both servers sharing __ANON__, where ECHO-1 appeared in ALPHA-1’s contacts on server A:

The greyed-out ECHO-1 is from an earlier WebTAK session. The seventh article observed a new ID after changing browsers or clearing browser storage; starting another session alone wasn’t established as the cause.
Their users still can’t connect directly
To check the separation, in the earlier __ANON__ run, I took server B’s admin certificate, signed by B’s CA, and tried it on server A. A refused it on both ports:
| Port | Result |
|---|---|
8443, the admin console | alert certificate unknown |
8089, streaming | A’s log: Certificate error: peer not verified |
B’s CA is in A’s federation truststore, not in the one A uses for its own users.
Limit what crosses
A currently shares its blue group with B. To narrow that to ALPHA-1, add a dedicated outbound group while preserving the existing local groups.
On server A, put ALPHA-1 in a federation group, and share only that group:
USER_GROUPS=alpha-1:blue,federation bravo-1:blue charlie-1:blue,maritime delta-1:blue feed-adsb:blue feed-ais:maritime feed-tracker:blue
FEDERATION_SHARE=federation
This is the full group assignment carried forward from article 8, with federation added only to alpha-1. Preserve any additional assignments of your own. ALPHA-1 retains blue to keep sharing with its local team. Leave A’s FEDERATION_RECEIVE=blue and B’s federation settings unchanged.
The groups apply when a federate is first recorded. This setup rebuilds CoreConfig.xml on every start, so docker compose up -d applies the change. Run it from tak-stack/compose/takserver. A’s record of B then showed:
<inboundGroup>blue</inboundGroup>
<outboundGroup>federation</outboundGroup>
On server B, a new echo-1 session received only ALPHA-1 over about three minutes: no BRAVO-1, aircraft, vessels or tractor. Old icons can stay on a map after sharing stops, so check with a new session or fresh updates:

Data from B still reached A: the new ECHO-1 session showed up in A’s log, received into blue. The two directions are separate decisions.
Federation Hub
Direct federation suits two servers. Every pair of servers that shares data needs its own CA exchange and its own connection, so the work grows with the number of pairs: three agencies that all share with each other need three of each, and five need ten. Each server also ends up holding every partner’s CA, and any change to who receives what is made on the servers themselves.
TAK Federation Hub, from the TAK Product Center, is built for that situation. It’s a separate program, and a separate download, from TAK Server. It doesn’t host field users or provide their operational map. TAK Servers federate with it as they would with another server, and it forwards what each one sends to the others. Its configuration guide describes the layout as hub and spoke.
Compared with direct federation, three things change:
- Trust. Each server trusts only the hub’s CA for federation, and the hub trusts each server’s CA. A new agency exchanges CAs with the hub once, rather than with every partner.
- Connections. In this setup, each server makes one connection, out to the hub. The servers no longer connect to each other.
- Routing. A policy on the hub decides whose data reaches whom. You draw it in the hub’s web interface using CA Group nodes and an arrow for each direction data may flow. In this lab, each server has its own CA, so each CA Group represents one server. The hub refuses any server the policy doesn’t name.
Each server’s groups still apply. A server sends only what its outbound groups allow, and the hub then decides which servers receive it. That second decision belongs to whoever runs the hub, and all federated data passes through it, so every agency has to trust the hub’s operator.
The hub has a third, separate CA; here it represents a separately administered service. The compose/fedhub folder runs it from the tak.gov release, and its README lists what it automates. Both servers move their connections to the hub while keeping the groups from the last section: A still shares only federation.
Start the hub
Like TAK Server, the hub builds from its tak.gov release, which goes in the release folder. Unzip it somewhere temporary, then copy its docker and tak folders across. The zip also has its own README.md, which would replace ours, so leave it out. Adjust the first path to wherever you saved the zip:
cd tak-stack/compose/fedhub
unzip ~/Downloads/takserver-fedhub-docker-5.8-RELEASE-92.zip -d /tmp/fedhub-release
cp -R /tmp/fedhub-release/takserver-fedhub-docker-5.8-RELEASE-92/{docker,tak} release/
ls release
README.md docker tak
As with TAK Server, git ignores everything in release/ except our README. Then create the hub’s passwords, and build and start it:
./setup.sh
docker compose up -d --build
On first start, the hub creates its own certificate authority, TAK-STACK-HUB-CA, with a server certificate for itself and an admin certificate for its web interface. It listens on two ports: 9102 for TAK Servers, and 9100 for the web interface.
Exchange CAs with the hub
The hub needs each server’s CA, and each server needs the hub’s. Copy the files share-ca.sh wrote earlier into the hub’s config/federation/, and write the hub’s:
cp ../takserver/TAK-STACK-B-CA.pem ../takserver/TAK-STACK-CA-2026.pem config/federation/
./share-ca.sh
Wrote TAK-STACK-HUB-CA.pem. Put it in each TAK Server's config/federation/.
On the servers, swap the partner’s CA for the hub’s, so the servers can no longer connect to each other directly. From tak-stack/compose/takserver:
rm config/federation/TAK-STACK-B-CA.pem config-b/federation/TAK-STACK-CA-2026.pem
cp ../fedhub/TAK-STACK-HUB-CA.pem config/federation/
cp ../fedhub/TAK-STACK-HUB-CA.pem config-b/federation/
Now both servers connect out, to the hub. Set this in both config/takserver.env and config-b/takserver.env:
FEDERATE_WITH=host.docker.internal:9102
Restart the hub, then both servers:
cd ../fedhub
docker compose up -d --force-recreate
cd ../takserver
docker compose --env-file config-b/compose.env up -d --force-recreate tak-certs takserver
docker compose up -d --force-recreate tak-certs takserver
Both servers connect, and the hub turns them away. Change from tak-stack/compose/takserver to the hub folder and check its log:
cd ../fedhub
docker compose logs fedhub
Stay in tak-stack/compose/fedhub for the certificate export below. The log says why:
Permission Denied. Federate/CA Group not found in the policy graph
The hub refuses any server its active policy doesn’t name, even one whose CA it trusts.
Write a policy
From tak-stack/compose/fedhub, copy the hub’s admin certificate out:
docker compose cp fedhub:/opt/tak/federation-hub/certs/files/admin.p12 .
Follow only the browser certificate-import steps, using this hub certificate and ADMIN_CERT_PASS from tak-stack/compose/fedhub/config/secrets.env. The guide’s final address, port 8443, is for TAK Server; use the hub’s port 9100 below instead.
Once the hub’s admin.p12 is imported into your browser, delete the exported copy from tak-stack/compose/fedhub.
Open https://localhost:9100, go to Policy Manager and click New Policy. I called mine two-agencies.
Drag a CA Group onto the canvas for each server. Name it, and choose the server’s root CA under CA Group (subject). The list shows every CA from the hub’s config/federation/, roots and intermediates. Naming each server’s root was enough for its connection to be accepted in my tests. The screenshot shows the lab’s unrotated TAK-STACK-CA; if you followed article 6’s rotation, select your actual current root, such as TAK-STACK-CA-2026:

To let data flow from A to B, drag from Server A onto Server B. The hub asks how to filter it. Choose Allow All Messages:

The other options filter by group, and the guide says they need group mapping turned on at the sending server. This setup leaves group mapping off, so filtering by group stays with each server’s FEDERATION_SHARE.
Add a second connection from Server B onto Server A, then click the cloud icon to make the policy active. In an earlier run, server A connected 28 seconds after I activated the policy. Connected servers’ nodes turn green:

A new echo-1 session on server B received ALPHA-1 and nothing else from A, as A’s FEDERATION_SHARE allows. In the other direction, A received ECHO-1 13 seconds after that session started.
One-way sharing
The hub adds its own layer of control on top of each server’s groups. Right-click the arrow from Server B to Server A, delete it, and click the cloud icon again. The policy now has one rule:

With that policy, a new echo-1 session still received ALPHA-1. A’s log showed no subscription for that new session during an observation of about three minutes. Server B was still sharing __ANON__, and A was still receiving into blue. In this test, removing the B-to-A policy connection stopped that session’s reports from reaching A.
So there are two places to decide what crosses. Each server decides what it offers, with its groups. The hub decides which servers that reaches, with its policy, and one administrator can change it without touching either server.
What persists
The active policy is saved in the hub’s Docker volume. In an earlier run, I restarted the hub with docker compose up -d --force-recreate. The servers reconnected within about 90 seconds, with no permission errors, and the hub listed both as active connections.
Common errors
Errors encountered during testing, and what caused them:
| What you see | Where | What caused it |
|---|---|---|
Federation disabled in config. Not starting V2 federation server. | takserver-messaging.log | FEDERATION=true isn’t set, or the server hasn’t restarted since |
Federation partner CAs: none | tak-certs log | No .pem files in config/federation/ |
alert certificate unknown, or peer not verified | Connecting a user from the other server directly | Expected. Their CA is only trusted for federation |
| A user who joins a group stops seeing their team | Any client | Their assignment omitted the shared local group. Retain blue on A in this walkthrough |
| Two contacts with the same callsign | ATAK | An earlier session’s ID. It goes stale and disappears |
Server B stays unhealthy, and its log repeats Waiting for the API process... | From tak-stack/compose/takserver, run docker compose --env-file config-b/compose.env logs takserver | Docker was short of memory. Stopping CloudTAK fixed it |
Permission Denied. Federate/CA Group not found in the policy graph | Federation Hub log | The server’s CA isn’t in the active policy. Add a CA Group for it, and activate the policy |
| Data stops in one direction through the hub | Any client | The policy has no arrow that way. Check the active policy, not just the one you’re editing |
What you’ve built
The updated repository adds federation settings, share-ca.sh, a way to run a second server on one computer, and a Federation Hub folder. In this walkthrough, you’ve:
- Run two separate TAK Servers, each with its own CA, users and database
- Federated them directly. A connected to B’s host port
19001, mapped to B’s federation listener on container port9001, after each added the other’s CA to its federation truststore - Kept users separate. In an earlier run, server B’s certificates were refused on server A’s own ports
- Limited what crosses. Sharing
bluesent B the users, aircraft and tractor, but not the vessels. Sharing onlyfederationsentALPHA-1alone. B’s data still reached A - Moved the connections to Federation Hub. Both servers connected to the hub instead of each other, and nothing crossed until a policy named their CAs
- Controlled direction at the hub. Removing one arrow stopped B’s data reaching A, without changing either server
These results come from the lab A server, whose root CA was still TAK-STACK-CA. I haven’t tested them with a rotated root name, or with the servers on separate machines.
The CA exchange is the part to plan for. When you rotate your root, run ./share-ca.sh from tak-stack/compose/takserver again (or ./share-ca.sh --instance b for B), and give every federation partner, or the hub, the new file before you retire the old CA, as the sixth article warned. With the hub, also add a CA Group for the new root, configure its intended incoming and outgoing policy connections, and activate the revised policy before retiring the old root. Adding the CA Group alone doesn’t specify which partners it can share with. I haven’t tested a rotation with a partner connected.
Next up: signing users in with an identity provider, instead of passwords kept in our configuration.
