In this blog post , We have explain how to install SSM Agent on Linux EC2 Instances.

What is SSM Agent?

SSM stands for Simple Systems Manager.

Amazon SSM agent is the software which can be installed on the EC2 Instances , On-premise servers or virtual machines for the systems manager to update , configure and run commands remotely.

SSM agent is preinstalled on certain Operating systems.

SSM Agent Installed by Default

SSM agent is installed by default of the following EC2 Instances and the Amazon Machine Images.

  • Amazon Linux
  • Amazon Linux 2
  • Ubuntu 16.04
  • Ubuntu 18.04
  • Amazon ECS-optimized Instances

Whenever a new capabilities are added to Systems Manager , We need to update the existing version of SSM agent which is already installed on the system.

Let us see how to install latest version of SSM agent manually on Linux EC2 Instances.

Install SSM Agent on Amazon Linux

Login to Amazon Linux EC2 instance using SSH client and follow the below steps to install SSM agent.

Lets download the SSM agent and run the agent installer using the below command.

sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Install SSM Agent
Install SSM Agent

Now the agent is installed.

To start the SSM agent run the below command.

sudo start amazon-ssm-agent

To check the status of Amazon SSM agent,

sudo status amazon-ssm-agent
Install SSM Agent

The Amazon SSM agent is installed on the Amazon Linux EC2 Instance and the service is running.

Install SSM Agent on Amazon Linux 2

Login to Amazon Linux 2 EC2 instance using SSH client and follow the below steps to install SSM agent.

Lets download the SSM agent and run the agent installer using the below command.

sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Install SSM Agent

To start the amazo-ssm-agent service , run the below command.

sudo systemctl start amazon-ssm-agent

To check the status of the ssm agent.

sudo systemctl status amazon-ssm-agent
Install SSM Agent

To enable the amazon-ssm-agent service to start on system reboot or boot up.

sudo systemctl enable amazon-ssm-agent

Install SSM Agent on Centos 7

Login to Centos EC2 instance using SSH client and follow the below steps to install SSM agent.

Lets download the SSM agent and run the agent installer using the below command.

sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Install SSM Agent
Install SSM Agent

To start the amazon-ssm-agent service on the Centos Linxu Instance,

sudo systemctl start amazon-ssm-agent

To check the status of SSM agent,

sudo systemctl status amazon-ssm-agent
Install SSM Agent

Run the below command to automatically start the service on instance reboot or instance boot up.

sudo systemctl enable amazon-ssm-agent

Install SSM Agent on Ubuntu 18.04

On Ubuntu operating systems , You can install either using debian installer packages or using snap packages.

To install using snap:

You can check if ssm-agent is already installed using snap ,Run the below command:

snap list amazon-ssm-agent
Install SSM Agent

With the help of snap , We done need to download the ssm agent package , because the snap command automatically downloads the ssm agent from the Snap app store.

snap install amazon-ssm-agent --classic
Install SSM Agent

Run the below command to verify whether the amazon ssm agent is installed on the ubuntu system.

sudo snap list amazon-ssm-agent
Install SSM Agent

To start the ssm agent service,

sudo snap start amazon-ssm-agent

To check the status of the amazon ssm agent service,

sudo snap services amazon-ssm-agent
Install SSM Agent

You can remove the amazon ssm agent using the below command.

sudo snap remove amazon-ssm-agent

Install SSM Agent on Ubuntu 16.04

First we need to download the debian package of amazon ssm agent.

wget https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb

To install the .deb package , Run the below command.

sudo dpkg -i amazon-ssm-agent.deb
Install SSM Agent

To check the status of the service , Run the below command.

sudo systemctl status amazon-ssm-agent
Install SSM Agent

To enable it to auto start during system reboot,

sudo systemctl enable amazon-ssm-agent

Install SSM Agent on Redhat 7

Login to Redhat EC2 instance using SSH client and follow the below steps to install SSM agent.

Lets download the SSM agent and run the agent installer using the below command.

sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Install SSM Agent
Install SSM Agent

To start the amazon ssm agent service ,

sudo systemctl start amazon-ssm-agent

To enable the ssm agent service to auto start during system boot up,

sudo systemctl enable amazon-ssm-agent

To check the status of the amazon ssm agent,

sudo systemctl status amazon-ssm-agent
Install SSM Agent

Amazon SSM agent service is installed and It is running fine.

Conclusion

We have installed Amazon SSM agent service on Linux EC2 Instances of different distributions.

Hope you find it helpful.

Do check out my other articles.