Deploy to AWS EC2

Buddy turns deployments into a breeze, allowing you to update your EC2 servers on every push to branch. You can also deploy manually on click, or recurrently on time intervals.

Image loading...Example pipeline with deployment to an EC2 serverExample pipeline with deployment to an EC2 server

Tip
If you are new to Buddy, check out our workflow guides that will tell you how to build, test and deploy your type of application.

Configure AWS

Warning
We recommend setting an Elastic IP in your EC2 instance. Without it, the Public IP may change whenever the EC2 is restarted.
  1. Log in to your AWS account and copy the Public IP of your EC2 instance:

Image loading...Public IP of your EC2 instancePublic IP of your EC2 instance

Configure pipeline in Buddy

  1. Create a new project, select your Git provider and choose the repository with your project:

Image loading...Creating a new projectCreating a new project

  1. Add a new pipeline and configure the details: name, trigger mode, and branch from which you want to deploy.

Image loading...Adding a new pipelineAdding a new pipeline

Configure AWS EC2 deployment

  1. EC2 uses the SFTP protocol for deployments. This means you can serve it with the SFTP Transfer action:

Image loading...Transfer actionsTransfer actions

  1. The action has four configuration tabs:
  • Transfer – here you define the source path, deployment flags, and files to ignore
  • Target – here you provide the details of the server to which you want to deploy
  • Conditions – here you configure the trigger conditions for which the action will run
  • Options – here you define the action's name and behavior on failure and timeout
Warning
If you are using build actions in your pipeline, make sure to select the Filesystem as the source to deploy artifacts and processed files.

Image loading...SFTP action configurationSFTP action configuration

Hint
Buddy's deployment is based on changesets. This means only changed files are deployed, which makes it lightning fast ⚡️. The first deployment is always performed from scratch, unless you set a revision on the server in the Options tab.
  1. When ready, click Add this action to finish configuration.
Success
Congratulations – you have just automated your deployment to AWS EC2! 🥳
Last update:
Sep 24, 2024