How to Deploy Laravel Project to China?
Tags: laravel, php, webdev, china
Published: 2021-03-09 23:07:08

---
canonical_url: https://www.21cloudbox.com/solutions/how-to-deploy-laravel-project-in-production-server.html
---
# What is Laravel?

Laravel is a modern web application framework developed written in PHP. Their is a very active community that supports Laravel, resulting in large plug-in library to choose from.

[21YunBox](https://launch-in-china.21yunbox.com/) provides a very simple Laravel deployment method. You can quickly and easily deploy with 21YunBox in a **static webpage** environment.

# How to Deploy PHP Laravel in China?
1. Register as a [21YunBox member](https://www.21cloudbox.com/u/signup/)
2. Create a [PostgreSQL database](https://launch-in-china.21yunbox.com/solutions/how-to-create-a-postgresql-database.html)
3. Fork [Laravel example](https://gitee.com/eryiyunbox-examples/hello-laravel) on Gitee
4. Create a **Cloud Service** on the 21YunBox, and allow the 21YunBox to access your code base
5. Configure the following settings

**Environment**
```bash
PHP 7.2
```

**Build command**:
```bash
./build.sh
```

**Start command**:
```bash
php artisan serve --host=0.0.0.0 --port 10000
```

Click Advanced Configuration to configure environment variables:


| KEY               | VALUE |
| :--------------:  | :-------------: |
| **APP_ENV**       | **`production`** |
| **DB_CONNECTION** | **`pgsql`** |
| **DATABASE_URL**  | In the first step to create a cloud database<br> midpoint **Database URL** get |
| **APP_KEY**       | Paste the key generated by `php artisan key:generate --show` |

If you'd like a step by step example, please refer to the video below:
[How to deploy the Laravel project to the server](https://www.bilibili.com/video/BV1ef4y1v7rK)


# Why Choose 21YunBox?

> 21YunBox is a Cloud Service Platform based out of Beijing, China. Our services provides you with an easy and budget friendly, end-to-end web platform deployment service for all applications and stacks. No matter your need, we have a flexible solution to assist.
>
> If needed, we also offer [full support in obtaining your ICP license](https://launch-in-china.21yunbox.com/solutions/how-to-get-an-ICP-license-for-china.html) which allows you to legally host online content within Mainland China.


To learn about the differences between 21YunBox and these foreign (outside of China) cloud service platforms, please refer to:

* [21YunBox vs Heroku](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-heroku-in-china.html)
* [21YunBox vs Netlify](https://launch-in-china.21yunbox.com/blog/solutions/alternatives-to-netlify-in-china.html)
* [21YunBox vs Vercel](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-vercel-in-china.html)
* [21YunBox vs Gatsby Cloud](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-gatsby-cloud-in-china.html)
* [21YunBox vs Github Pages](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-github-pages-in-china.html)
* [21YunBox vs Surge.sh](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-surgesh-in-china.html)
* [Compare in terms of function and price: 21YunBox vs Heroku, Netlify, Vercel](https://www.21yunbox.com/compare-others/)


<br>
*This article's content originated [here](https://launch-in-china.21yunbox.com/solutions/how-to-deploy-laravel-project-in-production-server.html)*

*For additional detail and future modifications, refer the original post.*