Development Environment Setup with Ubuntu on Mac and Amazon EC2

I am in the middle of rebuilding my development environment and I have decided to use Ubuntu on virtual machine running on Mac OSX. That way, I can build applications much closer to the production environment in terms of libraries, tools, binaries that I can use than on Mac OSX. That’ll also help keep my local Mac OSX clean that’s used for other purposes, i.e. YouTubing.

Here’s what I came up with:

Development Environment - Mac to Amazon


1. Ubuntu in Virtual Machine

Setting up a virtual machine is pretty simple task thanks to intuitive virtualization software. I use a proprietary software Parallels Desktop but Virtual Box that’s free also des the job. You can use disk image downloaded from Ubuntu website to install a clean Ubuntu onto the virtual machine. After installing Ubuntu (and GUI if you like), you can set up port forwarding in your virtualization software, and you’ll use the port to ssh from host (your local machine) to guest (the virtualized Ubuntu). The ssh command is like:

.. and the example in my case with forwarded port of 2222 is:

Done. Now you’ll use this as a bridge to access Ubuntu in Amazon EC2.

2. Ubuntu in Amazon EC2

Setting up an Ubuntu instance is not as straight forward as Amazon Linux. Amazon Linux is always recommended option as it comes with bundle of useful utilities including support of Amazon EBS. Amazon EBS comes handy if you want to retain backend data even after relaunching instance. Setting up one on your own takes more than a few lines of commands, and a community develops pre-configured Ubuntu image for Amazon ECS. You can choose the region that you like from the list on the right menu, clicking on the link will bring you to Amazon EC2 web command console for further configuration. I tried both, but this is a lot easier than doing it on my own as I have to terminate the instance (that means you destroys it) to redo it again.

In Ubuntu, you’ll run the list of commands that’ll set Ubuntu up, you can access this environment via ssh with public key given by Amazon EC2. The command format is:

 

.. which in my case is:

 

I got confused in different packaging command difference in Amazon Linux and Ubuntu, but this is relatively straight forward steps.

One thought on “Development Environment Setup with Ubuntu on Mac and Amazon EC2

  1. Pingback: Migrating WordPress from Amazon Linux to Ubuntu | Sweet Remedy

Leave a Reply

Your email address will not be published. Required fields are marked *