Navigation

Part 2 - Installing a web server

Windows

On Windows there are lots of "bundle installers" available which package together and set-up popular web technologies like Apache, PHP and MySQL from a single exe.

We would recommend WAMP.Net. It has an easy set-up guide available, installs an icon into your system-tray from which you can stop and restart the services, as well as modify Apache or Nginx settings and makes creating new sites a breeze, including with SSL certificates.

Cesanta provide the Mongoose web server. This is a really small application that requires no installation and can run as a single exe file. Without all of the additional bundles like SSI and WebDAV (none of which you'll need for an HTML5 game) the exe is a paltry 45KB in size. Even the fully featured version is only 355KB.

Instead of an 'all in one' solution you could also download a web server on its own. Both Microsoft IIS and Apache can be downloaded for free.

macOS

Being a Unix environment at heart there are more options available on macOS than Windows. But if you'd like an "all in one" approach like WAMP, with a nice clean and easy to use interface, then we'd strongly recommend MAMP. This comes in two versions: one free and one paid for.

Naturally there are also guides for setting up a local web server manually, such as this guide written for Mountain Lion. Pick whichever approach you feel most comfortable with.

Simple HTTP Server with Python

If you need a quick web server running and you don't want to mess around with setting up Apache or downloading an app, then Python can help. Python comes with a simple built-in HTTP server, which can serve files from any local folder. Naturally the only thing you need to have installed is Python. Read the full guide here

http-server for node.js

http-server is a simple, zero-configuration command-line http server for node.js. It is powerful enough for production usage, but is simple and hackable enough to be used for testing, local development and learning. Or as the web site says "Serving up static files like they were turtles strapped to rockets". Get the npm and instructions from the http-server web site

php built-in web server

As of PHP 5.4.0, the CLI SAPI provides a built-in web server. It's only really suitable for development purposes and serves all files sequentially, but is easily powerful enough for testing HTML5 games. It's invoked from a single command-line call and you can find details on how to do this here in the PHP Manual.

grunt connect

Grunt is an extremely powerful tool to have installed, regardless if you use it as a web server or not. At its essence it's a JavaScript based task runner and allows you to automate tedious time consuming tasks. We use it in Phaser to build our distribution scripts for example. But it can also be configured with the plugin Connect to serve local files, acting as a web server.

However you do it, it's important to have the ability to serve files locally. With that done you're ready for picking an IDE in Part 3.