Install the AWS Replication Agent on a source server
At the end your Windows or Linux source server will have the AWS Replication Agent installed, appear on the Source servers page of AWS Transform MGN and be running its initial sync to your chosen AWS Region.
What you need before step 1
Applies to: AWS Transform MGN (formerly AWS Application Migration Service) with physical, VMware, Hyper-V or other-cloud Windows and Linux servers, as documented by AWS
Admin roles you need
- An AWS account user with administrative permissions to initialise the service the first time (AWS's prescriptive guidance signs in "with administrative permissions")
- Permission to create IAM roles (needed to create the agent installation role and for MGN to create its service roles)
- An IAM role (recommended, for temporary credentials) or IAM user with the AWS managed policy AWSApplicationMigrationAgentInstallationPolicy
- Local Administrator on Windows source servers; root or sudo on Linux source servers
Licences
None needed.
Download
https://aws-application-migration-service-us-east-1.s3.us-east-1.amazonaws.com/latest/windows/AwsReplicationWindowsInstaller.exeDownloadhttps://aws-application-migration-service-us-east-1.s3.us-east-1.amazonaws.com/latest/linux/aws-replication-installer-initDownloadInstall instructions
https://docs.aws.amazon.com/mgn/latest/ug/windows-agent.htmlInstall stepshttps://docs.aws.amazon.com/mgn/latest/ug/linux-agent.htmlInstall stepshttps://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htmlOur step-by-step →Install stepsAlso have ready
- Outbound TCP 443 from the source server to the MGN endpoint and S3 (AWS lists "Connection times out" when it is blocked)
- Windows: .NET Framework 3.5 or later and at least 1 GB free on C:
- Linux: at least 2 GB free on / and 1 GB free on /tmp, and kernel headers that exactly match uname -r
- A staging area subnet in the target VPC for the replication servers
9 steps
- 1
Initialise the service in your target Region
Where: AWS Management Console > Region selector (top right) > your target Region > search "MGN" > AWS Transform MGNChoose Get started. Create the replication settings template: select the staging area subnet, the replication server instance type (t3.small by default) and the EBS volume type (gp3 by default), then choose Create template. AWS says the service creates the IAM roles it needs for replication and launching servers. If the console later asks, choose Reinitialize service permissions on the replication settings page.
You should see: The replication settings template is created and the Source servers page is available in the console navigation. - 2
Create the agent installation role
Where: AWS Management Console > IAM > Roles > Create roleFor Trusted entity type select AWS account > This account. On Add permissions search for and tick AWSApplicationMigrationAgentInstallationPolicy. Name the role
MGN_Agent_Installation_Roleand create it. AWS recommends temporary credentials over IAM user access keys.You should see: The role appears in IAM > Roles with the AWSApplicationMigrationAgentInstallationPolicy attached. - 3
Generate temporary credentials
Where: Your admin PC, in a terminal with the AWS CLI signed in to the target accountAssume the role and copy AccessKeyId, SecretAccessKey and SessionToken from the output. AWS notes these credentials expire after one hour, so install the agent soon after.
aws sts assume-role --role-arn arn:aws:iam::123456789012:role/MGN_Agent_Installation_Role --role-session-name mgn_installation_session_roleYou should see: JSON with a Credentials block containing AccessKeyId, SecretAccessKey, SessionToken and Expiration. - 4
Optional: generate a ready-made install command
Where: AWS Transform MGN console > Source servers > Add serverSelect the operating system, choose Replicate all disks (adds
--no-prompt) or Choose which disks to replicate, and enter the credentials. The form builds a custom installation command for you to copy. It does not send the secret anywhere; it only adds it to the command.You should see: A custom installation command appears that you can copy to the source server. - 5
Windows: download the installer
Where: Windows source server: right-click Start > Windows PowerShell (Admin). AWS recommends PowerShell over Command Prompt because it supports Ctrl+V pastingDownload the installer for your Region (example shown for ap-southeast-2). For Windows Server 2003 to 2008 R2 use
AwsReplicationWindowsLegacyInstaller.exeand for Windows Server 2012 useAwsReplicationWindows2012LegacyInstaller.exeinstead.Invoke-WebRequest -Uri "https://aws-application-migration-service-ap-southeast-2.s3.ap-southeast-2.amazonaws.com/latest/windows/AwsReplicationWindowsInstaller.exe" -OutFile .\AwsReplicationWindowsInstaller.exeYou should see: AwsReplicationWindowsInstaller.exe is in the current folder. - 6
Windows: run the installer
Where: The same elevated PowerShell windowRun the installer (or paste the command generated by Add server). Enter the AWS Region name, the access key ID, secret access key and session token when prompted, then press Enter to replicate all disks or type the disks to include.
.\AwsReplicationWindowsInstaller.exeYou should see: The installer identifies the disks, installs the agent and reports the source server ID. - 7
Linux: download the installer
Where: Linux source server, terminal as a user with sudoDownload the installer for your Region (example for ap-southeast-2).
wget -O ./aws-replication-installer-init https://aws-application-migration-service-ap-southeast-2.s3.ap-southeast-2.amazonaws.com/latest/linux/aws-replication-installer-initYou should see: wget reports the file was saved. - 8
Linux: run the installer
Where: The same terminalPass the credentials as environment variables, which AWS recommends over command-line parameters because parameters are visible in the process list.
--no-promptruns silently and replicates all disks. To pick disks interactively, drop--no-promptand type the disk paths (for example/dev/sda,/dev/sdb) when asked; the root disk is always replicated.export AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY export AWS_SESSION_TOKEN=AQoDYXdzEJr...EXAMPLE chmod +x aws-replication-installer-init sudo -E ./aws-replication-installer-init --region ap-southeast-2 --no-promptYou should see: The installer confirms all disks were identified, installs the agent and prints the source server ID. - 9
Check the server in the console
Where: AWS Transform MGN console > Source serversFind the server by hostname. Wait while it completes initial sync. Before testing, AWS says the Migration lifecycle should be Ready for testing and Data replication status Healthy.
You should see: The server is listed and moves through initial sync to Ready for testing with Healthy replication.
Expert tips
Each source server must reach the MGN endpoint (mgn.<region>.amazonaws.com) and Amazon S3 on TCP 443, and the replication servers in the staging subnet on TCP 1500 for the data itself. On Windows check with Test-NetConnection mgn.ap-southeast-2.amazonaws.com -Port 443. Most failed installs and stalled replications are a blocked port.
The agent log is agent.log.0 in /var/lib/aws-replication-agent/ on Linux and C:\Program Files (x86)\AWS Replication Agent\ on 64-bit Windows. The installer also writes aws_replication_agent_installer.log in the install path. Send both to AWS Support if you open a case.
Credentials from aws sts assume-role expire (one hour by default), so generate them right before the install session, and do a batch of servers in one go. On Windows, run the installer from PowerShell rather than CMD; AWS notes the secret key can paste incorrectly in CMD and cause a signature error.
For scripted installs use --region and --no-prompt. Use --devices to pick disks, and only use --force-volumes as a troubleshooting step, including the root disk or replication fails. Add --tags at install time, because AWS says it cannot change tags on servers already added.
Use a dedicated staging subnet, as AWS recommends. If firewall policy blocks public endpoints, create interface endpoints and pass --endpoint (MGN) and --s3-endpoint (Amazon S3) to the installer.
How to confirm it worked
AWS Transform MGN console > Source servers shows the server with Data replication status Healthy and Migration lifecycle Ready for testing.
From the CLI:
aws mgn describe-source-servers --region ap-southeast-2lists the source server ID the installer printed.On the source server the agent log exists:
/var/lib/aws-replication-agent/agent.log.0(Linux) orC:\Program Files (x86)\AWS Replication Agent\agent.log.0(64-bit Windows).
How to reverse it
In the console select the server on the Source servers page and choose Disconnect from service. AWS says this stops replication and uninstalls the agent; to replicate again you must reinstall the agent. A server that is not replicating can then be removed with Delete from service. Delete the MGN_Agent_Installation_Role in IAM when you have finished installing agents.
Errors you might see
Error: You need to have root privileges to run this script.Cause: The Linux installer was run without root.
Fix: Run it with sudo, for example sudo ./aws-replication-installer-init.
Error: urlopen error [Errno 10060] Connection times out.Cause: Outbound TCP 443 to the MGN service endpoint is blocked.
Fix: Open outbound 443 to the MGN endpoint (and S3), or use VPC endpoints with --endpoint and --s3-endpoint.
An error occurred (InvalidSignatureException) when calling the GetAgentInstallationAssetsForMgn operationCause: The secret key was pasted incorrectly, usually when the installer runs in Command Prompt.
Fix: Rerun the installer in PowerShell and paste the secret again.
This app can't run on your PCCause: Usually 32-bit Windows, which is not supported.
Fix: Check Settings > System > About. If the OS is 64-bit, run sfc /scannow to look for other causes.
Installation fails because the aws-replication user cannot be added to sudoersCause: The Linux installer creates an aws-replication user and must add it to sudoers.
Fix: Run as root or with sudo and make sure configuration management is not locking sudoers.
The devices you entered span over more than 63 volumes. Up to 63 volumes are supported per machine. Installation failed.Cause: Too many disks were selected.
Fix: Select 63 or fewer disks and rerun the installer.
Questions
Is AWS Application Migration Service still available?
Yes. AWS documentation now names it AWS Transform MGN. The agent and installer URLs use the same aws-application-migration-service naming.
Can I use permanent IAM user keys instead?
Yes, with the same AWSApplicationMigrationAgentInstallationPolicy, but AWS recommends temporary credentials as best practice.
Do I need credentials for EC2 source servers?
No. For EC2 instances replicating within the same account you can use an instance profile with AWSApplicationMigrationServiceEc2InstancePolicy.
Which Region URL do I use?
The Region you are replicating into. Replace the Region code in the installer URL; Regions that are not opt-in also accept the shorter form without the Region after s3, for example https://aws-application-migration-service-ap-southeast-2.s3.amazonaws.com/latest/windows/AwsReplicationWindowsInstaller.exe.
Official sources
Vendors change menus and requirements. Confirm on the source before you rely on a detail. Last checked 4 Nov 2026.