Installation &amp; setup | scotty | Spatie

 SPATIE

  Scotty
=========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Scotty](https://spatie.be/docs/scotty/v1)  Installation &amp; setup

 Version   v1

 Other versions for crawler [v1](https://spatie.be/docs/scotty/v1)

  Installation &amp; setup
- [ Introduction ](https://spatie.be/docs/scotty/v1/introduction)
- [ Support us ](https://spatie.be/docs/scotty/v1/support-us)
- [ Getting started ](https://spatie.be/docs/scotty/v1/getting-started)
- [ Requirements ](https://spatie.be/docs/scotty/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/scotty/v1/installation)
- [ Questions and issues ](https://spatie.be/docs/scotty/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/scotty/v1/changelog)
- [ About us ](https://spatie.be/docs/scotty/v1/about-us)

Basic Usage
-----------

- [ Your first deploy script ](https://spatie.be/docs/scotty/v1/basic-usage/your-first-deploy-script)
- [ The Scotty.sh format ](https://spatie.be/docs/scotty/v1/basic-usage/bash-format)
- [ Running tasks ](https://spatie.be/docs/scotty/v1/basic-usage/running-tasks)

Advanced Usage
--------------

- [ Doctor ](https://spatie.be/docs/scotty/v1/advanced-usage/doctor)
- [ File lookup order ](https://spatie.be/docs/scotty/v1/advanced-usage/file-lookup-order)
- [ Envoy compatibility ](https://spatie.be/docs/scotty/v1/advanced-usage/envoy-compatibility)
- [ Zero-downtime deployments ](https://spatie.be/docs/scotty/v1/advanced-usage/zero-downtime-deployments)

 Installation &amp; setup
========================

###  On this page

1. [ Per project ](#content-per-project)
2. [ Globally ](#content-globally)
3. [ Updating ](#content-updating)
4. [ Creating your first Scotty file ](#content-creating-your-first-scotty-file)

Scotty ships as a single-file phar executable. The phar download is the preferred installation method. Install it once globally, or commit it per project.

The phar bundles its own PHP requirements check. If you run it on a PHP version older than 8.4 (or with a missing required extension), Scotty fails fast with a clear error before any task runs.

Per project
-----------------------------------------------------------------------------------------

Download the phar from the latest GitHub release and drop it into your project:

```
curl -L https://github.com/spatie/scotty/releases/latest/download/scotty -o scotty
chmod +x scotty
./scotty list
```

Commit the phar to your repository so everyone on the team uses the same version, or fetch it during your build step.

Globally
--------------------------------------------------------------------------------

The simplest way to install Scotty globally is to drop the phar somewhere on your `$PATH`:

```
curl -L https://github.com/spatie/scotty/releases/latest/download/scotty -o /usr/local/bin/scotty
chmod +x /usr/local/bin/scotty
scotty list
```

Any directory on your `$PATH` works. Common alternatives are `~/.local/bin` (no `sudo` needed) or `~/bin`.

### Via Composer

You can also install Scotty as a global Composer package:

```
composer global require spatie/scotty
```

Make sure Composer's global bin directory is in your `$PATH`. If you're not sure where it is:

```
composer global config bin-dir --absolute
```

> Installing Scotty as a per-project Composer dev dependency (`composer require --dev spatie/scotty`) is not supported. Scotty is a Laravel Zero application and its `illuminate/*` requirements will conflict with the host application's. Use the phar download or the global install instead.

Updating
--------------------------------------------------------------------------------

Phar installs of Scotty offer to update themselves automatically. After a successful `scotty run`, Scotty checks GitHub for a newer release (once a day, cached locally). If a newer version is available, Scotty asks at the end of the run whether you want to update. The deploy always finishes first, so the prompt never blocks your release.

To update on demand, run:

```
scotty self-update
```

This downloads the latest phar and replaces the running binary in place. Pass `--force` to re-download even if you're already on the latest version.

To skip the post-run update check, pass `--no-update-check` to `scotty run` or set `SCOTTY_NO_UPDATE_CHECK=1` (recognized values: `1`, `true`, `yes`, `on`). The check is also skipped automatically when Scotty is running non-interactively (for example in CI).

Composer global installs upgrade with `composer global update spatie/scotty`.

Creating your first Scotty file
-----------------------------------------------------------------------------------------------------------------------------------------------------

The quickest way to get started is to run `scotty init` in your project root:

```
scotty init
```

You'll be asked to choose a format (bash or Blade) and enter your server's SSH connection string. Scotty creates the file for you.

You can also create a `Scotty.sh` file by hand. Check the [Scotty.sh format](/docs/scotty/v1/basic-usage/bash-format) page for details on the syntax.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
