---
title: "Install the agent"
description: "Onboard EC2 instances by installing Alpamon through AWS Systems Manager or the manual SSH guide. Follow installation steps and resolve common blockers."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# Install the agent

Onboarding an instance installs the Alpamon agent so it becomes a managed Alpacon server. You can install with one click through AWS Systems Manager (SSM), or follow a manual SSH guide.

## Instance page

Open an instance from the [cloud instance list](/use/servers/cloud-instances/) to see its page. The header shows the instance's state, its stage, its instance ID, region, and launch time, with **AWS console** and, for members who can sync the account, **Sync**. Sync runs only while the account is active.

**Instance lifecycle** lays out the four stages an instance goes through, each with what it stands on:

1. **Discovered**: the account the instance was found in, and when.
2. **Onboarding**: whether the instance is registered as an AWS SSM managed node.
3. **Agent install**: whether the agent can be installed now, is being installed, or is installed.
4. **Managed**: the Alpacon server the instance became.

A warning mark on the current stage means something stops the install. Below the stages, the page shows one section that depends on where the instance stands:

- **What stops the automatic install**: what blocks the one-click install and how to fix it. See [When installation is blocked](#when-installation-is-blocked).
- **Install the agent**: nothing blocks the install, so **Install agent** is ready to click.
- **Install progress**: the install's three steps while it runs.
- **Linked Alpacon server**: the server, with whether it is connected, its OS, its agent version, and when it was last seen, plus **Open server**.

The column beside it lists the instance's EC2 details: instance ID, launch time, role, compute (instance type, platform, architecture, AMI, key pair), network (region and availability zone, IP addresses, VPC, subnet, security groups), and tags.

## One-click install (AWS SSM)

Click **Install agent** in the instance's row on the [cloud instance list](/use/servers/cloud-instances/), or under **Install the agent** on its page. A progress dialog shows three steps:

1. **Dispatch**: the install command is sent via AWS Systems Manager.
2. **Install**: the agent is installed on the instance.
3. **Match**: the instance is linked to its new Alpacon server (by tag, MAC, IP, or hostname).

When all three steps complete, click **View server** to open the new server. If a step fails or times out, an error is shown and you can **Retry**. If you close the dialog, the instance page keeps showing the steps under **Install progress**.

## Manual install (SSH)

If the one-click install isn't available, click **Manual install guide** in the instance page's header, or the "install manually" link under **What stops the automatic install**. It walks through the install a step at a time, with the commands to run on the instance and a button to copy each. When the instance registers, the guide says how it was matched to its server and offers **View server**.

The guide is not offered on Windows; see [Install on Windows](/use/servers/register/install/#windows). It stays unavailable while the instance has no linked account, the account isn't active, or the account has no registration token: fix those first.

The install script contains a plaintext registration token—don't share it publicly. After you run it, the instance registers itself and is matched to a server.

## When installation is blocked

When something stops the one-click install, the instance page lists it under **What stops the automatic install**, split into **On this instance** and **In the account settings**. Each row says what to do, and holds a button when the console can do it for you.

| Reason | How to resolve |
| --- | --- |
| Instance not running | Start the instance in AWS, then wait for the next sync. |
| Remote command unavailable | Register the instance as an AWS SSM managed node. **Setup guide** opens a guide; see [Set up AWS SSM](#set-up-aws-ssm). |
| Unsupported platform | Install the agent manually and register—see the [installation guide](/use/servers/register/install/#windows) (for example, on Windows). |
| No linked account | Link the instance to a valid cloud account, or run discovery again. |
| Account not active | Click **Account settings** and re-verify the account until its status is **Active**. |
| Remote agent installation not allowed | Click **Allow now**, or turn on **Remote agent installation** in the [account settings](/integrate/cloud/accounts/#account-settings). |
| Stack doesn't allow remote installation | Update the account's CloudFormation stack with `EnableRemoteCommand` set to `true`, then recheck the permission on the account page, which **Account settings** opens—see [Remote command permission](/integrate/cloud/accounts/#remote-command-permission). The manual SSH install still works meanwhile. |
| Registration token missing | Click **Set token** to attach a [server registration token](/use/servers/register/tokens/) to the account. |

**Allow now** and **Set token** appear only for members who can edit the account.

## Set up AWS SSM

**Setup guide** opens **Enable remote command (AWS SSM)**, five steps a page at a time. Console links and endpoint names follow the instance's region.

1. **SSM Agent**: check whether the agent is already installed, install it if not, and check that its service is running. Pick **Amazon Linux** or **Ubuntu**; the install, status, and log commands follow the choice. For any other OS, the step links to AWS's guide.
2. **IAM role**: create a role for EC2 with the `AmazonSSMManagedInstanceCore` policy, then attach it to the instance. Creating the role does not attach it.
3. **Network**: the instance must reach AWS Systems Manager over HTTPS, either through the internet or through the VPC endpoints `ssm`, `ssmmessages`, and `ec2messages` with private DNS names enabled.
4. **Check**: the instance appears in Fleet Manager within a minute or two. If it doesn't, restart the agent, reboot the instance, or read the agent's log.
5. **Sync**: Alpacon picks up the change at the next sync. To pick it up now, use **Sync now** on the account page, or **Sync** on the instance page.

## After onboarding

Onboarded instances appear under [Servers](/use/servers/) and are accessed through [work sessions](/use/work-sessions/), just like any other server.

## Related docs

- [Cloud instances](/use/servers/cloud-instances/)
- [Manage cloud accounts](/integrate/cloud/accounts/)
- [Register a server](/use/servers/register/)

Source: https://docs.alpacax.com/integrate/cloud/install-agent/
