> ## Documentation Index
> Fetch the complete documentation index at: https://www.aptible.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a PHP + Laravel Template

> Deploy a starter template PHP app using the Laravel framework on Aptible

> [card] [Deploy Now](https://app.aptible.com/create)

> [card] [GitHub Repo](https://github.com/aptible/template-laravel)

> [card] [View Live Example](https://app-52756.on-aptible.com/)

# Overview

This guide will walk you through the process of launching a PHP app using the [Laravel framework](https://laravel.com/).

# Deploy Template

> [!NOTE]
>
> Prerequisite: Ensure you have [Git](https://git-scm.com/downloads) installed.

Using the [Deploy Code](https://app.aptible.com/create) tool in the Aptible Dashboard, you can deploy the **Laravel Template**. The tool will guide you through the following:

**1. Deploy with Git Push**

![](https://mintcdn.com/aptible/opX5eNKf32ujRi0n/images/php1.png?fit=max\&auto=format\&n=opX5eNKf32ujRi0n\&q=85\&s=7fb890d33645401e160132ba972cadab)

**2. Add an SSH key**

![](https://mintcdn.com/aptible/opX5eNKf32ujRi0n/images/php2.png?fit=max\&auto=format\&n=opX5eNKf32ujRi0n\&q=85\&s=5d4290f259189b704b68718174bc1055) If you have not done so already, you will be prompted to set up an [SSH key](https://www.aptible.com/docs/core-concepts/security-compliance/authentication/ssh-keys.md#ssh-keys).

**3. Environment Setup**

![](https://mintcdn.com/aptible/opX5eNKf32ujRi0n/images/php3.png?fit=max\&auto=format\&n=opX5eNKf32ujRi0n\&q=85\&s=e55f9a60b747aae8f6ed523eea3c218b) Select your [stack](https://www.aptible.com/docs/core-concepts/architecture/stacks.md) to deploy your resources. This will determine what region your resources are deployed to. Then, name the [environment](https://www.aptible.com/docs/core-concepts/architecture/environments.md) your resources will be grouped into.

**4. Prepare the template**

![](https://mintcdn.com/aptible/opX5eNKf32ujRi0n/images/php4.png?fit=max\&auto=format\&n=opX5eNKf32ujRi0n\&q=85\&s=265a454c862588b957124e7334eaeac5) Select **Laravel Template** for deployment, and follow command-line instructions.

**5. Fill environment variables and deploy!**

![](https://mintcdn.com/aptible/opX5eNKf32ujRi0n/images/php5.png?fit=max\&auto=format\&n=opX5eNKf32ujRi0n\&q=85\&s=e2fefd126f15f6937e4057f401f0ac67) Aptible will automatically fill this template's required databases, services, and app's configuration with environment variable keys for you to fill with values. Once complete, save and deploy the code!

Aptible will stream the logs to you in live time: ![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/php6.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=a336e3ac17d3d4b542379776db455642)

**6. Expose your app to the internet**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/php7.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=c9123bc641b82d9e045943c066c4c74c) Now that your code is deployed, it's time to expose your app to the internet. Select the service that needs an [endpoint](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/overview.md), and Aptible will automatically provision a managed endpoint.

**7. View your deployed app**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/php8.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=a0ce83d45b5c30d87d69c02e95693cd0)

# Continue your journey

> [card] [Deploy custom code](https://www.aptible.com/docs/custom-code-quickstart.md)
>
> Read our guide for deploying custom code on Aptible.
