--- title: Installing AltoRouter layout: default ---
To install using Composer, you will have to install Composer first.
{% highlight bash %} curl -s https://getcomposer.org/installer | php {% endhighlight %}Create a composer.json file in your project root.
{% highlight json %} { "require": { "altorouter/altorouter": "1.1.0" } } {% endhighlight %}Tell Composer to install the required dependencies.
{% highlight bash %} php composer.phar install {% endhighlight %}If you want to use the autoloading provided by Composer, add the following line to your application file.
{% highlight php startinline %} require 'vendor/autoload.php'; {% endhighlight %}You are now ready to use the AltoRouter
class. Rewrite all requests to your application file and start mapping your routes.
Just download the AltoRouter class and require it in your application file.
{% highlight php startinline %} require 'AltoRouter.php'; {% endhighlight %}