AWS CodeDeploy Alternative for On-Prem Deployments

Last week I was trying to setup AWS CodeDeploy on an On-Prem Ubuntu Server 16.04. Unfortunately CodeDeploy supports only ruby2.0 version. Whereas Ubuntu 16.04 and above ship with ruby2.3

Eventually I decided to write my own S3CodeDeployer in GoLang. It has no dependencies. Its just a binary file that runs as service on your Linux machine.

Note: You’ll need to have versioning enabled for respective S3 Bucket.

This program will check for latest version and download tar ball / zip from S3 and extract all the files into respective Application directories as defined in yourconfig.yml . This agent will also run BeforeInstall and AfterInstall hooks once the application is deployed successfully.

A detailed document for Debian, Ubuntu and RPM is located at:

For demo purpose ill be using Ubuntu 16.04 (Xenial) .

First we need to add GnuPG Public Key:

$ wget — no-cache -O — | sudo apt-key add -

Add Source for Ubuntu 16.04

$ echo “deb [arch=amd64] xenial main” > /etc/apt/sources.list.d/s3-codedeployer.list


$ apt-get install s3-code-deployer

Create a config.yml file in /etc/s3-code-deployer/config.yml

revision_check_duration: 10 // in minutesaws:
deployments:- application:
environment: staging
destination: /var/www/html/
- application:
environment: production
destination: /var/www/html/
# You can add as many applications as you want.

Thats it, now restart s3-code-deployer service:

$ service s3-code-deployer restart

That’s it! Your applications will now be auto-deployed once a tar ball is updated on your S3 Bucket.

Written by

Product Lead at StegoSOC

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store