Skip to content

Commit e82816b

Browse files
committed
streamline install docs
1 parent 3029128 commit e82816b

File tree

2 files changed

+4
-171
lines changed

2 files changed

+4
-171
lines changed

installation.md

+3-152
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@
99
- [Environment Based Configuration](#environment-based-configuration)
1010
- [Databases and Migrations](#databases-and-migrations)
1111
- [Directory Configuration](#directory-configuration)
12-
- [Local Installation Using Herd](#local-installation-using-herd)
12+
- [Installation Using Herd](#installation-using-herd)
1313
- [Herd on macOS](#herd-on-macos)
1414
- [Herd on Windows](#herd-on-windows)
15-
- [Docker Installation Using Sail](#docker-installation-using-sail)
16-
- [Sail on macOS](#sail-on-macos)
17-
- [Sail on Windows](#sail-on-windows)
18-
- [Sail on Linux](#sail-on-linux)
19-
- [Choosing Your Sail Services](#choosing-your-sail-services)
2015
- [IDE Support](#ide-support)
2116
- [Next Steps](#next-steps)
2217
- [Laravel the Full Stack Framework](#laravel-the-fullstack-framework)
@@ -157,8 +152,8 @@ php artisan migrate
157152

158153
Laravel should always be served out of the root of the "web directory" configured for your web server. You should not attempt to serve a Laravel application out of a subdirectory of the "web directory". Attempting to do so could expose sensitive files present within your application.
159154

160-
<a name="local-installation-using-herd"></a>
161-
## Local Installation Using Herd
155+
<a name="installation-using-herd"></a>
156+
## Installation Using Herd
162157

163158
[Laravel Herd](https://herd.laravel.com) is a blazing fast, native Laravel and PHP development environment for macOS and Windows. Herd includes everything you need to get started with Laravel development, including PHP and Nginx.
164159

@@ -207,150 +202,6 @@ herd open
207202

208203
You can learn more about Herd by checking out the [Herd documentation for Windows](https://herd.laravel.com/docs/windows).
209204

210-
<a name="docker-installation-using-sail"></a>
211-
## Docker Installation Using Sail
212-
213-
We want it to be as easy as possible to get started with Laravel regardless of your preferred operating system. So, there are a variety of options for developing and running a Laravel application on your local machine. While you may wish to explore these options at a later time, Laravel provides [Sail](/docs/{{version}}/sail), a built-in solution for running your Laravel application using [Docker](https://www.docker.com).
214-
215-
Docker is a tool for running applications and services in small, light-weight "containers" which do not interfere with your local machine's installed software or configuration. This means you don't have to worry about configuring or setting up complicated development tools such as web servers and databases on your local machine. To get started, you only need to install [Docker Desktop](https://www.docker.com/products/docker-desktop).
216-
217-
Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker configuration. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.
218-
219-
> [!NOTE]
220-
> Already a Docker expert? Don't worry! Everything about Sail can be customized using the `docker-compose.yml` file included with Laravel.
221-
222-
<a name="sail-on-macos"></a>
223-
### Sail on macOS
224-
225-
If you're developing on a Mac and [Docker Desktop](https://www.docker.com/products/docker-desktop) is already installed, you can use a simple terminal command to create a new Laravel application. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:
226-
227-
```shell
228-
curl -s "https://laravel.build/example-app" | bash
229-
```
230-
231-
Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.
232-
233-
Sail installation may take several minutes while Sail's application containers are built on your local machine.
234-
235-
After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:
236-
237-
```shell
238-
cd example-app
239-
240-
./vendor/bin/sail up
241-
```
242-
243-
Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations):
244-
245-
```shell
246-
./vendor/bin/sail artisan migrate
247-
```
248-
249-
Finally, you can access the application in your web browser at: http://localhost.
250-
251-
> [!NOTE]
252-
> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail).
253-
254-
<a name="sail-on-windows"></a>
255-
### Sail on Windows
256-
257-
Before we create a new Laravel application on your Windows machine, make sure to install [Docker Desktop](https://www.docker.com/products/docker-desktop). Next, you should ensure that Windows Subsystem for Linux 2 (WSL2) is installed and enabled. WSL allows you to run Linux binary executables natively on Windows 10. Information on how to install and enable WSL2 can be found within Microsoft's [developer environment documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
258-
259-
> [!NOTE]
260-
> After installing and enabling WSL2, you should ensure that Docker Desktop is [configured to use the WSL2 backend](https://docs.docker.com/docker-for-windows/wsl/).
261-
262-
Next, you are ready to create your first Laravel application. Launch [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab) and begin a new terminal session for your WSL2 Linux operating system. Next, you can use a simple terminal command to create a new Laravel application. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:
263-
264-
```shell
265-
curl -s https://laravel.build/example-app | bash
266-
```
267-
268-
Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.
269-
270-
Sail installation may take several minutes while Sail's application containers are built on your local machine.
271-
272-
After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:
273-
274-
```shell
275-
cd example-app
276-
277-
./vendor/bin/sail up
278-
```
279-
280-
Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations):
281-
282-
```shell
283-
./vendor/bin/sail artisan migrate
284-
```
285-
286-
Finally, you can access the application in your web browser at: http://localhost.
287-
288-
> [!NOTE]
289-
> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail).
290-
291-
#### Developing Within WSL2
292-
293-
Of course, you will need to be able to modify the Laravel application files that were created within your WSL2 installation. To accomplish this, we recommend using Microsoft's [Visual Studio Code](https://code.visualstudio.com) editor and their first-party extension for [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack).
294-
295-
Once these tools are installed, you may open any Laravel application by executing the `code .` command from your application's root directory using Windows Terminal.
296-
297-
<a name="sail-on-linux"></a>
298-
### Sail on Linux
299-
300-
If you're developing on Linux and [Docker Compose](https://docs.docker.com/compose/install/) is already installed, you can use a simple terminal command to create a new Laravel application.
301-
302-
First, if you are using Docker Desktop for Linux, you should execute the following command. If you are not using Docker Desktop for Linux, you may skip this step:
303-
304-
```shell
305-
docker context use default
306-
```
307-
308-
Then, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:
309-
310-
```shell
311-
curl -s https://laravel.build/example-app | bash
312-
```
313-
314-
Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.
315-
316-
Sail installation may take several minutes while Sail's application containers are built on your local machine.
317-
318-
After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:
319-
320-
```shell
321-
cd example-app
322-
323-
./vendor/bin/sail up
324-
```
325-
326-
Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations):
327-
328-
```shell
329-
./vendor/bin/sail artisan migrate
330-
```
331-
332-
Finally, you can access the application in your web browser at: http://localhost.
333-
334-
> [!NOTE]
335-
> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail).
336-
337-
<a name="choosing-your-sail-services"></a>
338-
### Choosing Your Sail Services
339-
340-
When creating a new Laravel application via Sail, you may use the `with` query string variable to choose which services should be configured in your new application's `docker-compose.yml` file. Available services include `mysql`, `pgsql`, `mariadb`, `redis`, `valkey`, `memcached`, `meilisearch`, `typesense`, `minio`, `selenium`, and `mailpit`:
341-
342-
```shell
343-
curl -s "https://laravel.build/example-app?with=mysql,redis" | bash
344-
```
345-
346-
If you do not specify which services you would like configured, a default stack of `mysql`, `redis`, `meilisearch`, `mailpit`, and `selenium` will be configured.
347-
348-
You may instruct Sail to install a default [Devcontainer](/docs/{{version}}/sail#using-devcontainers) by adding the `devcontainer` parameter to the URL:
349-
350-
```shell
351-
curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash
352-
```
353-
354205
<a name="ide-support"></a>
355206
## IDE Support
356207

sail.md

+1-19
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Laravel Sail is supported on macOS, Linux, and Windows (via [WSL2](https://docs.
4343
<a name="installation"></a>
4444
## Installation and Setup
4545

46-
Laravel Sail is automatically installed with all new Laravel applications so you may start using it immediately. To learn how to create a new Laravel application, please consult Laravel's [installation documentation](/docs/{{version}}/installation#docker-installation-using-sail) for your operating system. During installation, you will be asked to choose which Sail supported services your application will be interacting with.
46+
Laravel Sail is automatically installed with all new Laravel applications so you may start using it immediately.
4747

4848
<a name="installing-sail-into-existing-applications"></a>
4949
### Installing Sail Into Existing Applications
@@ -183,24 +183,6 @@ Composer commands may be executed using the `composer` command. Laravel Sail's a
183183
sail composer require laravel/sanctum
184184
```
185185

186-
<a name="installing-composer-dependencies-for-existing-projects"></a>
187-
#### Installing Composer Dependencies for Existing Applications
188-
189-
If you are developing an application with a team, you may not be the one that initially creates the Laravel application. Therefore, none of the application's Composer dependencies, including Sail, will be installed after you clone the application's repository to your local computer.
190-
191-
You may install the application's dependencies by navigating to the application's directory and executing the following command. This command uses a small Docker container containing PHP and Composer to install the application's dependencies:
192-
193-
```shell
194-
docker run --rm \
195-
-u "$(id -u):$(id -g)" \
196-
-v "$(pwd):/var/www/html" \
197-
-w /var/www/html \
198-
laravelsail/php84-composer:latest \
199-
composer install --ignore-platform-reqs
200-
```
201-
202-
When using the `laravelsail/phpXX-composer` image, you should use the same version of PHP that you plan to use for your application (`80`, `81`, `82`, `83`, or `84`).
203-
204186
<a name="executing-artisan-commands"></a>
205187
### Executing Artisan Commands
206188

0 commit comments

Comments
 (0)