---
# System prepended metadata

title: How to install and use Envoy

---

# How to install and use Envoy

## Install php
```console
apt update
apt install php
```
## Install composer
```console
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/bin/composer
```

## Test composer
```console
composer
```

## Install git
```console
apt install git
```

## Instalar Envoy
```console
php composer global require laravel/envoy
```

## Test envoy
```console
~/.composer/vendor/bin/envoy
```

## Simple demo

### create new directory
```console
mkdir my-project-envoy
cd my-project-envoy
```

### create Envoy.blade.php
```php

@php
	$servers= [
		'local' => '127.0.0.1'
	];
@endphp

@servers($servers)


@task('t1',['on'=>['local']])
	echo "Hola mundo"
@endtask

```

## Test demo task

```console
envoy run t1
```