Docs / Operations / Removing servers and deployments

Removing servers and deployments

This guide shows you how to take a deployment off its server, remove a server from PerkBridge, and clean what PerkBridge installed on the host.

Updated 26 Oct 2026·Version 0.x
Important. Removing a deployment or a server never closes broker positions, cancels orders or logs out at the broker. Check your positions with your broker first.

1. What removal never does

Removal is about PerkBridge’s own software and records. Nothing is sent to the broker.

  • Open positions, pending orders and stops stay at the broker.
  • Records are never deleted. A removed deployment or server, its operations, alerts and audit trail stay readable.
  • Removed items are hidden from the lists unless you choose to show them.

Close what you need to close first. See Stopping safely.

2. Remove a deployment

Removing a deployment deletes its container, session data and temporary files from the server. The shared MT5 installation for the broker stays, so other deployments can keep using it.

Before you start, check that:

  • the deployment is stopped. Removal is refused while it runs, starts or stops, or while its state is unknown. It never stops a session for you;
  • no other operation is open on it;
  • the server’s agent is connected;
  • you have the deployment:remove permission, and the server’s agent policy allows deployment.remove.
  1. Open Deployments and choose the deployment.
  2. Choose Remove. Read the question and choose Remove deployment.
  3. Wait for the actual state to become REMOVED. It changes only when the agent confirms that nothing labelled with the deployment is left.

A deployment that never reached its server, or that the server no longer has, is removed the same way once the agent confirms nothing of it is left.

What happens to its trading account

When the removal is accepted, the deployment’s trading account is removed from PerkBridge in the same step:

  • the account is disabled and its trading switch turns off;
  • every route of the account is turned off;
  • every Trading API token of the account is revoked;
  • its remembered credentials are withdrawn and erased from the vaults of its server and its standby.

Order, position and event history is kept. A removed deployment accepts no further action.

3. Remove a server

Normally you remove every deployment on a server first. Then:

  1. Open Servers, choose the server, and choose Remove.
  2. Read what blocks removal, if anything. Removal is refused while a deployment is not removed, or while an operation, image pull or setup run is open.
  3. Type the server’s name exactly.
  4. Tick I understand that removing this server does not close broker positions.
  5. Optionally tick Also uninstall Nile from the host over SSH (optional) and give the SSH private key, and its passphrase if it has one (section 5).
  6. Choose Remove server. You may be asked to sign in again.

This needs the server:decommission permission. The removal page shows progress, then a report.

When removal starts, the server accepts no new work. Its pending enrollment tokens are revoked, its agents are revoked and disconnected, and its trading accounts are removed as in section 2. Open alerts of the server are resolved with “the server was removed”.

The server’s SSH target is released, so you can add the same machine again later as a new server.

4. Remove anyway

Sometimes a server cannot be emptied first, for example because its agent is offline or broken. Then use Remove anyway… on the removal page. You confirm a second statement: I understand that these deployments and operations are left on the host as they are, unmanaged.

A forced removal stops, removes and sends nothing:

  • Containers keep running on the host. Once the agents are revoked, nothing manages or watches them. A running trading deployment keeps trading, and its positions stay open.
  • Open operations and image pulls stay open, and their outcome stays unknown.
  • Trading API tokens of the server’s accounts stop working.

A setup run that is changing the host right now still blocks removal. The report lists what was left on the host.

Important. After a forced removal, stop or remove the leftover containers on the host yourself (section 6). Until then they run without monitoring.

5. Host cleanup and the report

Host cleanup is offered when the server was added from the dashboard with SSH and has a trusted host key. Your key is held in memory for this removal only, then wiped. It is never stored or logged. A changed host key stops the attempt.

Cleanup stops the agent, takes its inventory, and removes only what PerkBridge installed and recorded and that has not changed since: the deployments’ containers and owned volumes, the agent’s service, binary, configuration and state, and nile-vault with its stored halves if setup installed it. The nile-vault system user stays on the host. It then checks each item again and that unrelated containers did not change.

It never removes Docker, containerd or their data, runtime images, anything changed since it was recorded, or volumes shared with another container. The report lists these as kept by design.

RESULTWHAT IT MEANS
VERIFIED_CLEANPerkBridge was removed from the host, and this was verified.
CLEANED_WITH_ITEMS_LEFTRemoved, except the items listed.
NOT_REQUESTEDThe host was not cleaned.
REFUSEDOwnership or workload checks failed before any change.
FAILEDThe host was partly cleaned (items listed) or not cleaned.
UNKNOWNThe host may be partly cleaned; this could not be verified.
SUPERSEDEDThe host was added again as another server.

After FAILED, UNKNOWN or NOT_REQUESTED, choose Retry host cleanup. A retry resumes where it stopped and reports items already gone as already absent. Host cleanup has been tested on a test host; a run on a real customer server is still to be confirmed.

6. Clean a host by hand

Use this for a server added with the command-line tool, a server provisioned before host cleanup existed, or when you gave no key. Run as root:

systemctl disable –now fleet-agent.service # check that no PerkBridge container runs, then remove the deployments’ containers docker ps -a –filter label=nile.agent_id rm -f /etc/systemd/system/fleet-agent.service /usr/local/bin/fleet-agent rm -rf /etc/nile/fleet-agent /var/lib/nile/fleet-agent /run/nile/fleet-agent systemctl daemon-reload # only if nile-vault was installed systemctl disable –now nile-vault.service rm -rf /etc/systemd/system/nile-vault.service* /usr/local/bin/nile-vault /etc/nile/vault /var/lib/nile/vault systemctl daemon-reload

Remove a broker installation volume only if no other deployment uses it. Docker and the runtime images are not specific to PerkBridge; remove them only if nothing else on the host needs them.

To remove the control plane itself, see Install the control plane. Uninstall is not available in the installer yet.

Was this page helpful?