---
title: Installation & setup
weight: 2
---

You can install the package via composer:

```bash
composer require spatie/laravel-sitemap
```

The package will automatically register itself.

## Publishing the config file

Optionally, you can publish the config file:

```bash
php artisan vendor:publish --provider="Spatie\Sitemap\SitemapServiceProvider" --tag=sitemap-config
```

This will copy the default config to `config/sitemap.php` where you can edit it.

```php
use Spatie\Sitemap\Crawler\Profile;

return [
    /*
     * These options will be passed to GuzzleHttp\Client when it is created.
     * They are merged with the crawler's defaults (cookies enabled,
     * connect timeout 10s, request timeout 10s, redirects followed).
     *
     * For in-depth information on all options see the Guzzle docs:
     *
     * http://docs.guzzlephp.org/en/stable/request-options.html
     */
    'guzzle_options' => [

    ],

    /*
     * The sitemap generator can execute JavaScript on each page so it will
     * discover links that are generated by your JS scripts. This feature
     * is powered by headless Chrome.
     *
     * You'll need to install spatie/browsershot to use this feature:
     *
     * composer require spatie/browsershot
     */
    'execute_javascript' => false,

    /*
     * The package will make an educated guess as to where Google Chrome is installed.
     * You can also manually pass its location here.
     */
    'chrome_binary_path' => null,

    /*
     * The sitemap generator uses a CrawlProfile implementation to determine
     * which urls should be crawled for the sitemap.
     */
    'crawl_profile' => Profile::class,
];
```
