How to develop your Symfony project online for free!

I’m a professional consultant who have on a regular basis to work from different places and with different computers (pro laptop, personal laptop, personal iMac…) under different OS (Linux, Windows and Mac).

Even if my projects are on some Git depot and an IDE is installed on each computer, it’s sometimes boring to manage some git conflicts because i forgot to push or stash my last updates on a computer.

Therefore, I was particularly interested by the AWS Cloud9 solution that offers you a way to work on your source code with just a Web interface. First, it’s compatible with the PHP Code and so you have access to an interface adapted for your favorite language and framework. Secondly, you can store the code on your own server, which is something interesting sometimes. And last but not least, when you use your own Linux server in backend to manage the project files, the use of AWS Cloud9 is totally free! (and not only during the free tier period…).

To use it, the procedure is simple. Of course, you have to begin by accessing your AWS portal (or creating your account if you don’t have already one). Then, when you select the Cloud9 service, you’ll have access to the option “Create Environment”.

After naming your project, you’ll have in the setting to choose the option to use your own server (connect and run in your own server). If you don’t have one, you can of course use an EC2 instance, but be advised that you’ll have the costs associated with it.

To use you own server, you just have to specify its IP, the user you’ll be using and the SSH Port. To authorize Cloud9 to access to your server, you’ll have to copy their Public SSH Key in your $HOME/.ssh/authorized_keys on your server. I recommend you to change the Environment path as AWS try to use a HOME directory attached to a “ec2-user” user which certainly does not exist on your server.

When you click on Next Step, the first connection will be made to validate your settings. So if you’ve got the message “ Key was successfully copied”, then you’re ready to go and create your environment !

During the next step, AWS will propose you to create automatically your environment. This a great option, but if you choose it, don’t forget to authorize your user to install packages on your server (typically you’re doing that with the sudoers file).

After a few minutes, you’ll have access to your web based IDE, connected to your server. The cool part is that you have, in Cloud9, access to a CLI so you’ll be able for example to clone your GIT repository and then composer update your Symfony project directly in your Web browser.