How I Set Up My Development Machine

Shaumik Daityari

Every developer has a set of tools that make their life easy, without which their development life feels crippled! Over the years, I have developed my own set, which I describe in this post. The primary OS for my development related tasks is Ubuntu, and I would assume that you have one of the latest versions of Ubuntu (12.04+).

When I started off developing, I only knew basic PHP. Setting up a development machine was as easy as installing PHP5, MySQL and changing the home directory of Apache2.

But over the years I have changed as a developer and the tools that I use have evolved too- so it’s safe to say that next year, I will probably read this and smile, full of new tips and tricks.

Except for Google Chrome and Sublime Text, everything else in the list can be installed through the command apt-get. Therefore, I have written a simple bash script which installs them in sequence. Note that a few (like mysql-server) require you to set certain options (like a password for the root user) before the installation can be completed.

Here’s what I absolutely need in a development machine.

Google Chrome

Google Chrome

Google Chrome is undoubtedly the most popular browser out there- and rightly so. Chrome has a lot of features but the one little thing that edges it past every other browser out there is a powerful sync feature. I really like the fact that if I perform a Google search on my desktop and check my smartphone moments later, I can see it among my Chrome searches.

Firefox’s sync is getting there, but not quite there yet. This is the first thing that I install because many other things on my list could run into issues, which would usually require extensive Google searches to fix.

Chrome Extensions

Chrome comes with a lot of features, but it’s really incomplete without the extensions that I use. The most important extension is AdBlock Plus, to remove ads from the web. When developing you need to be able to see the site as your users do to properly test changes, and according to some reports one fifth of users install ad-blocking extensions so it is nice to test both with and without ads.

The next addon that I install is Pocket. As a developer you often find there are wonderful articles out there, but you don’t always have the time to read them- that is where Pocket comes into play. It saves these articles and syncs with your other devices so that you can read them anytime later.

YSlow is another great extension for Chrome, which tells you why a certain page is slow. Another essential extension is Screen Capture for situations where pressing the print screen button is not enough. Lastly, I work with Todoist to manage my daily activities.

These extensions get synced once I sign into Chrome, and I don’t have to install them every single time.

It might so happen that a new version of Ubuntu might not be compatible with the latest version of Chrome. In that case, you could either install the development version if the issue has been solved there, or install Chromium, which provides you with the same sync capabilities.

Text editors

Installation of many other tools and services on this list could involve editing text based configuration files. How can I do this without my favorite text editors?

Sublime Text

I prefer Sublime Text when I work on a local machine. However, when you are working on remote server, a CLI based text editor is required. Ubuntu comes installed with VI, but a more capable one is Vim (Vi Improved). After installation, I configure Vim by editing the .vimrc file to set up certain properties like tab spacing. A similar setting is tweaked in Sublime Text by changing its preference files (for either default or user levels).

For Sublime Text, you can change the a lot of settings in the preferences file. I prefer using the Soda Dark theme.

Next, you should try out the range of plugins available for Sublime Text.

  • GitGutter shows in the gutter area, whether a line has been added, modified or removed, according to Git.

  • Pylinter checks Python files for errors when they are saved and shows violations.

  • All Autocomplete is a plugin that extends the autocomplete word list to all the files that are open. T

These are just a few and it would take a separate post altogether to describe Sublime Text plugins. I suggest you have a look at front end specific, PHP specific or Python specific plugins for Sublime Text.

Version control software

The next step is to install version control software. If you’re involved in open-source development, installing Git, Mercurial and Bazaar should suffice, as most projects use one of these three. You can skip installing Subversion because open source projects these days have largely moved on from Subversion.

Installing them is pretty easy with the Ubuntu Package Manager. Unless you want beta versions, you can set them up with just apt-get install. If you want unstable development versions, you might have to get a tarball from their websites and build them on your system.

Database Management

Snapshot of a database

Source: atutor.ca

Most web applications need a database for storing data. Before you install any such software, it is advisable to install a database. The most popular relational database management system is MySQL, but you may want to go ahead with something like MariaDB (which started with a fork of MySQL after Oracle stalled its development) or PostgreSQL.

If you want to go with NoSQL, you may install MongoDB or Cassandra.

PHP, Python, Ruby, Node.js

After setting up a database, I get a few languages and frameworks on which popular web based projects run. PHP, Python, Ruby and Node.js are the top options. I don’t install the Java SDK unless I need to run something that specifically requires it.

Most of them have different packages to connect to databases (like php5-mysql or MySQL-Python). Make sure you install the packages that are required.

Python specific packages

Since I use Python as my go-to language, there are a few Python-specific packages that I install. Firstly, I install pip, which is a package manager for Python. easy_install is another package manager, which I install through pip. Then, I move ahead with the installation of django, a web framework in Python. Further, I get the package beautifulsoup, which is a parser for HTML (or even XML) documents. Lastly, ipython gets me a better python shell and ipdb helps in better debugging.

Change Apache2 home directory

In Ubuntu, a web server in the form of apache2 is installed by default. However, one little problem is that the home directory is /var/www/ by default. The directory /var/www/ requires root privileges to create or change files. If you are working on a development machine, it becomes cumbersome to prefix sudo to each command.

An easy way to fix this is to shift the home directory to your home folder (/home/[username]/), so that managing files and directories is easier.

Set up custom aliases in terminal

If you work with the terminal often, you know there are certain monotonous commands you frequently need to type. For instance, to start a Django server with a local settings file, we need to type python manage.py runserver --settings=settinngs.local. To avoid typing this every time, you can add an alias to your ~/.bashrc file.

Another useful set of aliases that you could use is .. for cd ../.., ... for cd ../../../ and so on. Here’s a guide on working with .bashrc in Unix systems.

Miscellaneous

Whatever your level of development experience, you probably love listening to music while you work. Although some people prefer Spotify, Rdio, YouTube, or GrooveShark for streaming music, you can install VLC if you are bandwidth conscious.

The last program I install is one that may or may not be required in the development process. GIMP is an image processing processing software, widely regarded as an acceptable Photoshop alternative. Sometimes, a developer might be required to perform minute image processing tasks like cropping, which can be done quickly with GIMP.

With this, we come to the end of the list of software I install on a development machine.

Do you use something cool that I missed? Do let us know in the comments below.

Update: added a paragraph explaining the need for AdBlock when testing.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.growingwiththeweb.com/ Daniel Imms

    Isn’t using an ad blocker a little immoral, especially coming from an author on SitePoint (where ads would be the primary revenue stream).

    • matt

      Lol some irony here. I wonder if these authors unblock ads while here at Sitepoint.

    • jokeyrhyme

      Was just thinking the same thing.

    • OphelieLechat

      With one-fifth of users using some sort of ad-blocking add-on, it’s important to test the site both with and without ads. But yes, in general, we’d like people to see the ads when they visit SitePoint…

    • http://dada.theblogbowl.in/ Shaumik Daityari

      Hi Daniel,

      Number of people using IE is less than number of people using ad blockers (I say the same thing for accessibility though- more people using AT). If you try to make your site look the same for IE users, you should also make it look the same for people using ad blockers. Hence, the addition.

      • http://evanbyrne.com Evan Byrne

        If your revenue comes from ads, then why would you want to try and improve the UX for people blocking those ads? Seems counter-productive to me.

        • http://dada.theblogbowl.in/ Shaumik Daityari

          Any website I have worked on doesn’t have a revenue system based on ads.

  • http://dada.theblogbowl.in/ Shaumik Daityari

    Oh yes, I do use that one too. But that’s a very recent install, which is why it escaped my mind when I was writing this!

  • http://dada.theblogbowl.in/ Shaumik Daityari

    Hi nekrox,

    I think I should try it out :) Thanks.

  • http://dada.theblogbowl.in/ Shaumik Daityari

    Hi,

    Just as nekrox mentioned, I guess it’s time to try out either of vagrant and docker.

  • http://www.matthewdaly.co.uk/ Matthew Daly

    I think it’s a bad idea to install Django globally. Surely it would be a better idea to use Virtualenv and install it individually for each project?

    I can see the value of having ipython available globally, and maybe BeautifulSoup, but I would always use Virtualenv for Django projects

    • http://dada.theblogbowl.in/ Shaumik Daityari

      Hi Matthew,

      I use virtualenv too, but there is a small thing that I do.

      I have a “primary” version of Django in my mind, which I use for all personal projects. That is the version that I install globally on my system. For every other project that I run or contribute to, I use a local version with virtualenv.

  • http://iamdez.com/ Dez

    Your suggestion to change the apache2 home dir is appropriate for servers running only one site, but if you use virtual hosts you can easily change the folder permissions and owners on a per site basis.

    A few of the servers I manage (1 per client) have more than 1 site active on it at a time. To prevent control propogation across sites if something gets file-level access control I use separate users and groups as owners of the individual site httpdocs/htdocs directories. I make sure that the user I login as (via Public Key Auth) is a member of each of those groups and I no longer have to use sudo to do things.

    This also enables me simpler version control usage (in my case: SVN) in those individual site folders as I can do so from my logged-in user’s credentials connecting to my personal SVN server.

    Also, you failed to bring up the importance of setting up public key authentication only access to the remote server and disabling root login via sshd.conf. This is a simple setup and will make your server that much more secure. I use one key per device accessing the server and have a mixed bag of devices (mac & pc). Using Pageant for key forwarding and Putty for connecting via PC.

    Other than that, great article.

    • http://dada.theblogbowl.in/ Shaumik Daityari

      Hi Dez,

      I forgot to mention that you shouldn’t change the home directory for production servers. But, since it’s an article for a development machine, I thought it was implied.

      I assumed that it’s my personal development machine, not a remote server- in which case the approach would be different. I completely agree with what you say though.

      Since you mention ssh keys, one more thing that I could have added was adding my public keys to GitHub/BitBucket.

      Thanks for taking the time to give a detailed feedback :)

      • Ivan Ivanić

        I have another approach for that on dev machine. I add my user to www-data group and allow g+w on /var/www, both work but I prefer this one :)

  • http://dada.theblogbowl.in/ Shaumik Daityari

    I prefer running an OS in its native state to get the full power of the system. I don’t know why but virtual machines for development never quite worked for me!

  • Lasse Rafn

    Adblock? Really.. On a blog, having ads? Irony, much? – Also; that’s just cruel – if you wan’t people to support you; support them.

  • bob

    I actually uninstalled ad blocker recently, apparently it is a memory hog, in your case you may want to enable for testing (see this: http://www.extremetech.com/computing/182428-ironic-iframes-adblock-plus-is-probably-the-reason-firefox-and-chrome-are-such-memory-hogs)

  • http://chrishattery.com/ MadHatrix

    A nice db program (for those who can’t get enough from phpmyadmin) is Navicat. It’s not free, but worth the price.

    For SublimeText, you can sync your packages and settings with Sublimall. Perfect when using multiple machines for dev.