How I Set Up My Development Machine on Windows

Tweet

Every developer is different. This article is not an explanation of what is “best” or what you “should” do, it is simply a look at one developer’s tools. I work with PHP, HTML, MySQL, CSS, and JavaScript, so pretty par-for-the-course web development here.

SitePoint recently published an article on a similar theme, minus the “in Windows” part, written by Shaumik Daityari. He uses Ubuntu as his development machine, so I thought it would be nice to review a similar setup from the Windows side of things.

A Fresh Install

I’m going to assume I have a fresh install of Windows 7 Pro and starting from scratch. I use Ninite to install all my favorite tools on a new machine. These include the latest browsers, as well as:

These are some of the programs I install, but there are many more non-dev-related programs to fetch as well. If you haven’t used Ninite to setup a new machine, you’re missing out, it makes the process so much easier!

Getting ready to install programs with Ninite

About the Basic Tools

As mentioned, I install all browsers so I can test locally on each one. There are web services that will show you how your project renders in different environments and on older browsers, if need be. You might want to check out BrowserShots or Browserling for multi-browser rendering. They both have free tests you can run.

FileZilla is for my FTP needs, Notepad++ is my general text editor to replace Notepad in Windows (I also use a plugin to edit Hex files.

WinSCP is a tool for working in the filesystem of my Linux servers over SFTP with a visual drag-n-drop interface, and PuTTY is my remote console SSH tool.

I use 7-Zip for compressed files, Greenshot for taking screenshots and annotating them, and Dropbox is where I keep a lot of files of individual clients with invoices, spec sheets, server and hosting information, to-do lists, training material, and a lot of other data. I also use Dropbox to share screenshots and files.

I’ll also mention Evernote as a brilliant note-taking application.

Special mention are the following handy tools: ColorMania, jRuler, and of course Firebug for Firefox.

The Editors

Next I need some apps not found on Ninite. I install:

Readers here will be familiar with Sublime and NetBeans. I use Sublime mostly for getting projects started, working smaller projects, or doing quick edits.

NetBeans is for much larger in-house projects when I need all those extra features and references. I use Sublime’s “save_on_focus_lost” setting for all my editing; all I do is make my changes, then click over to the browser and refresh, Sublime saves automatically when losing focus. It also saves you from having to run a “Save-all” command if you have many tabs open, as it will save each tab when you click to another. Just add "save_on_focus_lost": true" to your user settings file.

Using Sublime Text 3

Notepad++, already mentioned, can also be tossed in as an editor, as I use it quite often when I want to open files outside the IDE environment.

There are many other tools for editing and seeing “live” changes as they happen without having to save, for example you might try JetBrains PhpStorm, or the very clever Brackets editor.

PhpStorm will cost you, but it is a very nice editor. I personally didn’t find Brackets very robust when I tested it some time ago, though it has probably improved a lot since then, and it is free and looks a lot like Sublime. Regardless of which editor you choose, it should be comfortable for you, and do what you need.

For my needs, and the projects I work on, I’m fine with an old school “save and refresh” method of editing. Sublime also has the best color theme (Monokai) that I’ve ever used, better than Monokai in any other editor I’ve tried. (Super tip: I use the font Consolas in 13 point for a near perfect editing experience!)

Within Sublime, I install Package Control straight away. Next I search for some packages: I’ve installed Emmet, Phpcs, and Xdebug Client for example. The plugins I use will come and go; I like testing different code sniffers, coding standards helpers, language references and so on. I was working with the ProcessWire CMS recently and a quick search in Package Control found a plugin for adding ProcessWire snippets. You never know what you might find in there!

DevDocs is not an editor, but a language reference tool I’ve been using for a while. It lets you select which languages you are interested in, and the fuzzy search tool will find whatever function you’re looking for as you type it.

Using DevDocs

Check out Bruno’s article on DevDocs if you want an overview of its features.

The Server

With all of that out of the way, it’s time to get a server running! This is where everybody is going to differ in how they work — my way is just one and some may argue it’s not even a good one! For the number and size of projects I work on, this method works great for me, but I do realize that in a larger environment with larger projects or when working on teams, etc, this may not be the best setup.

I use WAMP directly on my machine. WAMP is, of course, the Windows Apache MySQL PHP server application. It installs quickly, requires very little configuration, and can be ready to serve your projects in no time.

WAMP Panel

I have also used a dedicated server in my office, a virtual machine (both locally and on other hardware), and cloud servers from InMotionHosting, DigitalOcean, HostGator, and others.

If I work on a remote server, that is where I will use PuTTY, WinSCP and FileZilla. If I work on local hardware, I may use Remote Utilities, Terminals, or some other remote tools.

If I use a Virtual Machine, it may be VirtualBox, or VMware vSphere. All of those alternate server configurations are, in my opinion, a little to a lot more complex to use, unless you set them on frequently. I don’t even have the space to begin talking about Vagrant or PuPHPet, which set out to make setting up virtual servers much faster and easier. Search SitePoint for “Vagrant”, “PuPHPet”, “Puppet”, “VirtualBox” and so on for more information about automation of virtual development servers.

If you need to match the specs of the live server exactly, you may be better off running a virtual machine and setting up the exact specs that way. This is where Vagrant would shine. DigitalOcean also has some options when setting up a “Droplet” as to what OS to run and so forth. Whatever the need, there is a solution!

I use WAMP for all my initial development, testing frameworks and CMSes, writing small apps to help myself with projects, etc. It is quite powerful in letting you run different versions of PHP, MySQL, and Apache side-by-side, depending on your needs.

One example where WAMP was quite helpful was in recovering MySQL data from an old backup of WAMP from years past. The data was in an older version of MySQL and couldn’t be opened, so I simply installed an old version of MySQL right in WAMP, accessed the data, exported it, switched versions back to the new one, and imported.

The Database

I install Navicat for MySQL, my preferred database management tool. It is not free, but it’s not that expensive either if you use it professionally. You can manage remote databases, import and export many formats, merge databases, copy structures around, read server variables and status, repair DBs, sync data, automate backups, build reports and queries, the list goes on.

Something like PHPMyAdmin can probably get you 80% of the way there, but Navicat will enable some pretty cool stuff if you use it. I actually have it connected to every MySQL database I work on, on all our servers. It has been especially handy for me to use for importing CSV data. An alternate free MySQL manager I’ve used would be MySQL Workbench and HeidiSQL which also connects to multiple servers.

Navicat for MySQL

Domain

If you develop this way, you will most likely run each project in a subdirectory of localhost. That is, “/localhost/projectA/” and “/localhost/projectB” for example. This is fine, but if you need to copy your project to a real web server, be aware to never use hard links to localhost! Always try to use relative links, and if you must use hard links, be aware of what will be needed to move your project to another domain (config edit, database update, etc).

On a live server the project will likely run on the web root folder, whereas in WAMP it will likely be a subfolder of localhost. This will throw off links like “/images/” where the slash would normally take you to the root folder. On WAMP you still have to go to your project folder, such as “/projectA/images/”. You don’t want to hardcode your project folder either, so use a PHP variable to create links, or set the base directory in htaccess or PHP or whatever you use.

This is especially important for CMSes like WordPress where some links have to be changed before the move, or other systems where you might even have to edit the configuration in the database itself after moving the site.

Outside Access

If you want people outside your network to access your server, like I do, then you might set up a domain or subdomain to point to your IP address, such as “dev.example.com”. You have to open ports on your router and configure the firewall for this to work. This is the main drawback of “local” development. If you want “outside access” to view the websites, you’ll have to open up your machine to the world and work out some kind of user access security.

If you need to show a client your work, they need a way to view your server, so you might use htaccess passwords, or use a random port to direct port 80 traffic, or use an IP whitelist, or some other security measure.

If you are open to the world, you will also have to find ways to prevent bots from scanning your projects and making the URLs public! Because we are using Apache, htaccess is your friend. Learn how to set up passworded folders, IP whitelists, and use robots files.

Inside WAMP, you’ll configure the port to listen on, and make sure you set your server to be “online”.

It is beyond the scope of this article to delve in to all of this configuring and security, but just be aware of it.

On a related note, you might want to check out Patrick Catanzariti’s recent article on accessing localhost from anywhere, which might help in this area.

Wrapping it Up

With my development machine set up in this way, I can create databases and manage them easily with Navicat, create new folders and work on projects instantly with Sublime.

If I need source control for a project through GIT, which I do sometimes, I have SourceTree for this. It is a visual tool, which some of you purists may despise in favor of the command line, but I find it easy to use when needed. I have a Bitbucket account for these projects to live in.

Sourcetree with one project added

I hope you found this useful and maybe found a tool or two to add to your own development setup. Again, this works for me because I develop mostly internal company projects and tools, so I don’t require a team, or multiple locations to develop in, or even source control for most projects.

Outside access is limited. I would recommend my setup for anyone just getting started in development and learning to code, as most of the tools are free, no command line knowledge is needed, and it’s easy to change settings and configurations.

Let me know your favorite Windows development tools in the comments. I am always open for trying new tools!

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.

  • Andrew Frazier

    If you set up Virtual Hosts in WAMP you don’t have to worry about links beginning with a slash pointing to the root folder.

    • http://www.zacksdomain.com/ Zack Wallace

      Very true. But my projects are almost 95% in-house and never leave our own servers. Sometimes I’ll build a tool only to use once. I imagine if someone is just learning web design and burning through a lot of projects, they wouldn’t have to bother with it. But for something meant for production, definitely learn to edit the virtual hosts!

  • http://magnetik.org/ magnetik

    Using reddit let me point you to my project of netbeans PSR1/2 settings : http://maniaplanet.github.io/netbeans-psr/

  • Miles Johnson

    So why aren’t you just using Vagrant?

    • http://www.zacksdomain.com/ Zack Wallace

      In a word, overkill. I have, for example, about 12 projects I’m working on, and having 12 VMs just to run them each is silly. Running 1 VM for ALL of them is also silly, given I can just run them in WAMP which is already setup on port 80 and ready to go. Nothing wrong with the VMs either, but in my case it’s kinda like putting on a fireman’s suit to grill a burger.
      If I have a project for public use or passing to a client, I’ll work on their own server, or on my VM or Digital Ocean droplet, not in a local WAMP.

      • Abel de Beer

        You have valid points for NOT using Vagrant. To be honest, currently I also develop all my projects on a local web server (MAMP, since I’m on Mac), but that will change. In my opinion, the biggest advantages of Vagrant become apparent once you do a lot of different projects with a larger group of developers:

        1. Vagrant configurations are portable, meaning all developers will have the same server running. (no more “it works on my machine”)
        2. Different projects have different requirements. If your target deployment environment is PHP 5.3 (the horror!), you can easily set up a Vagrant box to replicate that exact environment.
        3. Vagrant makes it much easier to add or update tools and (PHP) extensions through provisioning.

        Like I said, at my company we’re not there yet, but we’ll definitely be moving to a portable VM structure in the future. PuPHPet got me most excited about Vagrant.

      • Miles Johnson

        Like Abel said, you’re reasoning isn’t enough to disregard Vagrant.

        * Vagrant configurations are re-usable.
        * Multiple VMs aren’t running at the same time, just the project you are working on.
        * Server environments are the same between dev/prod/etc.
        * You’re actually developing on Linux and not Windows as most prod servers are Linux.
        * You get access to a true command line.
        * You can use different PHP/MySQL/whatever versions.
        * You don’t have to install PHP/MySQL/whatver on your Windows machine.
        * And so much more.

        I develop on both Windows and Mac and I can honestly say that development on a Windows machine is garbage. Vagrant at least remedies many of the issues. You should give it another try.

        • https://www.raptor-editor.com/ Petah

          I develop on both Windows and Mac and I can honestly say that development on a Mac machine is garbage.

          • Miles Johnson

            Can’t tell if you’re trolling or not. The command line and Homebrew literally blow anything that Windows has to offer out the window.

          • https://www.raptor-editor.com/ Petah

            No, not trolling. Just expressing my opinion as you have yours.

          • Miles Johnson

            So what’s your reasoning for liking Windows over Mac?

          • https://www.raptor-editor.com/ Petah

            Well to contrast your points, on Windows you don’t even need Homebrew, almost all things are already compiled and available for download (1 notable thing missing would be HHVM).
            As for the command line, Windows has everything Mac has to offer, and a little more (Powersheel). Bash, Z Shell, etc are available. I however use Console2 and some standard nix tools (grep, less, tail etc).
            As for more reasoning I don’t feel the need to justify my opinion, as it is just that, an opinion, and others may vary. Also don’t get me wrong, I manage a studio with about 20 iMacs, Mac Books, Mac servers, iOS devices, as well as linux and windows machines. They are all equally capable of accomplishing the tasks at hand.

        • http://www.zacksdomain.com/ Zack Wallace

          All points are true, so it only boils down to what is convenient and useful at the time.
          I don’t need reusable Vagrant configurations, since my dev setup is already configured and works for my needs at all times, thus saving my time and energy.
          My server environment rarely changes anyway, as I develop most stuff directly on the hosting server (whatever that is). My private tools and projects simply stay on my machine anyway.
          WAMP can use different versions of services too.
          Sometimes I really don’t work on just one project at a time. I once had a complicated data migration that had me build 4 separate apps to get done, and I worked on them side by side.

          Does the statement “I need an app to do X” translate into “I’m going to install four complete operating systems and hosting environments”?
          It’s kind of like saying if I want to read email and listen to music at the same time, I need two computers next to each other on my desk.

          I have zero issues against Vagrant, but I still consider it overkill only for my own specific needs. That is not to mention the fact that I tend to host the apps on my box as well, and if I didn’t, then the VM really would need to stay on all the time. I think my machine is way slower running VMs all day, than simply having PHP and MySQL installed.

          To each his own!

  • http://www.zacksdomain.com/ Zack Wallace

    Both FileZilla and WinSCP get used regularly here, they both have some unique features between them. I find FileZilla a little faster though. As far as allmyapps, Windows is certainly desperate for a good app manager! So far Windows 8’s is….meh

  • vkb0310

    I too use Windows for development both at work and home, but I’m considering switching to mac. Does it have any advantages over windows?

    • http://www.zacksdomain.com/ Zack Wallace

      It gives you access to more cool command line “Linuxy” stuff and tools. Easier for Ruby and Rails dev, SASS is more native there, and so on. It is closer in nature to a real Linux server (which most of the web runs on) so it is closer than Windows is at a truer hosting environment. Nevertheless, the next step in Windows dev is probably not to move to Mac, but rather to start using virtual machines with actual Linux servers (Ubuntu or CentOS). Maybe someone else can chime in about their switch to Mac, I certainly haven’t done it.

      • Vivek Kumar Bansal

        One of my colleagues also, suggested that I set up a VM (with shared folders).

        • http://www.spectrakey.co.uk/web James Warren

          Personally I don’t see the point of using a Mac to ‘get closer to Linux tools’ when you can have Linux in a VM as you suggest.

          Vagrant is a really useful tool for configuring VMs for different architectures/projects, as a bonus you can source control the VM config if it’s project specific. Team mates can then easily run the same dev environment.

      • Guest

        Personally I don’t see the point of using a Mac to “get closer to Linux tools” when you can have Linux in a VM as you suggest.

        Vagrant is a really useful tool for configuring VMs for different architectures/projects, as a bonus you can source control the VM config if it’s project specific. Team mates can then easily run the same dev environment.

    • http://id.linkedin.com/in/rizky Rizky Syazuli

      when you’re talking about Mac vs Windows in terms of web dev tools. both are equally capable nowadays. although like Zack said, OSX is unix-based. so there are more command line utilities available for Mac users.

      our dev team uses Mac, Windows and Ubuntu at work. we never had any problems working together so far. because all the tech we used are cross-platform. and VMs is alway available to develop those proprietary Windows tech.

      so, outside of that, it’s more of a personal preference. i’m a Windows user in the past. but i’ve moved on :P

  • Pierre Joye

    You really miss ConEmu, the console tools to have :)

  • Marc

    If you are using Filezilla you are just doing it terribly wrong. I’ve already had 2 “hacking” cases due to it storing saved FTP credentials in plain text. Just uninstall it please, so you don’t have to apologize to someone after your FTP credentials have been used to turn a server into a spam-sending machine or something worse.

    • LouisLazaris

      Marc, do you have a source link explaining these security problems that you’re claiming in FileZilla?

      The fact is, if you’re going to ask people to uninstall any apps that store passwords in plain text, then you’ll have to uninstall Google Chrome too, as this post explains:

      http://blog.elliottkember.com/chromes-insane-password-security-strategy

      Also, I think the following post sums things up nicely regarding FileZilla and security:

      http://security.stackexchange.com/questions/39321/should-i-use-filezilla

      FileZilla is as secure/insecure as any app running on the system that isn’t using some kind of encryption. But like that top comment on StackExchange mentions, the encryption can only go so far. Anyhow, like I said, I’d be happy to look at any source links you might have about the insecurities of FileZilla specifically, but I think in general this problems would apply to pretty much any method being used that involves passwords being stored.

    • http://appsapps.info/ app

      A very easy solution is to not store your passwords in your FTP app (use a real password manager like KeePass to store them), and to clear your history when you are finished using it.

  • Lee Timmins

    IIS is also a good web server and it’s built into Windows. It’s pretty easy to get PHP working alongside it, aswell as ASP.NET. I also install ISAPI Rewrite 3 (by Helicon) which allows my rewrite rules in my .htaccess files to work. This is really all I need for development purposes until I’m ready to upload.

  • http://www.dev-metal.com/ Chris

    Regardless of your operating system: It’s in general better to CLEARLY SEPERATE each project you have, USING A 1:1 ENVIRONMENT COPY and not messing them up inside your local shared environment! Working on localhost is still “standard” in lots of companies, but let’s be honest: Do you really want to work on 7 projects (that have different configs, different setups, different php versions, use different command line tools etc) inside the same environment ? For small stuff it might be totally okay, but working inside something that is 1:1 like the production server is SO MUCH BETTER. Do yourself a favour and work on real servers (you can easily protect them against public access) or inside Vagrant boxes. It will save you masses of time, stress and money. Every modern IDE can sync your work in “real-time” with your server. Give this workflow a try, just once!

  • hot_rush

    how i prepare my windows machine for work with php stack:
    1) format hdd
    2) install linux

    3) profit

    delete this post and don’t teach people to use windows when working with php stack, ofc

    • http://appsapps.info/ app

      Please don’t be an OS bigot. Nobody likes an OS bigot.

    • http://glennedixon.com/ Glenn Dixon

      I started off running Ubuntu on a Chromebook. High cool/nerd factor, much more liberating than being stuck in Chrome OS.

      And then a client sent me an Adobe Illustrator file…

      Now I’m on Windows, running Photoshop and other Adobe tools as well as all of my dev software. And I profit just fine, thanks…

  • http://joshuachristensen.net/ Joshua Christensen

    Personally, I just install Visual Studio and I’m done. IDE/Code editing for god knows how many languages now (and not just MS languages), web server, database, FTP/WebDAV, source control… did I miss any of your tools? Why in gods name do you need 4 IDEs AND Notepad++? I’d take WinRAR over 7-zip any day.

    • http://www.zacksdomain.com/ Zack Wallace

      Indeed. I suppose there is one big reason and it begins with “$$” and ends with “$$”.

      • http://joshuachristensen.net/ Joshua Christensen

        Ugh, you’re one of those. Actually, Microsoft has offered free versions of the tools for years. You pay for more enterprise features. Which, honestly someone with that childish bias is never going to get the projects requiring enterprise features.

        • http://www.zacksdomain.com/ Zack Wallace

          I’m not “one of” anything. I have used their free versions and have written applications in both Basic and C#. I’ve also owned paid versions years ago. And now, I also work just fine in easy to use, free tools for web projects.

          I don’t know why people can’t grasp the concept, use appropriate tools for the job!
          Do I need to purchase and install the mammoth that is Visual Studio and configure it for PHP, just to write a one-off tool to do some CSV parsing and data manipulation?

          I don’t “need” 4 IDE’s, I just listed some good choices for people. I use Sublime 90% of the time, Notepad++ as a default text editor. Do you use Studio for your default Windows text editor? I didn’t think so.

          People are free to use whatever tools are at their disposal. The cost of Studio certainly puts some people off. If your company has those “enterprise” needs, they should certainly buy enterprise products.

  • LouisLazaris

    Yes, and this link discusses similar, in more detail:

    http://blog.unmaskparasites.com/2009/09/01/beware-filezilla-doesnt-protect-your-ftp-passwords/

    But even knowing all of that, doesn’t change the fact that your security only goes as far as the OS. For example, if you type your password for every site you connect to via FileZilla, are you memorizing them? Or are you storing them on your computer?

    If you’re storing them on your computer, then you’re back to square one. Sure a password manager will hold everything in a supposedly secure manner, but ultimately, if all it needs is a single master password to access all your passwords, how secure is that? And if you are just memorizing passwords, then they’re probably not very secure passwords, causing potentially worse problems.

    Again, I’m not saying that FileZilla is secure, I’m just pointing out that in some cases, taking these precautions may not ultimately accomplish much. If malware has gotten onto your computer, probably the password manager is going to be attacked too.

    • http://appsapps.info/ app

      I would worry a lot less about an encrypted, password protected file full of passwords stored in an unknown location on a hard drive, than I would 2 plain text files full of passwords in a known location on someone’s hard drive. Those 2 plain text files are low hanging fruit, full of nothing but FTP passwords, much more likely to be attacked.

      Don’t just assume that all malware is going to go after anything that has passwords in it, just because, you know, passwords. For maximum payoff, it’s more likely to go after something easy, where the payoff is pretty much guaranteed, with very little work involved…like plain text files that won’t need cracking. Malware authors hope to acquire in bulk, and 100,000 plain text files full of nothing but FTP passwords is of greater value to them than 100,000 encrypted files that will require extra time or work to crack.

      And in this case they are looking for webmasters lacking in the brains department, which is really easy to find when they insert their malware code into free (or pirated premium) WordPress templates and distribute them on less than reputable sites, where less security savvy webmasters will think it’s ok to download & use them, then wonder why all of their sites have malware and spam links on them, and how all of their website passwords were compromised, including the ones without WordPress.

      And KeePass does allow you to use a combo of both a password and key file, which ideally wouldn’t be stored on your system’s hard drive. ;)

      • LouisLazaris

        Thanks for the info. Sounds reasonable to me, and is probably good advice.

        I don’t know what your name is, but if you’re ever interested in writing an article about the stuff you’re talking about here, we’d love to see it published on SitePoint. Would be worth $150 – $200. Feel free to contact me at [louis.lazaris at sitepoint .com] if you’re interested.

        Thanks!

        • http://appsapps.info/ app

          Ha! I already work for SitePoint/Learnable, in Customer Support. And I am kept plenty busy writing personalized learning paths. ;)

          But thanks for the offer. :)

          • LouisLazaris

            Ah!! haha, that’s pretty funny. No wonder you’re so smart! :)